Skip to content

Instantly share code, notes, and snippets.

@prathe
Created May 10, 2012 15:48
Show Gist options
  • Save prathe/2654048 to your computer and use it in GitHub Desktop.
Save prathe/2654048 to your computer and use it in GitHub Desktop.
Building and installing Zorba on Mac OSX from sources

Install gcc (Apple release) unless you have it

Needed to compile ICU.

Grab and unpack the tarball

mkdir ~/src && cd ~/src
curl -O http://opensource.apple.com/tarballs/gcc/gcc-5666.3.tar.gz
tar -zxvf gcc-5666.3.tar.gz
cd gcc-5666.3

Setup some stuff it requires

mkdir -p build/obj build/dst build/sym
And then build it. You should go make a cup of tea or five whilst this runs.
sudo gnumake install RC_OS=macos RC_ARCHS='i386 x86_64' TARGETS='i386 x86_64' SRCROOT=`pwd` OBJROOT=`pwd`/build/obj DSTROOT=`pwd`/build/dst SYMROOT=`pwd`/build/sym

And finally install it

sudo ditto build/dst /

Build dependencies

ICU

cd ~/src
wget http://download.icu-project.org/files/icu4c/49.1.1/icu4c-49_1_1-src.tgz
tar -zxvf icu4c-49_1_1-src.tgz
cd icu/source
./runConfigureICU MacOSX
gnumake

Xerces-C

brew install xerces-c

SWIG

brew install swig

Build Zorba

tar -zxvf zorba-2.2.0.tar.gz
cd zorba-2.2.0
mkdir -p build
cd build
cmake -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_BUILD_TYPE=Debug ..
make
sudo make install

Testing your installation

zorba -q '1+1'
<?xml version="1.0" encoding="UTF-8"?>
2             
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment