[gdal-dev] building gdal with python and libtool
Kai Mühlbauer
kai.muehlbauer at uni-bonn.de
Mon Jun 27 11:49:23 PDT 2016
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
More information about the gdal-dev
mailing list