-
Notifications
You must be signed in to change notification settings - Fork 61
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
- de-activate any conda (miniconda, anaconda) related env.
- install Homebrew using the one-liner command
- Using Brew, install the required libraries (cmake, g++ ...).
- Download the gdl code
- or clone this GithHub repository:
git clone https://github.com/gnudatalanguage/gdl.git
git submodule update --init
- 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 inbuild
... At 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
. It is not an app, but it can be sufficient.
In some cases (using widgets) it may be necessary to use gdl in form of 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 are started by clicking on it. At that stage, the gdl folder can be removed, but the GDL app will need some installed dependencies in homebrew that are not currently contained in the App (help welcome!).
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.
- 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 .
- 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)
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 )
You can download the unstable weekly DMG** and use it, however some dependencies not copied to the DMG will need to install at least plplot, so in practice this is only possible for somebody who has once built gdl using build_gdl.sh