Skip to content

GDL on Linux

Alain edited this page Nov 10, 2023 · 22 revisions

Packages Compilation script build_gdl.sh cmake

packages:

As long as a 1.0.2 version is not delivered, please consider that most packages don't really reflect the current status of the code. It would be better to use the weekly unstable releases !

At the moment, you can

Compilation:

or you can compile the code.

Two mains paths :

script:

Way 1 using the script scripts/build_gdl.sh (assuming you can be sudo)

  • Assuming you already have a c++ compiler , Cmake (version > 3.2), curl or wget, git
  • Download the gdl code, and run gdl/scripts/build_gdl.sh several times:
  • build_gdl.sh prep will install the required libraries. (If you are not sudoer you will get a list of libs. your admin. will installed for you.)
  • build_gdl.sh configure will run Cmake to prepare the Make file
  • build_gdl.sh build will build gdl in build.
  • build_gdl.sh install. This is the simplest way to be sure the paths and the links to the libs are OK.

A summary for Ubuntu/Debian (for RH/Fedora, just change apt-get by rpm ...):

apt-get install git
apt-get install curl   // December 2021 because of Qhull ...
apt-get install cmake
apt-get install g++
mkdir GDL
cd GDL
git clone --recursive https://github.com/gnudatalanguage/gdl
cd gdl
./scripts/build_gdl.sh prep   <<-- need to be sudo to add set of official packages
./scripts/build_gdl.sh configure
./scripts/build_gdl.sh build
(./scripts/build_gdl.sh check)
./scripts/build_gdl.sh install  

then you should be able to start GDL by : ./install/bin/gdl

This efficient and simple way was successfully tested on : Ubuntu 16.04 LTS, 18.04 LTS (may have a glitch due to Magicks libs), 20.04 LTS, 22.04 LTS; Debian 9, 10, Sid; Fedora 28

cmake:

or, traditional way,Way 2 using CMake :

  • GDL is written in such a way you can compile it fully in user space, without being root, as long as all the mandatory packages (-dev/-devel) are around. If some packages are missing or outdated (e.g. Eigen3), yes, you can use a version in your user space, giving the path as a parameter to CMake (e.g. -DEIGEN3DIR=/path/to/local/Eigen3)

  • GDL can be compiled with : GCC (GNU C Compiler), Clang (LLVM), icc (Intel C compiler)

  • GDL now requests CMake 3+. On some old systems (Debian 9, U 14.04) you have access to CMake 3+ with package cmake3 or equivalent module (on HPC with module)

  • You will need the wxWidgets library and the plplot drivers for wxWidgets. Sometimes the plplot drivers are not in the plplot package but in a different one, say, plplot-driver-wxwidgets . This is distribution-dependent, search the web.

  • plplot NEEDS to be compiled with option -DENABLE_DYNDRIVERS=ON since GDL uses his own (patched) plplot drivers, they come with the GDL code. Hence the need for a plplot library compiled in such a way as to permit loadable drivers. Normally plplot is distributed this way under linux.

  • When compiling the first time, you may be blocked because one package is missing. After installing it, it is mandatory to clean the cache before running again cmake (rm -f CMakeCache.txt)

  • Compilation. Once all the packages are around, it is quite fast on multi-cores :)

git clone --recursive https://github.com/gnudatalanguage/gdl
cd gdl
mkdir build
cd build
cmake ..
make -j N  (N depending the number of cores you have)
make test

(on my old laptop with N=4, less than 5 minutes)