Open icemagno opened 7 years ago
My history (from a new Ubuntu install):
add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
apt-get update
apt-get upgrade
apt-get install gdal-bin python-gdal python3-gdal
gdalinfo --version
$ GDAL 2.2.1, released 2017/06/23
wget https://github.com/geo-data/cesium-terrain-builder/archive/v0.4.1.tar.gz
tar -xvf v0.4.1.tar.gz
cd cesium-terrain-builder-0.4.1/
mkdir build && cd build && cmake .. && make install
(oops! Missing cmake)
apt-get install cmake
mkdir build && cd build && cmake .. && make install
(oops... can't find compiler)
apt-get install build-essential
mkdir build && cd build && cmake .. && make install
(oops.. Could NOT find GDAL (missing: GDAL_LIBRARY GDAL_INCLUDE_DIR)
vim CMakeLists.txt
(The Thor method! comment what is doing wrong! )
# We need GDAL
#find_package(GDAL)
#if(NOT GDAL_FOUND)
# message(FATAL_ERROR "The GDAL library cannot be found on the system")
#endif()
include_directories("/usr/lib") <<<--------- My GDAL location by force!
mkdir build && cd build && cmake .. && make install
( oops... The GDAL version must be one that implements RFC 46 (GDAL/OGR unification))
apt-get install -y gdal-bin python-gdal libgdal-dev
mkdir build && cd build && cmake .. && make install
( oops !! DAMN IT ! fatal error: gdalwarper.h: No such file or directory )
Jesus !! I'm almost quit !
Solved.
mea culpa
1) Remove comments made on CMakeLists.txt 2) Invoke
mkdir build && cd build && cmake cmake -DGDAL_LIBRARY_DIR=/usr/lib/ -DGDAL_LIBRARY=/usr/lib/libgdal.so -DGDAL_INCLUDE_DIR=/usr/include/gdal/ .. && make instal
and then
cp src/libctb.so /usr/lib
For anyone else, adding this to the CMakeLists.txt helps debugging immensely
MESSAGE( STATUS "GDAL_LIBRARY_DIR: " ${GDAL_LIBRARY_DIR})
MESSAGE( STATUS "GDAL_INCLUDE_DIR: " ${GDAL_INCLUDE_DIR})
MESSAGE( STATUS "GDAL_LIBRARY: " ${GDAL_LIBRARY})
MESSAGE( STATUS "GDAL_VERSION: " ${GDAL_VERSION})
Also setting the GDAL_CONFIG only should set all the other variables for you.
cmake -DGDAL_CONFIG=/usr/local/Cellar/gdal/2.4.4/bin/gdal-config ../.
I'm trying to build CTB but its being a nightmare.
After geting stuck on
and
and some missing GDALOpenEx problem I'm now on this:
Please put the REAL WORKING Instalation guide on your main page to avoid problems. I sugest you to start your guide from a fresh Ubuntu installation and you will see that just say
The dependency is GDAL >= 2.x
is not enough. Build the CTB from zero ground SO is a pain!