Skip to content

GDL on OSX

Giloo edited this page Sep 9, 2023 · 31 revisions

INSTALLING GDL ON OSX

NEW: the installers for latest GDL (1.0.3) are available on the GDL Homepage, there is a version for x86_64 and one for arm64 (new M1,M2 macs). You can also download the unstable weekly DMG and use it, but it is for x86_64 only.

The application is not signed (permitted to run by Apple), so you must start it by 'right-clicking' (Control-Click) it and choose "Run".

Here is a simple solution to enable it permanently:

  1. download the dmg file, open it (it looks like a folder). Put "GNU Data Language" in the Applications folder. (Put "GDL Workbench" too).
  2. open a terminal
  3. type spctl --add /Applications/GNU Data Language.app .
  4. Enter your password in the popup asking for permission.
  5. Now you can use the GNU Data Language of the Applications folder without trouble.
  6. You can do the same for GDL Workbench
    This worked for us, please report if there was a problem.

But if you prefer doing it the hard way:

Way 0

GDL is available 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

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


or 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 build
  • 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 will 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 .

compilation notes (not necessary relevant anymore!)

  • 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 )

Clone this wiki locally