Ticket #1878 (closed defect: worksforme)

Opened 10 months ago

Last modified 9 months ago

programs can't find .o when linking

Reported by: kyngchaos Assigned to: mloskot
Priority: high Milestone: 1.5.0
Component: ConfigBuild Version: svn-trunk
Severity: major Keywords: libtool
Cc: warmerdam

Description

When building the programs (first one it tries is ogrinfo), the link stage tries to link the .o (ie ogrinfo.o) in the source dir. But these are in .libs/ and the .lo is the one in the source dir. So, it complains about a missing .o. It looks like from the makefile (ogr/gnumakefile) nothing has changed, so maybe libtool changed to now build .lo's (libtool v1.5.2 in GDAL 1.4, now v2.1 in trunk).

(cd ogr; make apps)

/bin/sh /Users/Shared/src/gdal/gdal-svn-trunk-2007.09.29/libtool --mode=compile --tag=CXX /Users/kyngchaos/bin/c++ub -Wall -Os -Iogrsf_frmts -I. -I/Users/Shared/src/gdal/gdal-svn-trunk-2007.09.29/port -I/Users/Shared/src/gdal/gdal-svn-trunk-2007.09.29/gcore -I/Users/Shared/src/gdal/gdal-svn-trunk-2007.09.29/alg -I/Users/Shared/src/gdal/gdal-svn-trunk-2007.09.29/ogr -I/Users/Shared/src/gdal/gdal-svn-trunk-2007.09.29/ogr/ogrsf_frmts -I/Library/Frameworks/PROJ.framework/unix/include -DPROJ_STATIC -DHAVE_GEOS=1 -I/Library/Frameworks/GEOS.framework/unix/include -DOGR_ENABLED -I/Users/Shared/src/gdal/gdal-svn-trunk-2007.09.29/port -I/Library/Frameworks/UnixImageIO.framework/unix -I/Library/Frameworks/UnixImageIO.framework/unix/include -I/Library/Frameworks/UnixImageIO.framework/unix -I/Library/Frameworks/UnixImageIO.framework/unix/include -I/Library/Frameworks/UnixImageIO.framework/unix -I/Library/Frameworks/UnixImageIO.framework/unix/include -I/Users/Shared/unix/geotiff/include -I/Library/Frameworks/UnixImageIO.framework/unix/include -I/Library/Frameworks/UnixImageIO.framework/unix -I/Library/Frameworks/UnixImageIO.framework/unix/include -I/Users/Shared/unix/netcdf -I/Users/Shared/unix/netcdf/include -I/Users/Shared/unix/cfitsio -I/Users/Shared/unix/cfitsio/include -c -o ogrinfo.o ogrinfo.cpp

libtool: compile: /Users/kyngchaos/bin/c++ub -Wall -Os -Iogrsf_frmts -I. -I/Users/Shared/src/gdal/gdal-svn-trunk-2007.09.29/port -I/Users/Shared/src/gdal/gdal-svn-trunk-2007.09.29/gcore -I/Users/Shared/src/gdal/gdal-svn-trunk-2007.09.29/alg -I/Users/Shared/src/gdal/gdal-svn-trunk-2007.09.29/ogr -I/Users/Shared/src/gdal/gdal-svn-trunk-2007.09.29/ogr/ogrsf_frmts -I/Library/Frameworks/PROJ.framework/unix/include -DPROJ_STATIC -DHAVE_GEOS=1 -I/Library/Frameworks/GEOS.framework/unix/include -DOGR_ENABLED -I/Users/Shared/src/gdal/gdal-svn-trunk-2007.09.29/port -I/Library/Frameworks/UnixImageIO.framework/unix -I/Library/Frameworks/UnixImageIO.framework/unix/include -I/Library/Frameworks/UnixImageIO.framework/unix -I/Library/Frameworks/UnixImageIO.framework/unix/include -I/Library/Frameworks/UnixImageIO.framework/unix -I/Library/Frameworks/UnixImageIO.framework/unix/include -I/Users/Shared/unix/geotiff/include -I/Library/Frameworks/UnixImageIO.framework/unix/include -I/Library/Frameworks/UnixImageIO.framework/unix -I/Library/Frameworks/UnixImageIO.framework/unix/include -I/Users/Shared/unix/netcdf -I/Users/Shared/unix/netcdf/include -I/Users/Shared/unix/cfitsio -I/Users/Shared/unix/cfitsio/include -c ogrinfo.cpp -fno-common -DPIC -o .libs/ogrinfo.o

/bin/sh /Users/Shared/src/gdal/gdal-svn-trunk-2007.09.29/libtool --mode=link /Users/kyngchaos/bin/c++ub ogrinfo.o /Users/Shared/src/gdal/gdal-svn-trunk-2007.09.29/libgdal.la -o ogrinfo

libtool: link: /Users/kyngchaos/bin/c++ub ogrinfo.o -o .libs/ogrinfo -Wl,-bind_at_load /Users/Shared/src/gdal/gdal-svn-trunk-2007.09.29/.libs/libgdal.dylib -L/Library/Frameworks/PROJ.framework/unix/lib -L/Library/Frameworks/GEOS.framework/unix/lib -L/Users/Shared/unix/expat/lib -L/Library/Frameworks/Xerces.framework/unix/lib -L/Library/Frameworks/UnixImageIO.framework/unix -L/Library/Frameworks/UnixImageIO.framework/unix/lib -L/Users/Shared/unix/hdf/lib -L/Users/Shared/unix/ogdi -L/Users/Shared/unix/ogdi/lib -L/Users/Shared/unix/geotiff/lib -L/Users/Shared/unix/netcdf -L/Users/Shared/unix/netcdf/lib -L/Users/Shared/unix/cfitsio -L/Users/Shared/unix/cfitsio/lib -L/usr/local/pgsql/lib -L/Users/Shared/unix/dap/lib -lxml2 -liconv -L/Library/Frameworks/SQLite3.framework/unix/lib -L/Users/Shared/unix/mysql/lib/mysql -L/usr/lib -lproj -lgeos -lgeos_c -liodbc -liodbcinst -lxerces-c -ljasper -lmfhdf -ldf -logdi31 -lgif -ljpeg -lgeotiff -ltiff -lpng -lcfitsio -lpq -ldl -ldap -ldapserver -ldapclient /usr/lib/libxml2.dylib /usr/lib/libiconv.dylib -lpthread -lsqlite3 -lz -lm -lssl -lcrypto

powerpc-apple-darwin8-g++-4.0.1: ogrinfo.o: No such file or directory

i686-apple-darwin8-g++-4.0.1: ogrinfo.o: No such file or directory

lipo: can't figure out the architecture type of: /var/tmp//cc3cdiTP.out

make[1]: *** [ogrinfo] Error 1

make: *** [ogr-apps] Error 2

Change History

09/29/07 15:20:11 changed by kyngchaos

Ack! This goes beyond just the programs - all the dependencies in targets use .o. ie gcore:

default: $(OBJ)

When installing, this causes ALL sources to be rebuilt because the .o's are not found.

10/18/07 10:33:34 changed by kyngchaos

  • priority changed from normal to high.

Sorry to bump the priority up, but this is a major nuisance (having both priority and severity is a bit confusing when reporting a bug).

I poked around a bit, and it seems that it's libtool. In GDAL 1.4, libtool copied each object file up 1 dir from .libs, so it's next to the source and the .lo. The new libtool 2 in GDAL SVN does not do this, thus make target dependencies don't see the .o object files.

10/19/07 10:44:42 changed by mloskot

  • cc set to mloskot.

11/10/07 13:52:39 changed by warmerdam

  • keywords set to libtool.
  • owner changed from warmerdam to mloskot.
  • cc changed from mloskot to warmerdam.

Mateusz,

Could you look into this? Perhaps there is some libtool option or something we should be using?

Also, could you confirm if this affects non-MacOSX platforms as well? I presume it must.

11/25/07 16:28:35 changed by mloskot

  • status changed from new to assigned.

11/26/07 11:48:18 changed by mloskot

  • status changed from assigned to closed.
  • resolution set to worksforme.

I can not reproduce this problem. I built GDAL 1.5.0 (SVN) and 1.4.4 using --with-libtool as well as using --without-libtool and both work for me well. I run test builds on clean source trees. Machine: Mac OS X 10.4

$ gcc --version
i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)

I'm closing this ticket as works for me. Please, reopen if it does not work for you.

11/26/07 12:42:43 changed by kyngchaos

I don't know what's up with my system. This started in OSX 10.4, and still happens (last check a couple weeks ago) in 10.5 in a migrated user environment. I have a clean environment (OSX 10.4) that I can try it in, just to make sure.