[gdal-dev] building gdal with python and libtool

Kai Muehlbauer kai.muehlbauer at uni-bonn.de
Fri Jul 1 00:03:56 PDT 2016


Hi all,

I tried to reproduce this with a standard linux system. So I used my 
OpenSuse Leap42 Box.

Steps to reproduce:

1. Download gdal-2.1.0 tarball
2. extract to some folder
3. ./configure --prefix=/usr/local --with-python
4. make

This builds fine using libtool.

5. extract gdal tarball to another folder (just to be sure)
6. export CC=gcc
7. export CXX=g++
8. ./configure --prefix=/usr/local --with-python
9. make

This fails in swig/python with the error mentioned in the OP. See 
attached excerpt of the build log.

I haven't found anything related to this special problem yet. But it 
turns out, that something is happening in the combination of `configure` 
and `libtool` when CC and CXX are exported in the environment. It is 
actually working, if you add `--without-libtool` to the call to `configure`.

To come back to my OP, we are using this approach (exporting CC and CXX) 
to build different packages, but only experiencing this issue with gdal 
so far.

It would be very helpful, if gdal-devs could have a look into this.

Thanks again!

Cheers,
Kai




Am 27.06.2016 um 20:49 schrieb Kai Mühlbauer:
> Hi all,
>
> while trying to build gdal on linux (on CircleCi in a CentOS based
> docker image using conda/conda-forge) like this:
>
> ------------------------------------------------------------
> export CC=gcc
> export CXX=g++
> export CFLAGS="${CFLAGS}"
> export CXXFLAGS="${CXXFLAGS} -DBOOST_MATH_DISABLE_FLOAT128"
> export LDFLAGS="${LDFLAGS}"
> export LINKFLAGS="${LDFLAGS}"
> export CFLAGS="${CFLAGS} -m${ARCH}"
> export CXXFLAGS="${CXXFLAGS} -m${ARCH}"
>
> export LDFLAGS="$LDFLAGS -L$PREFIX/lib"
> export CPPFLAGS="$CPPFLAGS -I$PREFIX/include"
>
> ./configure --prefix=$PREFIX \
>              --with-hdf4=$PREFIX \
>              --with-hdf5=$PREFIX \
>              --with-xerces=$PREFIX \
>              --with-netcdf=$PREFIX \
>              --with-geos=$PREFIX/bin/geos-config \
>              --with-kea=$PREFIX/bin/kea-config \
>              --with-static-proj4=$PREFIX \
>              --with-libz=$PREFIX \
>              --with-png=$PREFIX \
>              --with-jpeg=$PREFIX \
>              --with-libjson-c=$PREFIX \
>              --with-expat=$PREFIX \
>              --with-freexl=$PREFIX \
>              --with-libtiff=$PREFIX \
>              --with-xml2=$PREFIX \
>              --with-openjpeg=$PREFIX \
>              --with-spatialite=$PREFIX \
>              --with-pg=$PREFIX/bin/pg_config \
>              --with-sqlite3=$PREFIX \
>              --with-curl \
>              --with-python \
>              --disable-rpath
>
> make
> make install
> -----------------------------------------------------------
>
> we are experiencing the same issue like posted here:
>
> http://www.michael-joost.de/gdal_install.html
>
> Everything works OK, until the build descends into the swig/python
> subdir, then the two compile commands work using libtool. But when it
> comes to linking, we get this error:
>
> /bin/bash -pthread -shared -L/home/sam/miniconda3/envs/_build/lib
> -Wl,-rpath=/home/sam/miniconda3/envs/_build/lib,--no-as-needed
> -L/home/sam/miniconda3/envs/_build/lib
> -L/home/sam/miniconda3/envs/_build/lib -m64 -Wall
> -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter
> -Wmissing-prototypes -Wmissing-declarations -Wformat
> -Werror=format-security -Wno-format-nonliteral -Wlogical-op -Wshadow
> -Werror=vla -Wdeclaration-after-statement -DOGR_ENABLED
> -I/home/sam/miniconda3/envs/_build/include
> -I/home/sam/miniconda3/conda-bld/work/gdal-2.1.0/port
> -I/home/sam/miniconda3/envs/_build/include
> -I/home/sam/miniconda3/envs/_build/include
> -I/home/sam/miniconda3/envs/_build
> -I/home/sam/miniconda3/envs/_build/include
> -I/home/sam/miniconda3/envs/_build/include
> -I/home/sam/miniconda3/envs/_build
> -I/home/sam/miniconda3/envs/_build/include
> -I/home/sam/miniconda3/envs/_build
> -I/home/sam/miniconda3/envs/_build/include -DGDAL_COMPILATION
> build/temp.linux-x86_64-3.4/extensions/gdal_wrap.o -L../../.libs
> -L../../ -L/home/sam/miniconda3/envs/_build/lib
> -L/home/sam/miniconda3/conda-bld/work/gdal-2.1.0/lib -lpython3.4m -lgdal
> -o build/lib.linux-x86_64-3.4/osgeo/_gdal.cpython-34m.so
> /bin/bash: -d: invalid option
> error: command '/bin/bash' failed with exit status 1
> make[2]: *** [build] Error 1
> make[2]: Leaving directory
> `/home/sam/miniconda3/conda-bld/work/gdal-2.1.0/swig/python'
> make[1]: *** [build] Error 2
> make[1]: Leaving directory
> `/home/sam/miniconda3/conda-bld/work/gdal-2.1.0/swig'
>
> Using internet search I found that it could be related to wrongly set
> environment variables. But I can't find any problems so far. Using
> configure with --without-libtool leads to stable build without errors.
>
> Although we can build gdal this way, we like to find the root cause of
> this libtool-problem. Any hints appreciated!
>
> Cheers,
> Kai
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
Kai Muehlbauer
Meteorological Institute University of Bonn
Auf dem Huegel 20       | +49 228 739083
D-53121 Bonn            | kai.muehlbauer at uni-bonn.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build.log
Type: text/x-log
Size: 4498 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20160701/00e740ad/attachment.bin>


More information about the gdal-dev mailing list