BuildUbuntuPROJ8 - Maproom/qmapshack GitHub Wiki
Prev (Linux Mint 19.x) | Home | Manual | Index | (Ubuntu version 22.04) Next
Table of contents
- Compile and build QMapShack with PROJ 8 for Ubuntu
Compile and build QMapShack with PROJ 8 for Ubuntu
QMapShack versions beyond version 1.15.2 will use PROJ version 8. This requires some changes in the QMS build procedure. This page is an early release of the description of these changes. It can be used to build current QMS development versions.
The approach described on this page was tested with Ubuntu 18.04 and 20.04.
Basic information about the compilation of QMapShack for Ubuntu can be found here.
Warnings and hints:
- GDAL version 3.x now depends on PROJ. Therefore, don't change the described installation sequence of packages.
- If there are older versions of the used libraries on your system, remove them completely first.
- Don't change the advised directory settings.
Update and install needed packages
-
Ensure that Ubuntu packages have the latest versions
sudo apt update sudo apt upgradeMaybe, a reboot is needed. Then check upgrade again:
sudo apt update sudo apt upgrade -
Integrate UbuntuGIS repository to get the latest GIS build packages
sudo add-apt-repository ppa:ubuntugis/ppa sudo apt update sudo apt upgrade -
Install needed packages
sudo apt install build-essential subversion git qt5-default qttools5-dev libqt5webkit5-dev qtscript5-dev qttools5-dev-tools libghc-bzlib-dev libgraphics-magick-perl libqt5sql5-mysql qtwebengine5-dev default-libmysqlclient-dev libgdal-dev sqlite3 qtcreator -
Install CMake
-
Ubuntu 20.04:
sudo apt install cmake cmake-curses-gui -
Ubuntu 18.04: The minimum
cmakeversion required to build Quazip is 3.15. If already installed, check the current version withcmake --versionIf necessary, remove the current version with
sudo apt remove --purge cmake hash -rInstall the latest version using the
snap packagesudo snap install cmake --classic
-
Install PROJ version 8
Note: If you encounter linker warnings during the QMapShack compilation process it is advised to use PROJ version 7.2.1. In that case, replace 8.0.0 with 7.2.1 in the following steps and rerun them. For PROJ version 7.2.1 the CMakeLists.txt in the PROJ source directory has to be changed to the proper version number: proj_version(MAJOR 7 MINOR 2 PATCH 1).
-
Assume, that the current PROJ release is 8.0.0 (otherwise change the version number in the following lines!)
-
Download
mkdir ~/GPS cd ~/GPS wget https://download.osgeo.org/proj/proj-8.0.0.tar.gz tar xzvf proj-8.0.0.tar.gz cd proj-8.0.0 -
Build and install
mkdir build cd build ccmake .. -DCMAKE_INSTALL_PREFIX=/usrIf the
ccmakerun stops, pressc(maybe, several times) and theng.cmake --build . -j2 sudo cmake --build . --target install
Note: The parameter j2 defines the number of simultaneously running jobs when building the code. You can increase this parameter to the value of the optimal compilation speed depending on your CPU (-j3, -j4, ...).
Install GDAL
Note: Please be patient. The building process will take some time. Depending on your hardware settings it may take 1-2 hours.
-
Download
cd ~/GPS wget https://github.com/OSGeo/gdal/releases/download/v3.2.2/gdal-3.2.2.tar.gz tar xvzf gdal-3.2.2.tar.gz cd gdal-3.2.2 -
Build and install
./configure --prefix=/usr make -j2 sudo make install
Install QUAZIP
-
Assume, that the current QUAZIP release is 1.1 (otherwise change the version number in the following lines!)
-
Download
cd ~/GPS wget https://github.com/stachenov/quazip/archive/refs/tags/v1.1.tar.gz tar xvzf v1.1.tar.gz cd quazip-1.1 mkdir build cd build -
Build and install
ccmake .. -DCMAKE_INSTALL_PREFIX=/usrIf the
ccmakerun stops, pressc(maybe, several times) and theng.cmake --build . -j2 sudo cmake --build . --target install
Install Routino
-
Download
cd ~/GPS svn co http://routino.org/svn/trunk routino cd routino -
Edit
Makefile.conf:- Line 48: set to
prefix=/usr
- Line 48: set to
-
Build and install
make -j2 sudo make install
Install QMapShack
-
Download
cd ~/GPS git clone https://github.com/Maproom/qmapshack.git QMapShack mkdir build_QMapShack cd build_QMapShack -
Build and install
ccmake ../QMapShack -DCMAKE_INSTALL_PREFIX=/usrIf the
ccmakerun stops, pressc(maybe, several times) and theng.make -j2 sudo make install
Run QMapShack
qmapshack
Install using user-defined directories (for experts)
(This section is a translation of a naviboard.de newsgroup contribution)
This subsection describes how you can install new versions of
- PROJ
- GDAL
- QUAZIP
- Routino
without overwriting something inside your system installation. The idea is to install the packages in a separate directory.
Assume
- that the steps mentioned in section "Update and install needed packages" have been carried out completely and successfully
- that everything is to be installed in
/home/tormet/QMSDEVDIR/usr(change this to directory path to your preferences)
Install PROJ version 8 (expert version)
Proceed as described in section "Install PROJ version 8" but replace the ccmake step with
ccmake .. -DCMAKE_INSTALL_PREFIX=/home/tormet/QMSDEVDIR/usr
Install GDAL (expert version)
Proceed as described in section "Install GDAL" but replace the configure step with
./configure --prefix=/home/tormet/QMSDEVDIR/usr
--without-libtool
--with-proj=/home/tormet/QMSDEVDIR/usr
--with-geotiff=internal
(remove linebreaks!)
Background information: The system libgeotiff.so library has a dependency on the system library libproj.so. Due to this a conflict arises: GDAL tries to use the libproj.so.15 system library and the just installed PROJ version tries to use the libproj.so.22 library. The modified configure step avoids this conflict.
Install QUAZIP (expert version)
Proceed as described in section "Install QUAZIP" but replace the ccmake step with
ccmake .. -DCMAKE_INSTALL_PREFIX=/home/tormet/QMSDEVDIR/usr
Install Routino (expert version)
The Routino version in the system would be sufficient.
For a complete installation proceed as described in section "Install Routino" but change line 48 in Makefile.conf to
prefix=/usr/local to prefix=/home/tormet/QMSDEVDIR/usr
Install QMapShack (expert version)
Because packages are not installed in the system change the ccmake call shown in section "Install QMapShack" as follows:
ccmake ../QMapShack -DCMAKE_INSTALL_PREFIX=/home/tormet/QMSDEVDIR/usr
-DGDAL_CONFIG=/home/tormet/QMSDEVDIR/usr/bin/gdal-config
-DGDAL_INCLUDE_DIR=/home/tormet/QMSDEVDIR/usr/include
-DGDAL_LIBRARY=/home/tormet/QMSDEVDIR/usr/lib/libgdal.so
-DLIBROUTINO_LIBRARY=/home/tormet/QMSDEVDIR/usr/lib/libroutino.so
-DROUTINO_INCLUDE_DIR=/home/tormet/QMSDEVDIR/usr/include
-DROUTINO_XML_PATH=/home/tormet/QMSDEVDIR/usr/share/routino
(remove linebreaks!)
Normally the variables in the lines
QuaZip-Qt5_dir: /home/tormet/Software/Linux/QMSDEVDIR/usr/lib/cmake/QuaZip-Qt5-1.1
PROJ_DIR: /home/tormet/QMSDEVDIR/usr/lib/cmake/proj
are set automatically. If there are problems just set them in the shown ccmake call.
Conclusion
Now QMS has been built without changes to the system.
If you start QMS from the build_QMapShack directory with a call to ./bin/qmapshack it will run immediately.
Because there are no conflicts with libproj.so.15 and libproj.so.22, QMS does not crash if quitting it. If there would be conflicts with libproj.so.15 or libproj.so.22, then in the terminal you would see messages like
double free or corruption (out)
Aborted (core dumped)
If you want to start QMS from the installation directory you have to set the LD_LIBRARY_PATH. Inside a bash script you can do this with:
(export LD_LIBRARY_PATH=/home/tormet/QMSDEVDIR/usr/lib:; /home/tormet/QMSDEVDIR/usr/bin/qmapshack & )
Prev (Linux Mint 19.x) | Home | Manual | Index | Top | (Ubuntu version 22.04) Next