[gdal-dev] Small comment on compiling GDAL 3.0.1 on Ubuntu 18.10

Jorge Gustavo Rocha jgr at osgeopt.pt
Thu Aug 1 02:42:27 PDT 2019


Hi,

I've compiled GDAL 3.0.1 on Ubuntu 18.10. It was my first time compiling
GDAL 3.x. I'm just starting to test it.

I have a small comment on the compilation.

For GDAL 2.x, I just needed to provide:
--with-java=$javadir --with-jvm-lib=$javadir/jre/lib/amd64/server

For GDAL 3.x, I had to set LDFLAGS with -L -l flags (for proj.4 and for
java):
LDFLAGS="-L/usr/lib/jvm/java-8-oracle/jre/lib/amd64/server
-L/usr/local/lib -ljvm" ./configure --with-java=$javadir
--with-jvm-lib=$javadir/jre/lib/amd64/server --with-mdb=yes
--with-python=python3 --with-proj=/usr/local

Probably is my fault, but can I compile it without providing the LDFLAGS
variable?
Shouldn't these be computed from the options --with-java
--with-jvm-lib and --with-proj?

Thanks!

------8<----------------------------------------------

What I've done:

1. Compile proj.4

cd dev
git clone https://github.com/OSGeo/proj.4.git
cd proj.4/
mkdir build && cd build
cmake ..
cmake --build .
sudo make install
sudo ldconfig

2. Compile GDAL 3.0.1 with proj.4 and JAVA

cd dev
wget https://download.osgeo.org/gdal/CURRENT/gdal-3.0.1.tar.gz
tar xvzf gdal-3.0.1.tar.gz
cd gdal-3.0.1
javadir=$(readlink -f $(which java) | grep -oP "^/.+(?=/jre/bin/java$)")
echo $javadir
/usr/lib/jvm/java-8-oracle
LDFLAGS="-L/usr/lib/jvm/java-8-oracle/jre/lib/amd64/server
-L/usr/local/lib -ljvm" ./configure --with-java=$javadir
--with-jvm-lib=$javadir/jre/lib/amd64/server --with-mdb=yes
--with-python=python3 --with-proj=/usr/local
make
sudo make install

------8<----------------------------------------------

Jorge Gustavo
--
OSGeo Portugal
NIF: 509588190
email: geral at osgeopt.pt
https://www.osgeopt.pt/

Próximo evento: SASIG 2017, 20 a 22 de novembro, Porto
Mais informações: http://osgeopt.pt/sasig2017/


More information about the gdal-dev mailing list