Quantcast

[gdal-dev] GDAL 2.1.2 compilation error

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[gdal-dev] GDAL 2.1.2 compilation error

Craig Bruce
I'm trying to build GDAL 2.1.2 on Fedora 15 Linux.  I'm using a complicated environment and collection of .a files (because .so's are like a box of chocolates) and running into a some GDAL-internal function that's missing:

g++ -L/cw/builds_3p/linux_f15_x64/lib gdalinfo_bin.o  /cw/src_3p/gdal-2.1.2/libgdal.a    -L/cw/builds_3p/linux_f15_x64/lib -lproj -L/cw/builds_3p/linux_f15_x64/lib -lexpat -L/usr/local/lib -lxerces-c -lpthread -L/cw/builds_3p/linux_f15_x64 -L/cw/builds_3p/linux_f15_x64/lib -logdi -L/cw/builds_3p/linux_f15_x64 -L/cw/builds_3p/linux_f15_x64/lib -ljpeg -L/cw/builds_3p/linux_f15_x64/lib -lgeotiff -L/cw/builds_3p/linux_f15_x64/lib -ltiff -lpng -lz -L/cw/builds_3p/linux_f15_x64 -L/cw/builds_3p/linux_f15_x64/lib -lpthread -lm -lrt -ldl -ljpeg -lecwj2   -lcurl   -L/cw/builds_3p/linux_f15_x64/3rd-party/lib -L/cw/builds_3p/linux_f15_x64/lib -lltidsdk -lpthread  -L/cw/builds_3p/linux_f15_x64/lib -llti_lidar_dsdk           -L/cw/builds_3p/linux_f15_x64/lib -lxml2 -L/cw/builds_3p/linux_f15_x64/lib -lz -lm     -o gdalinfo

/cw/src_3p/gdal-2.1.2/libgdal.a(vrtfilters.o): In function `VRTFilteredSource::RasterIO(int, int, int, int, void*, int, int, GDALDataType, long long, long long, GDALRasterIOExtraArg*)':

vrtfilters.cpp:(.text+0xab4): undefined reference to `CPLErr VRTComplexSource::RasterIOInternal<float>(int, int, int, int, void*, int, int, GDALDataType, long long, long long, GDALRasterIOExtraArg*, GDALDataType)'

collect2: ld returned 1 exit status
make[1]: *** [gdalinfo] Error 1
make[1]: Leaving directory `/home/sourcetree/cw/src_3p/gdal-2.1.2/apps'
make: *** [apps-target] Error 2

The configuration is set with:

    ./configure \
        --prefix="${BUILD_DIR}" \
        --disable-shared \
        --enable-static \
        --with-pic \
        --without-ld-shared \
        --without-libtool \
        --with-libz="${BUILD_DIR}" \
        --with-jpeg="${BUILD_DIR}" \
        --with-ogdi="${BUILD_DIR}" \
        --with-libz="${BUILD_DIR}" \
        --with-expat="${BUILD_DIR}" \
        --with-static-proj4="${BUILD_DIR}" \
        --with-libtiff="${BUILD_DIR}" \
        --with-geotiff="${BUILD_DIR}" \
        --with-ecw="${BUILD_DIR}" \
        --with-mrsid="${MRSID}" \
        --with-jp2mrsid="${MRSID_JP2}" \
        --with-mrsid_lidar="${MRSID_LIDAR}" \
        --without-sqlite3 \
        --without-gif \
        --without-oci \
        --without-odbc \
        --with-curl

where the variables refer to the locations of other pre-built third-party libraries.

Any ideas on what's going wrong?

--
Dr. Craig S. Bruce
Senior Software Developer
CubeWerx Inc.
http://www.cubewerx.com

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GDAL 2.1.2 compilation error

Even Rouault-2
Craig,

I've downloaded a Fedora 15 x86_64 DVD iso (setup with Development
environment) and just tried on GDAL 2.1.2
 ./configure \
          --disable-shared \
          --enable-static \
          --with-pic \
          --without-ld-shared \
          --without-libtool
and it builds fine. Both with gcc 4.6.0 that comes with the DVD, and 4.6.3
after the updates.
So it would seem that it is one of the dependency that might cause the issue
(which seems odd)

Even

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GDAL 2.1.2 compilation error

Craig Bruce
On 11/09/2016 04:14 PM, Even Rouault wrote:
and it builds fine. Both with gcc 4.6.0 that comes with the DVD, and 4.6.3 
after the updates.
So it would seem that it is one of the dependency that might cause the issue 
(which seems odd)
It's very strange.  It builds fine for me in the same build environment on Fedora 24, 19, 12, and 5 but not on 15.  Looking at the relevant .o files, on Fedora 24 I get:

[craig:/cw/src_3p/gdal-2.1.2/frmts/o] nm vrtfilters.o|grep RasterIOInternal
                 U _ZN16VRTComplexSource16RasterIOInternalIfEE6CPLErriiiiPvii12GDALDataTypexxP20GDALRasterIOExtraArgS3_

[craig:/cw/src_3p/gdal-2.1.2/frmts/o] nm vrtsources.o|grep RasterIOInternal
0000000000000000 W _ZN16VRTComplexSource16RasterIOInternalIdEE6CPLErriiiiPvii12GDALDataTypexxP20GDALRasterIOExtraArgS3_
0000000000000000 W _ZN16VRTComplexSource16RasterIOInternalIfEE6CPLErriiiiPvii12GDALDataTypexxP20GDALRasterIOExtraArgS3_
0000000000000000 u _ZZN16VRTComplexSource16RasterIOInternalIdEE6CPLErriiiiPvii12GDALDataTypexxP20GDALRasterIOExtraArgS3_E10bHasWarned
0000000000000000 u _ZZN16VRTComplexSource16RasterIOInternalIfEE6CPLErriiiiPvii12GDALDataTypexxP20GDALRasterIOExtraArgS3_E10bHasWarned

But on the Fedora 15 machine with GCC 4.6.3, I get:

[dev:/cw/src_3p/gdal-2.1.2/frmts/o] nm vrtfilters.o|grep RasterIOInternal
                 U _ZN16VRTComplexSource16RasterIOInternalIfEE6CPLErriiiiPvii12GDALDataTypexxP20GDALRasterIOExtraArgS3_

[dev:/cw/src_3p/gdal-2.1.2/frmts/o] nm vrtsources.o|grep RasterIOInternal
0000000000000000 u _ZZN16VRTComplexSource16RasterIOInternalIdEE6CPLErriiiiPvii12GDALDataTypexxP20GDALRasterIOExtraArgS3_E10bHasWarned
0000000000000000 u _ZZN16VRTComplexSource16RasterIOInternalIfEE6CPLErriiiiPvii12GDALDataTypexxP20GDALRasterIOExtraArgS3_E10bHasWarned

I really don't know how GCC handles C++ templates internally, but the problem machine is missing 'nm' entries of type 'W' (which apparently means "weak symbol") to bridge the gap between the "_ZN16" reference and the "_ZZN16" definition.

I worked around the problem by making a float-type-only copy of the templated function VRTComplexSource::RasterIOInternal() and calling that instead inside "vrtfilters.cpp" and GCC 4.6.3 seems to be happy with that.

--
Dr. Craig S. Bruce
Senior Software Developer
CubeWerx Inc.
http://www.cubewerx.com

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GDAL 2.1.2 compilation error

Even Rouault-2
>  I worked around the problem by making a float-type-only copy of the
> templated function VRTComplexSource::RasterIOInternal() and calling that
> instead inside "vrtfilters.cpp" and GCC 4.6.3 seems to be happy with that.

I've reproduced the issue with another compiler and fixed it with
https://trac.osgeo.org/gdal/ticket/6748


--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Loading...