Building on Mac: Difference between revisions

From NEOSYS Dev Wiki
Jump to navigationJump to search
No edit summary
Line 1: Line 1:
Installing Exodus on Mac is almost identical to installing on Linux but it is a little harder to acquire and configure the dependencies.
Installing Exodus on Mac is almost identical to installing on Linux but it is a little harder to acquire and configure the dependencies.
This install was performed on OSX 9.4.0 Leopard.


=== Installing dependencies ===
=== Installing dependencies ===

Revision as of 21:46, 28 June 2009

Installing Exodus on Mac is almost identical to installing on Linux but it is a little harder to acquire and configure the dependencies.

This install was performed on OSX 9.4.0 Leopard.

Installing dependencies

Installing C++ compiler

Older macs might need to install XCODE tools from http://developer.apple.com after free registration. This is unfortunately a large 1Gb download.

Newer macs have XCODE tools installer in the Applications or Library folder and you just have to install it.

The XCODE package includes subversion

Installing Postgres

http://www.postgresql.org/download/macosx

http://www.enterprisedb.com/products/pgdownload.do#osx

http://www.enterprisedb.com/getfile.jsp?fileid=484

Once downloaded, just do a standard install and remember the admin user password.

Installing Boost

Minimum required is boost 1_35. Here we install 1.38.

---

Optionally get ICU to fully support unicode in boost regex. How to do this on Mac OSX is unknown at the moment.

Download and unpack Boost Source

In safari get http://downloads.sourceforge.net/boost/boost_1_38_0.tar.bz2 and move it to your home directory.

Open a classic console shell

cd ~
tar xvf boost_1_38_0.tar.bz2
cd boost_1_38_0
./configure --help
./configure --with-libraries=date_time,filesystem,iostreams,program_options,regex,system,thread

Speed up the build of Boost by only doing the libraries and versions required. ADD additional config to the BJAM_CONFIG line as follows:

nano Makefile
BJAM_CONFIG= -j4 variant=release link=shared

Build Boost

make

Install Boost after becoming superuser

sudo su -
make install

Ensure boost includes can be found. This step might be eliminated in a better Exodos installer.

ln -s /usr/local/include/boost-1_38/boost /usr/local/include/boost

Quit superuser

exit

Building and Installing libexodus

Either download Exodus using Subversion (recommended - latest version)

cd ~
mkdir exodus
cd exodus
svn co http://svn.neosys.com/svn/trunk
cd trunk/exodus/exodus

or download a tarball (using curl not wget) - may not be the latest version

cd ~
curl http://devwiki.neosys.com/images/2/2a/Exodus-9.6.0.tar.gz>Exodus-9.6.0.tar.gz
tar xvfz Exodus-9.6.0.tar.gz
cd exodus-9.6.0

Ensure postgres can be found (change 8.3 to your version) and check pg_config can run

PATH=/Library/PostgreSQL/8.3/bin/:$PATH
pg_config

Find out where your boost libraries are installed and what they are named.

ls /usr | grep libboost

Customise the following command to suit the boost library location and names that you found in the previous step.

./configure --with-boost-libdir=/usr/local/lib \
--with-boost-date-time=boost_date_time-xgcc40-mt \
--with-boost-filesystem=boost_filesystem-xgcc40-mt \
--with-boost-regex=boost_regex-xgcc40-mt \
--with-boost-system=boost_system-xgcc40-mt \
--with-boost-thread=boost_thread-xgcc40-mt
make
sudo make install

An additional installation step that unfortunately has to be done by hand at the moment.

ln -s /usr/local/include/exodus-9.6/exodus /usr/local/include/exodus 

Test that you can now develop in C++ with Exodus. The libs and includes will no longer be required with a better installer.

nano tester.cpp
 #include <exodus/exodus.h>
 int main() {
	date().oconv("D").outputln();
 }
g++ tester.cpp -lexodus-9.6 -I/usr/local/include/exodus
./a.out
25 JUN 2009

Setting up Postgres for Exodus

  1. Finder, Places, Applications, PostgreSQL 8.3, PGAdmin III
  2. Login as superuser eg postgres
  3. Select the postgres database
  4. Click SQL in the toolbar and enter the following sql command.
CREATE ROLE exodus LOGIN
PASSWORD 'somesillysecret'
CREATEDB CREATEROLE;

and click the Execute Query button. It should show "Query returned successfully"

CREATE DATABASE exodus
WITH ENCODING='UTF8'
OWNER=exodus;

and click the Execute Query button. It should show "Query returned successfully"