geo-data / cesium-terrain-builder

A C++ library and associated command line tools designed to create terrain tiles for use in the Cesium JavaScript library
Other
713 stars 341 forks source link

Build GDAL 2.1.4 from source under Ubuntu 14.04 #66

Open mrgloom opened 6 years ago

mrgloom commented 6 years ago

Seems current master is not compiling with GDAL 2.1.0 and GDAL 2.2.* (btw what version it supports officially?) and I can't find ppa to install GDAL 2.1.4 on Ubuntu 14.04, so I tried to compile it from source.

wget http://download.osgeo.org/gdal/2.1.4/gdal-2.1.4.tar.gz
tar -xvzf gdal-2.1.4.tar.gz
cd gdal-2.1.4/
mkdir deploy
./configure --prefix=/home/user/temp/gdal-2.1.4/deploy
make

It fails with

make[2]: Entering directory `/home/user/temp/gdal-2.1.4/frmts/postgisraster'
/bin/bash /home/user/temp/gdal-2.1.4/libtool --mode=compile --tag=CXX g++ -I/home/user/temp/gdal-2.1.4/port -I/home/user/temp/gdal-2.1.4/gcore -I/home/user/temp/gdal-2.1.4/alg -I/home/user/temp/gdal-2.1.4/ogr -I/home/user/temp/gdal-2.1.4/ogr/ogrsf_frmts -I/home/user/temp/gdal-2.1.4/gnm -I/home/user/temp/gdal-2.1.4/apps -g -O2  -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names  -I ../mem -I ../vrt  -I/home/user/anaconda3/include -I/home/user/anaconda3/include/server  -DPG_HAS_PQESCAPESTRINGCONN  -DOGR_ENABLED -I/home/user/temp/gdal-2.1.4/port -I/usr/include/libqhull -I/usr/include/qhull  -DGDAL_COMPILATION -c -o ../o/postgisrasterdriver.lo postgisrasterdriver.cpp
libtool: compile:  g++ -I/home/user/temp/gdal-2.1.4/port -I/home/user/temp/gdal-2.1.4/gcore -I/home/user/temp/gdal-2.1.4/alg -I/home/user/temp/gdal-2.1.4/ogr -I/home/user/temp/gdal-2.1.4/ogr/ogrsf_frmts -I/home/user/temp/gdal-2.1.4/gnm -I/home/user/temp/gdal-2.1.4/apps -g -O2 -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -I ../mem -I ../vrt -I/home/user/anaconda3/include -I/home/user/anaconda3/include/server -DPG_HAS_PQESCAPESTRINGCONN -DOGR_ENABLED -I/home/user/temp/gdal-2.1.4/port -I/usr/include/libqhull -I/usr/include/qhull -DGDAL_COMPILATION -c postgisrasterdriver.cpp  -fPIC -DPIC -o ../o/.libs/postgisrasterdriver.o
In file included from postgisrasterdriver.cpp:31:0:
postgisraster.h:41:22: fatal error: libpq-fe.h: No such file or directory
 #include "libpq-fe.h"

So I have installed sudo apt-get install libpq-dev and added export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/include/postgresql/

but get another error:

/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kealib::KEAImageIO::isKEAImage(std::string)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kmldom::Parse(std::string const&, std::string*)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kealib::KEAImageIO::setImageMetaData(std::string, std::string)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `MakeMapObject'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `png_get_asm_flags'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `libiconv_open'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `png_set_asm_flags'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kealib::KEAImageIO::openKeaH5RDOnly(std::string, int, unsigned long long, unsigned long long, double, unsigned long long, unsigned long long)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kmlengine::KmzFile::ReadFile(char const*, std::string*) const'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kealib::KEAImageIO::createKEAImage(std::string, kealib::KEADataType, unsigned int, unsigned int, unsigned int, std::vector<std::string, std::allocator<std::string> >*, kealib::KEAImageSpatialInfo*, unsigned int, unsigned int, int, unsigned long long, unsigned long long, double, unsigned long long, unsigned long long, unsigned int)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kealib::KEAImageIO::openKeaH5RW(std::string, int, unsigned long long, unsigned long long, double, unsigned long long, unsigned long long)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kealib::KEAImageIO::setGCPs(std::vector<kealib::KEAImageGCP*, std::allocator<kealib::KEAImageGCP*> >*, std::string)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kmlengine::KmzFile::ReadKmlAndGetPath(std::string*, std::string*) const'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kealib::KEAImageIO::getImageMetaData()'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kealib::KEAImageIO::getGCPProjection()'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `libiconv_close'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kmldom::SerializePretty(boost::intrusive_ptr<kmldom::Element> const&)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `png_get_asm_flagmask'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kmlengine::Href::Parse(std::string const&)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kealib::KEAImageIO::setImageBandMetaData(unsigned int, std::string, std::string)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kealib::KEAImageIO::getImageBandDescription(unsigned int)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kealib::KEAImageIO::setImageBandDescription(unsigned int, std::string)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `FreeMapObject'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kmlengine::KmzFile::OpenFromString(std::string const&)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `PrintGifError'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kealib::KEAImageIO::getImageBandMetaData(unsigned int)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `libiconv'
collect2: error: ld returned 1 exit status
make[1]: *** [gdalinfo] Error 1
make[1]: Leaving directory `/home/user/temp/gdal-2.1.4/apps'
make: *** [apps-target] Error 2