GDL on OSX

INSTALLING GDL ON OSX


Way 0

GDL may be available, but check carefully the version, from:

  • [Homebrew] look for homebrew-science, homebrew’s gdl is another thing (Gnome Docking Library)!

  • Macports: known as gnudatalanguage, version 1.0.0-rc3 thanks @tenomoto – version for M1 available

  • Fink, thanks @Seb

those distributions may be well out-of-date by now, as GDL is continuously improving (see what happened on our Github repo since)


Way 1

  1. de-activate any conda (miniconda, anaconda) related env.

  2. install Homebrew using the one-liner command

  3. Using Brew, install the required libraries (cmake, g++ …).

  4. Download the gdl code

  • or clone this GithHub repository:
    git clone https://github.com/gnudatalanguage/gdl.git
    git submodule update --init

  1. run gdl/scripts/build_gdl.sh several times:

  • build_gdl.sh prep will install the required libraries. The script recompiles and install plplot, this is mandatory as the Homebrew plplot is not compiled with adequate options.

  • build_gdl.sh configure will prepare the make file for compilation in next step.

  • build_gdl.sh build will build gdl in buildAt this point, Apple Silicon users should follow these instructions since there are issues on this kind of machine for now. …

  • build_gdl.sh install will install gdl in $HOME/gdl/install/bin and its dependencies.
    At this point, one can run gdl in a terminal à la unix, typing $HOME/gdl/install/bin/gdl . But it is not an app.

  • build_gdl.sh pack creates an app

  • build_gdl.sh prep_deploy creates a dmg file, than can be mounted by the system, and the Apps it contain can be installed in Applications, stay in the Dock and be started by clicking on it. At that stage, homebrew and all the gdl folder can be removed, the GDL app should still work.

GDL is built with wxWidgets graphic interface, but the X11 graphic windows are still there and can be called by a switch in the gdl command, see output of gdl -h. Of course to use X11 you need to independently install XQuartz.

This script is very frequently tested on OSX 10.14.6 and 11.3. Brew may have side effects (updates are frequent and quite long, may have conflict if machine with multi-users, projects asking for login/pass). Usually just reading the messages, using ‘brew doctor’, passing when login/pass should be enough.

notes

  • GDL uses plplot. plplot NEEDS to be compiled with option DYNDRIVERS=ON . This is not what Brew or other installers provide. You need to recompile and install plplot. The script build_gdl.sh of ‘Way 1’ does it, applying patches in gdl/scripts/deps/macos .

not necessary relevant anymore compilation notes (!)

  • Depending of OSX version, default Clang may or not come with OpenMP. If OpenMP is not around, we need to deactivated it :

cmake . [others flags] -DOPENMP=OFF

but, having OpenMP, Eigen and compiling GDL in Release (-O3) mode are the only way to have a GDL on par with IDL for speed.

  • Readline. Editline is not fully compliant with Readline but it wrongly made symbolic links with readline headers files. Very dangerous. You must install a clean Readline lib. around (the one provided by Brew is OK) then cleanly link to it :

cmake . [others flags] -DREADLINEDIR=/usr/local/opt/readline/
  • An example working (tested) on OSX 10.11, 10.12 & 10.14 (with Readline provided by Brew, and Cmake >= 3.0) :

git clone --recursive https://github.com/gnudatalanguage/gdl
cd gdl
mkdir build
cd build
cmake .. -DREADLINEDIR=/usr/local/opt/readline/ -DOPENMP=OFF -DGEOTIFF=OFF -DHDF=OFF  -DUDUNITS2=OFF -DGRIB=OFF -DGLPK=OFF 
make -j 4

But in the above, you can remove -DGEOTIFF=OFF -DHDF=OFF  -DUDUNITS2=OFF -DGRIB=OFF -DGLPK=OFF provided you have installed the corresponding library. Each time you add a library and call cmake to recompile: it is mandatory to clean the cache before running again cmake (rm -f CMakeCache.txt)

Git issues

Since an upgrade of OSX, my git pull was not OK any more (and the ssh -X too … stupid system). A effective solution for Git was : git config --global url.https://github.com/.insteadOf git://github.com/ (from stackoverflow )

Installers

You can download the unstable weekly DMG** and use it, but it is for x86_64 only, and your OS version must be compatible. Help to make installers for different versions of OS and for Apple Silicon would be appreciated.