Re: [ROOT] GCC-3.0, include paths, ROOT build system, oh my!

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Sat Jul 14 2001 - 10:41:18 MEST


Hi Brett,

  this is a pain in the neck and what concerns me basically a gcc v3
defect. To work around it we have to find a portable way to find out
in the configure script which include paths are searched by default
by the compiler and exclude those paths from appearing in the OPENGLINCDIR 
or any other INCDIR statement. I can for now fix it so that /usr/include
is always assumed to be a path searched by any compiler on any platform.

Btw: I did not see the problem since I installed gcc-3 on my machine in
/opt/gcc-3.00 and therefore std_cwchar.h was found in:
/opt/gcc-3.00/include/g++-v3/bits/std_cwchar.h


Cheers, Fons.



On Fri, Jul 13, 2001 at 02:13:20PM -0400, Brett Viren wrote:
> Hi.
> 
> I just built ROOT from CVS as of today with gcc/g++/g77/libstdc++ v3.0
> on a Debian x86 system.
> 
> I had a problem involving include files.  In particular while
> compiling TGLKernel.cxx:
> 
>  g++ -O2 -pipe -Wall -fPIC -Iinclude  -I/usr/include -o gl/src/TGLKernel.o -c gl/src/TGLKernel.cxx
>  In file included from /usr/include/g++-v3/bits/fpos.h:40,
>                   from /usr/include/g++-v3/bits/std_iosfwd.h:41,
>                   from /usr/include/g++-v3/iosfwd:31,
>                   from include/TObject.h:45,
>                   from include/TNamed.h:26,
>                   from include/TVirtualX.h:28,
>                   from gl/src/TGLKernel.cxx:23:
>  /usr/include/g++-v3/bits/std_cwchar.h:42:24: wchar.h: No such file or directory
> 
> 
> The problem line (std_cwchar.h:42) is this:
> 
> 	#include_next <wchar.h>
> 
> According to "Inheritance and Header Files" in the GNU C pre processor
> info page this "#include_next" directive (which is news to me) tells
> CPP to include the file found by checking all -I directives after the
> one which found the current file.
> 
> Since -I/usr/include is explicitly put on the command line, it is
> checked before the internal -I directives and, evidently, not checked
> again.
> 
> This -I/usr/include directive is inserted in the compile line by the 
> 
> 	OPENGLINCDIR   := /usr/include
> 
> line in config/Makefile.config (generated by configure).  When I
> remove it the compilation succeeds, but GL support is skipped.  If I
> do something like:
> 
> 	OPENGLINCDIR   := /bogus/path
> 
> compilation succeeds, includeing GL support.
> 
> 
> I'm not sure of a good way to handle this.  Maybe a "--with-opengl"
> option to "configure" which turns on GL support but doesn't add an
> include path directive (leaving that to "--with-opengl-incdir").
> 
> It is currently the case, but I could see this same problem happening
> in any of the ROOT packages where a standard system include path is
> inserted in the command line.
> 
> -Brett.

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7677910



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:52 MET