Compiling (Mac)

From GDL Wiki
Jump to: navigation, search

Mac OS X 10.5.8[edit]

Adapted from http://aramis.obspm.fr/~coulais/IDL_et_GDL/GDLonOSX_10.5.6.html, and http://www.physics.emory.edu/students/kdesmond/SettingUpGDL.html

Getting started[edit]

$ cd /Users/youraccount
$ mkdir GDL
$ cd GDL
$ sudo chmod 666 /etc/sshd_config
$ emacs /etc/sshd_config
--> change the line "#X11Forwarding no" to "X11Forwarding yes"
$ sudo chmod 644 /etc/sshd_config

Supporting software[edit]

XCode 3.1.4 - REQUIRED FOR GDL 0.9.0 AND HIGHER[edit]

XCode is the development environment for Mac OS X. The version of XCode (3.0) that ships with Mac OS X 10.5 is inadequate for compiling gdl 0.9.0. Xcode 3.1.4 can be downloaded from http://connect.apple.com in the Developer Tools section and installed using the standard Mac installer. Install both the Developer Tools Essentials and UNIX Development Support package options.

THE FOLLOWING PROCEDURE WILL WORK TO INSTALL UP TO GDL 0.9RC4[edit]

Readline[edit]
$ curl ftp://ftp.gnu.org/gnu/readline/readline-7.1.tar.gz > readline-7.1.tar.gz 
$ tar -zxf readline-7.0.tar.gz
$ cd readline-7.0
$ mkdir Compilation
$ cd Compilation
$ ../configure --prefix=/Users/youraccount/GDL/readline-7.0/Compilation/
$ make
$ make install
$ cd ..
GSL - the Gnu Scientific Library[edit]

This is a big install, and takes a few minutes. I recommend doing tests (make check).

$ curl ftp://ftp.gnu.org/gnu/gsl/gsl-2.4.tar.gz > gsl-2.4.tar.gz 
$ tar -zxf gsl-2.4.tar.gz 
$ cd gsl-2.4 
$ mkdir Compilation 
$ cd Compilation
$ ../configure --prefix=/Users/youraccount/GDL/gsl-2.4/Compilation/ 
$ make
$ make install
$ make check
$ cd ..
$ export DYLD_LIBRARY_PATH=/Users/youraccount/GDL/gsl-2.4/Compilation/lib
PLplot and Cmake[edit]

PLplot requires the Cmake cross-platform build system. I did not install with Python. Download cmake-2.6.2.tar.gz to the GDL directory from http://www.cmake.org/files/v2.6/ Download plplot-5.9.5.tar.gz to the GDL directory from http://sourceforge.net/projects/plplot/files/plplot/

$ tar -zxf cmake-2.6.2.tar.gz 
$ cd cmake-2.6.2 
$ ./bootstrap 
$ make
$ cd ..

$ tar -zxf plplot-5.9.6.tar.gz
$ cd plplot-5.9.6
$ mkdir Compilation
$ cd Compilation
$ ../../cmake-2.6.2/bin/cmake -DCMAKE_INSTALL_PREFIX=. -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_python=OFF ..
$ make
$ make install
$ cd ../../

GDL[edit]

Download gdl-0.9.tar.gz to the GDL directory from http://sourceforge.net/projects/gnudatalanguage/files/

$ tar -zxf gdl-0.9.tar.gz
$ cd gdl-0.9
$ ./configure --with-plplotdir=/Users/youraccount/GDL/plplot-5.9.6/Compilation --with-gsldir=/Users/youraccount/GDL/gsl-1.14/Compilation --with-readlinedir=/Users/youraccount/GDL/readline-6.1/Compilation --with-Magick=no --with-python=no   --with-netcdf=no --with-hdf=no --with-hdf5=no
$ make
$ sudo make install

Cleaning up[edit]

To be able to launch GDL from anywhere (like your data directories): add /Users/youraccount/GDL/gdl-0.9/src/ to the PATH in your .profile (or whatever your user profile file is called).

If the PATH doesn't exist in your .profile, find out what it is

$ echo $PATH

Then add this line to your .profile

export PATH=old:path:stuff:/Users/youraccount/GDL/gdl-0.9rc4/src/

To tell GDL where local .pro files (like the astronomy library) are: Create a gdl-startup.pro document in the GDL directory containing the line

!PATH='/Users/youraccount/GDL/gdl-0.9/src/pro'

Copy your common .pro library (like the astro library) to this directory. Then add this line to your .profile

export GDL_STARTUP=/Users/youraccount/GDL/gdl-startup.pro

Re-login to your account and everything should work.