Seemingly identical gcc versions, except one searches subdirectories with -I

Robert Banfield rbanfield@flenvironmental.org
Wed Mar 28 18:25:00 GMT 2007


I have come across this problem and despite my searches I have been 
unable to find a solution.  I have two Fedora Core 6 machines.  Both 
have the same version of gcc/g++ and the development programs/libraries 
installed.  Both are x86_64.  When I run the command:

[rbanfiel@localhost BobBackup]$ g++ -v 
-Ijasper-uuid/src/libjasper/include -Iinclude -Igdal/port -Igdal/gcore 
-Igdal/alg -Igdal/ogr -Igdal/frmts -Izlib -Ipoco/XML/include 
-Ipoco/Foundation/include -Iinfo-zip -DUSE_ZLIB -DNO_CRYPT 
-DHAVE_JASPER_UUID -D_unzip_H -Dcimg_display_type=0 -c abc.cpp -o abc.o

I get largely the same output, except for the result.  On one machine, 
it compiles (yay!).  On the other machine, it complains about a missing 
header file.  The header file cpl_config.h is located in 
gdal/ogr/ogrsf_frmts/dgn/dist which is a subdirectory of gdal/ogr which 
is specified on the command line above.  I can successfully get it to 
compile by using -Igdal/ogr/ogrsf_frmts/dgn/dist.  Unfortunately there 
are tons of subdirectories in the various libraries I am including, and 
I'd love to not have to specify each and every one.

A diff on the outputs of both versions with the -v flag shows the following:

7c7
<  /usr/libexec/gcc/x86_64-redhat-linux/4.1.1/cc1plus -quiet -v 
-Ijasper-uuid/src/libjasper/include -Iinclude -Igdal/port -Igdal/gcore 
-Igdal/alg -Igdal/ogr -Igdal/frmts -Izlib -Ipoco/XML/include 
-Ipoco/Foundation/include -Iinfo-zip -D_GNU_SOURCE -DUSE_ZLIB -DNO_CRYPT 
-DHAVE_JASPER_UUID -D_unzip_H -Dcimg_display_type=0 abc.cpp -quiet 
-dumpbase abc.cpp -mtune=generic -auxbase-strip abc.o -version -o 
/tmp/ccwnikzF.s
---
 >  /usr/libexec/gcc/x86_64-redhat-linux/4.1.1/cc1plus -quiet -v 
-Ijasper-uuid/src/libjasper/include -Iinclude -Igdal/port -Igdal/gcore 
-Igdal/alg -Igdal/ogr -Igdal/frmts -Izlib -Ipoco/XML/include 
-Ipoco/Foundation/include -Iinfo-zip -D_GNU_SOURCE -DUSE_ZLIB -DNO_CRYPT 
-DHAVE_JASPER_UUID -D_unzip_H -Dcimg_display_type=0 abc.cpp -quiet 
-dumpbase abc.cpp -mtune=generic -auxbase-strip abc.o -version -o 
/tmp/ccsoGgbf.s

// The only difference is the /tmp/cc??????.s file

31c31
< GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
---
 > GGC heuristics: --param ggc-min-expand=46 --param ggc-min-heapsize=31513

// I tried specifying these parameters manually on the second machine 
with no change in result

33,35c33,37
<  as -V -Qy -o abc.o /tmp/ccwnikzF.s
< GNU assembler version 2.17.50.0.6-2.fc6 (x86_64-redhat-linux) using 
BFD version 2.17.50.0.6-2.fc6 20061020
---
 > In file included from gdal/port/cpl_vsi.h:87,
 >                  from gdal/port/cpl_string.h:84,
 >                  from abc.h:25,
 >                  from abc.cpp:24:
 > gdal/port/cpl_port.h:148:24: error: cpl_config.h: No such file or 
directory

// One compiles, the other doesn't.

I have checked my environment also and come up with nothing which would 
explain the difference in behaviors.  Finally, here is a log from the 
compile on the machine in which it worked.

Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man 
--infodir=/usr/share/info --enable-shared --enable-threads=posix 
--enable-checking=release --with-system-zlib --enable-__cxa_atexit 
--disable-libunwind-exceptions --enable-libgcj-multifile 
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada 
--enable-java-awt=gtk --disable-dssi --enable-plugin 
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre 
--with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
 /usr/libexec/gcc/x86_64-redhat-linux/4.1.1/cc1plus -quiet -v 
-Ijasper-uuid/src/libjasper/include -Iinclude -Igdal/port -Igdal/gcore 
-Igdal/alg -Igdal/ogr -Igdal/frmts -Izlib -Ipoco/XML/include 
-Ipoco/Foundation/include -Iinfo-zip -D_GNU_SOURCE -DUSE_ZLIB -DNO_CRYPT 
-DHAVE_JASPER_UUID -D_unzip_H -Dcimg_display_type=0 weokml.cpp -quiet 
-dumpbase weokml.cpp -mtune=generic -auxbase-strip weokml.o -version -o 
/tmp/ccOGy0G5.s
ignoring nonexistent directory 
"/usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../x86_64-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 jasper-uuid/src/libjasper/include
 include
 gdal/port
 gdal/gcore
 gdal/alg
 gdal/ogr
 gdal/frmts
 zlib
 poco/XML/include
 poco/Foundation/include
 info-zip
 /usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../include/c++/4.1.1
 /usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../include/c++/4.1.1/x86_64-redhat-linux
 /usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../include/c++/4.1.1/backward
 /usr/local/include
 /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include
 /usr/include
End of search list.
GNU C++ version 4.1.1 20070105 (Red Hat 4.1.1-51) (x86_64-redhat-linux)
        compiled by GNU C version 4.1.1 20070105 (Red Hat 4.1.1-51).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: c1be8c277545876a2f11bc40e8290a2f
 as -V -Qy -o weokml.o /tmp/ccOGy0G5.s
GNU assembler version 2.17.50.0.6-2.fc6 (x86_64-redhat-linux) using BFD 
version 2.17.50.0.6-2.fc6 20061020

Thank you very much for your time and assistance,
Robert



More information about the Gcc-help mailing list