[HelpOnLanguages] [TitleIndex] [WordIndex]

HowToCompileOnMac

/!\ This document written and maintained by Tim Sutton, 2007

1. Install XCODE

I recommend to get the latest xcode dmg from the Apple XDC Web site. Install XCODE after the ~941mb download is complete.

2. Install development frameworks for dependencies

Download William Kyngesburye's excellent all in one framework that includes proj, gdal, sqlite3 etc

http://www.kyngchaos.com/files/software/unixport/AllFrameworks.dmg

Once downloaded, open and install the frameworks.

William provides an additional installer package for Postgresql/PostGIS. Its available here:

http://www.kyngchaos.com/software/unixport/postgres

There are some additional dependencies that at the time of writing are not provided as frameworks so we will need to build these from source.

2.1. Additional Dependencies : GSL

Retrieve the Gnu Scientific Library from

curl -O ftp://ftp.gnu.org/gnu/gsl/gsl-1.8.tar.gz

Then extract it and build it to a prefix of /usr/local:

tar xvfz gsl-1.8.tar.gz
cd gsl-1.8
./configure --prefix=/usr/local
make
sudo make install
cd ..

2.2. Additional Dependencies : Expat

Get the expat sources:

http://sourceforge.net/project/showfiles.php?group_id=10127

tar xvfz expat-2.0.0.tar.gz
cd expat-2.0.0
./configure --prefix=/usr/local
make
sudo make install
cd ..

3. Install CMAKE for OSX

Get the latest release from here:

http://www.cmake.org/HTML/Download.html

At the time of writing the file I grabbed was:

curl -O http://www.cmake.org/files/v2.4/cmake-2.4.6-Darwin-universal.dmg

Once downloaded open the dmg and run the installer

4. Install subversion for OSX

The MacSVN project has a downloadable build of svn. If you are a GUI inclined person you may want to grab their gui client too. Get the command line client here:

curl -O http://ufpr.dl.sourceforge.net/sourceforge/macsvn/Subversion_1.4.2.zip

Once downloaded open the zip file and run the installer.

You also need to install BerkleyDB available from the same website. At the time of writing the file was here:

curl -O http://ufpr.dl.sourceforge.net/sourceforge/macsvn/Berkeley_DB_4.5.20.zip

Once again unzip this and run the installer therein.

Lastly we need to ensure that the svn commandline executeable is in the path. Add the following line to the end of /etc/bashrc using sudo:

sudo vim /etc/bashrc

And add this line to the bottom before saving and quiting:

export PATH=/usr/local/bin:$PATH:/usr/local/pgsql/bin

/usr/local/bin needs to be first in the path so that the newer bison (that will be built from source further down) is found before the bison (which is very old) that is installed by MacOSX

Now close and reopen your shell to get the updated vars.

5. Check out openModeller from SVN

Now we are going to check out the sources for openModeller. First we will create a directory for working in:

mkdir -p ~/dev/cpp
cd ~/dev/cpp

Now we check out the sources:

svn co https://openmodeller.svn.sourceforge.net/svnroot/openmodeller/trunk/openmodeller

The first time you check out QGIS sources you will probably get a message asking if you accept the certificate. I suggest you press 'p' to accept the key permanently.

6. Configure the build

CMake supports out of source build so we will create a 'build' dir for the build process

cd openmodeller
mkdir build
cd build
cmake -D CMAKE_INSTALL_PREFIX=$HOME/apps/ ..

7. GEOS Issues

Try build without these changes first and make them only if needed. I had some issues with GEOS headers so I made the following edits:

In file /Library/Frameworks/GEOS.framework/Headers/io.h, comment out line 61

In file /Library/Frameworks/GEOS.framework/Headers/geom.h, comment out line 145

8. Building

Now we can start the build process:

make

If all built without errors you can then install it:

make install

The binaries will be built into a bundle (making them build into an installable package in /usr is on my TODO list.) To use e.g. om_console yu need to put the installer bundle openmodeller.app/Contents/MacOS directory into your path or run from directly in that dir.


2014-08-13 10:36