[gdal-dev] Gdal install from source error :

Sylvain Maffren smaffren at gmail.com
Sun Feb 7 21:53:32 PST 2021


Hello,

I am trying to insatll GDAL manually by compiling from src. Here is the
different versions of the librairies used :

GDAL_VERSION=3.2.1
GEOS_VERSION=3.8.1 (manual compilation)
PROJ_VERSION=7.2.1 (manual compilation)
HDF5_VERSION=1.10.5 (manual compilation)
NETCDF_VERSION=4.7.4 (manual compilation)
OPENJPEG_VERSION=2.4.0 (manual compilation)
PROJ_DAT_VERSION=1.8 (manual compilation)

I had some errors I managed to fix by following some google posts. It
just remains one and I can't find any clue on internet on how to fix
it.

Here is the way I used to compile GDAL from src :

cd $ROOTDIR/src
echo "Downloading sources and compiling GDAL"
wget -q 
https://github.com/OSGeo/gdal/releases/download/v${GDAL_VERSION}/gdal-${GDAL_VERSION}.tar.gz
tar -xvf gdal-${GDAL_VERSION}.tar.gz &>> /dev/null

cd $ROOTDIR/src/gdal-${GDAL_VERSION}
CFLAGS="-O3 -pipe -march=native -w"; CXXFLAGS="${CFLAGS}" ./configure
--with-proj=$ROOTDIR --with-cpp14  --with-crypto=yes --with-liblzma --
with-python --with-geos=$ROOTDIR --with-spatialite --with-
openjpeg=$ROOTDIR --with-hdf5=$ROOTDIR --with-netcdf=$ROOTDIR --with-pg 
--with-curl --with-png 
make -s -j$(nproc) &>> /dev/null 
make install
ldconfig 
make clean &>> /dev/null

echo "Install GDAL python"    
cd $ROOTDIR/src/gdal-${GDAL_VERSION}/swig/python
python3 setup.py build && python3 setup.py install

I got this error and I am unable to complete the compilation :

make[1] : on entre dans le répertoire « /usr/src/gdal-3.2.1/apps »
/bin/bash /usr/src/gdal-3.2.1/libtool --mode=link --silent
g++  gdalinfo_bin.lo  /usr/src/gdal-3.2.1/libgdal.la  -o gdalinfo
/usr/bin/ld: /usr/src/gdal-3.2.1/.libs/libgdal.so: undefined reference
to `opj_encoder_set_extra_options'
collect2: error: ld returned 1 exit status
make[1]: *** [GNUmakefile:90: gdalinfo] Error 1
make[1] : on quitte le répertoire « /usr/src/gdal-3.2.1/apps »
make: *** [GNUmakefile:120: apps-target] Error 2

It seems that the reference to  `opj_encoder_set_extra_options' is
linked to the OpenJPEG librairy but I didn't have any errors when I
compiled manually OpenJPEG librairy. And I didn't find any clue on
internet to fix it.

Did I miss something in my compilation process ?

Thanks in adavance for your advice.


-- 
Sylvain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20210208/519ee8f0/attachment.html>


More information about the gdal-dev mailing list