...
Info | ||
---|---|---|
| ||
This page provides old installation guidelines to compile Met.3D from source on openSuSE and Ubuntu Linux systems using a development environment installed from the system repositories. We have switched entirely to using conda environments for developing and building Met.3D, and we recommend using conda instead. This page is kept for reference. |
...
Note | ||
---|---|---|
| ||
The current versions of Met.3D 1.7 and higher require libproj version 8 or higher, which may need to be installed manually. We recommend using conda. The following installation guidelines have been tested with the older Met.3D 1.6 under openSUSE 15.0/15.1 and Ubuntu 18.04/20.04 LTS. Still, try using conda if possible. |
Note | ||
---|---|---|
| ||
I know what I am doing! If you are experienced with compiling software under Linux, have a look at the listing at the bottom of this page - it lists all commands necessary to compile Met.3D on a clean Ubuntu system. Other systems will be similar. |
...
Code Block | ||
---|---|---|
| ||
# glxinfo | grep OpenGL OpenGL vendor string: NVIDIA Corporation OpenGL renderer string: GeForce GTX TITAN/PCIe/SSE2 OpenGL core profile version string: 4.4.0 NVIDIA 340.96 OpenGL core profile shading language version string: 4.40 NVIDIA via Cg compiler |
Install available dependencies via your package manager
openSUSE
For openSUSE 15.0, the following additional repository is required to obtain the ECMWF eccodes library (similar for other openSUSE versions):
...
- libqt5-qtbase-devel (or, for Met.3D versions < 1.3: libqt4 and libqt4-devel) - and further packages for Qt5 development
- liblog4cplus-### and log4cplus-devel
- gdal, libgdal20 and gdal-devel
- netcdf, netcdf-devel, libnetcdf_c++4-devel, libnetcdf_c++4-1
- hdf5, libhdf5 and hdf5-devel
- glew and glew-devel
- libfreetype6 and freetype2-devel
- eccodes and eccodes-devel (or, for Met.3D versions < 1.3: grib_api and grib_api-devel)
- libGLU1
- gsl and gsl-devel
- libproj##
- software development basics (gcc, gcc-fortran, git, wget, zip)
Ubuntu
For Ubuntu 18.04/20.04, the following packages need to be installed via aptitude:
- qt5-default
- liblog4cplus-dev
- libgdal-dev
- libnetcdf-dev
- libnetcdf-c++4-dev
- libeccodes-dev
- libfreetype6-dev
- libgsl-dev
- libglew-dev
- libproj-dev
- software development basics (packages build-essential, gfortran, git, wget, zip)
Install remaining required libraries from their sources
The dependencies glfx
and qcustomplot
are for both systems not available (at least not in the requried versions). They need to be complied manually.
Note | ||
---|---|---|
| ||
Install both libraries to places where cmake for Met.3D can find them ( |
glfx
Get the glfx sources from https://code.google.com/p/glfx/ or https://github.com/maizensh/glfx.git
...
To make it easier for cmake for Met.3D to automatically find the libraries, choose one directory from cmake/common_settings.cmake
as /your/target/dir.
qcustomplot
qcustomplot is required in a version >= 2.0. Get the qcustomplot sources from http://www.qcustomplot.com/
...
Alternatively, the sources are available from the git repository at https://gitlab.com/DerManu/QCustomPlot.git If you fetch the code from the repository, you’ll also need to run run-amalgamate.sh
. See the Docker Ubuntu example at the end of this page.
Download source and data packages
We recommend to place the following packages along with the Met.3D sources into a specific directory structure.
...
Change into third-party
to execute the following commands.
1) qtpropertybrowser
Met.3D requires the qtpropertybrowser framework from the “qt-solutions” repository. The qtpropertybrowser sources are directly compiled into the Met.3D executable and hence do not have to be build beforehand. They can be downloaded with git:
Code Block | ||
---|---|---|
| ||
# [in met.3d-base/third-party] git clone https://github.com/qtproject/qt-solutions.git |
2) Fonts
Met.3D requires a TrueType font file. We recommend the “FreeSans” font from the GNU FreeFont package. It can be downloaded from http://ftp.gnu.org/gnu/freefont/. At the time of writing, the most recent version is 20120503:
Code Block | ||
---|---|---|
| ||
# [in met.3d-base/third-party] wget http://ftp.gnu.org/gnu/freefont/freefont-ttf-20120503.zip unzip freefont-ttf-20120503.zip |
3) Vector and raster map, coastline and country borderline data
Met.3D requires a base map image in GeoTIFF format, as well as coastline and country borderline vector data in shapefile format. we recommend to use the free data from http://www.naturalearthdata.com. The medium resolution files (50m) work fine (they require roughly 300 MB of disk space).
...
No Format |
---|
met.3d-base/ third-party/ qt-solutions/ qtpropertybrowser/ * ... freefont-20120503/ FreeSans.ttf ... naturalearth/ HYP_50M_SR_W/ HYP_50M_SR_W.tif ... ne_50m_coastline.shp ne_50m_admin_0_boundary_lines_land.shp ... |
Checkout Met.3D from the GIT repository
The latest version of Met.3D can be checked out from https://gitlab.com/wxmetvis/met.3d/
...
For example, if git tag -l
returns a list in which 1.3.0 is the latest tag, checkout this version by entering git checkout tags/1.3.0
.
Configure cmake for Met.3D
We provide cmake scripts for Makefile creation and compilation of Met.3D. You can either build Met.3D from the command line as described below, or use a cmake GUI (e.g., cmake-curses-gui
, cmake-gui
) to configure cmake. Alternatively, start the build process within C++ IDEs like QtCreator, CLion, or Visual Studio Code (these typically provide functionality to open CMakeLists.txt
and to run the build process).
...
If some libraries are not located within the default header/library folders (given in common_settings.cmake), it is likely that you have to manually set the include directory and used libraries for a certain package. For example, if cmake could not find the include directory of GDAL, it will output something like missing GDAL_INCLUDE_DIR
. In that case, add -DGDAL_INCLUDE_DIR=/real/path/to/gdal/includes
to the command and run cmake again. Or use the GUI to set the missing directories and libraries and restart the configuring and generation process.
Compile Met.3D
After cmake has created the Makefile
, run make (the “-j 12” option for make starts 12 parallel compilation threads, modify this number to match the number of CPU cores in your system).
...
Compilation may take a few minutes. If no errors are reported, an executable named Met3D
should be created in the build directory.
Start Met.3D
Before Met.3D can be started, two environment variables MET3D_HOME
and MET3D_BASE
need to be set. MET3D_HOME
points to the Met.3D source directory (at least the subdirectories /src/glsl
and /config
need to be available as these contain code loaded at runtime):
...
Note | ||
---|---|---|
| ||
On first start-up, you will see an empty window. Please follow the user guide to learn how to create visualizations. |
Test compilation in a Docker container
In case you have Docker available on your system, you can test the compilation of Met.3D in a container. The following commands start an Ubuntu 18.04 container, install all dependencies and compile Met.3D. You won’t be able to start Met.3D from the container, but the commands may be useful for tests or to install on your actual system.
...