[Gdal-dev] grass in 1.2.2 compilation problem
Steve Halasz
debian at adkgis.org
Wed Sep 22 16:32:32 EDT 2004
On Wed, 2004-09-22 at 15:46, Frank Warmerdam wrote:
> Steve Halasz wrote:
> > Hi,
> >
> > I'm attempting to compile 1.2.2 --with-grass against grass 5.7.0. I end
> > up with:
> >
> > make[2]: Entering directory
> > `/home/steve/projects/qgis/debian/gdal/gdal-1.2.2/ogr'
> > /bin/sh ../libtool --mode=compile g++ -Wall -O2
> > -DCPL_MULTIPROC_PTHREAD -Iogrsf_frmts -I. -I../port -I../gcore
> > -I../ogr -I../alg -I../port -c -o ogrinfo.o ogrinfo.cpp
> > g++ -Wall -O2 -DCPL_MULTIPROC_PTHREAD -Iogrsf_frmts -I. -I../port
> > -I../gcore -I../ogr -I../alg -I../port -c ogrinfo.cpp -fPIC -DPIC -o
> > .libs/ogrinfo.o
> > g++ -Wall -O2 -DCPL_MULTIPROC_PTHREAD -Iogrsf_frmts -I. -I../port
> > -I../gcore -I../ogr -I../alg -I../port -c ogrinfo.cpp -o ogrinfo.o
> >
> >>/dev/null 2>&1
> >
> > /bin/sh ../libtool --mode=link g++ ogrinfo.o ../libgdal.la -o ogrinfo
> > g++ ogrinfo.o -o .libs/ogrinfo ../.libs/libgdal.so /usr/lib/libodbc.so
> > /usr/lib/libltdl.so -L/usr/lib -lxerces-c /usr/lib/libjasper.so -lmfhdf
> > -ldf -lgif /usr/lib/libjpeg.so -ltiff -lpng -lnetcdf -lcfitsio
> > -L/usr/lib/grass57/lib -lgrass_I -lgrass_vask -lgrass_gmath -lgrass_gis
> > -lgrass_datetime -lz -lpthread -ldl -lpq
> > ../.libs/libgdal.so: undefined reference to `G_gisinit_2'
> > ../.libs/libgdal.so: undefined reference to `G_check_cell'
> > ../.libs/libgdal.so: undefined reference to `I_check_group'
> > ../.libs/libgdal.so: undefined reference to `G_get_cell_as_proj4'
> > collect2: ld returned 1 exit status
> > make[2]: *** [ogrinfo] Error 1
> > make[2]: Leaving directory
> > `/home/steve/projects/qgis/debian/gdal/gdal-1.2.2/ogr'
> > make[1]: *** [ogr-apps] Error 2
> > make[1]: Leaving directory
> > `/home/steve/projects/qgis/debian/gdal/gdal-1.2.2'
> > make: *** [build-stamp] Error 2
> >
> > It appears that it is trying to compile the libgrass version. Renaming
> > frmts/grass/grass57dataset.cpp to grassdataset.cpp didn't work either. I
> > looked for where the logic to decide which to use was and couldn't find
> > it.
>
> Steve,
>
> It does indeed appear that the libgrass version of the code is being used.
> I suspect that both versions of the code have been compiled and linked in.
> I would suggesting doing a "make clean" and then make again. If you
> reconfigured and rebuilding without a make clean, it is likely that the
> old grassdataset.o would still be handing around in the gdal/frmts/o
> directory or libgdal.a.
Frank,
Thanks for the reply. This is taking place in the context of a debian
build with dpkg-buildpackage, which does a make distclean before every
build. I have verified that this removes grassdataset.o. Also, this
error cropped up the first time I tried to build.
> The logic within the gdal/frmts/grass directory is controlled by the
> GRASS_SETTING variable which should be either "libgrass" or "grass57+".
> You might want to check GDALmake.opt to see if the variable is set properly.
Yes, GDALmake.opt is correctly getting:
GRASS_SETTING = grass57+
GRASS_INCLUDE = -I/usr/lib/grass57/include
But running 'grep -r GRASS_SETTING .' does not show that setting used
anywhere in the source. I also can't find any reference to
grass57dataset. Where does it say:
if GRASS_SETTING = grass57+
use grass57dataset.cpp
else
use grassdataset.cpp
Regards,
Steve
More information about the Gdal-dev
mailing list