Morfa is a general purpose programming language which enables custom Domain Specific Language (DSL) creation. It aims at combining fast and robust development of large systems with high expressiveness and performance. For more information on the project visit http://morfalang.org and docs.

How do I get set up?

Currently we support Ubuntu Linux platform. Below are the installation steps for building.

You will need Mercurial, SCons, CMake, javac, zlib, libtinfo and g++ with friends, so if you don't have them, install:

sudo apt-get install mercurial scons cmake openjdk-7-jdk zlib1g-dev libtinfo-dev build-essential

After installing Mercurial you can clone main Morfa repository.

hg clone https://bitbucket.org/morfa-dev/morfa
cd morfa

Current version depends on LLVM 3.5, boost 1.56 and ICU 54. Since these libraries are not yet available in Ubuntu repository (when this file is being created), download:

# llvm 3.5
wget http://llvm.org/releases/3.5.0/llvm-3.5.0.src.tar.xz
tar -xf llvm-3.5.0.src.tar.xz

# clang
wget http://llvm.org/releases/3.5.0/cfe-3.5.0.src.tar.xz
tar -xf cfe-3.5.0.src.tar.xz

# boost 1.56
sudo apt-get install python-dev libbz2-dev
wget http://downloads.sourceforge.net/project/boost/boost/1.56.0/boost_1_56_0.tar.gz
tar -xf boost_1_56_0.tar.gz

Our version of LLVM is slightly modified (hopefully that will change in the future), so we need to apply these changes:

cd llvm-3.5.0.src
patch -p1 < ../llvm-3.5.0.patch
cd ..

Last missing piece is the ICU library:

wget http://download.icu-project.org/files/icu4c/54.1/icu4c-54_1-src.tgz
tar -xf icu4c-54_1-src.tgz 
cd icu/source/
cd ../..

Now we can get to the compilation of everything else that needs to be compiled. In the buildsystem directory:

cd buildsystem

Configuration file is needed so the buildsystem knows what is where. If you followed above instructions, this configuration file will work. Otherwise, use paths that match your environment. Save the following code as 'config.py':

from SCons.Script import Dir

LLVM_INC_DIR = Dir('#/../llvm-3.5.0.src/include').path
LLVM_SRC_DIR = Dir('#/../llvm-3.5.0.src').path

CLANG_SRC_DIR = Dir('#/../cfe-3.5.0.src').path
CLANG_INC_DIRS = [Dir('#/../cfe-3.5.0.src/include').path, '${BUILD_DIR}/clang/include']

BOOST_INC_DIR = Dir('#/../boost_1_56_0').path
BOOST_SRC_DIR = Dir('#/../boost_1_56_0').path

ICU_SHLIB_DIR = Dir('#/../icu/source/lib').abspath
ICU_INC_DIR = Dir('#/../icu/source/common/').abspath
ICU_LIB_DIR = Dir('#/../icu/source/lib').abspath

Compile llvm (add -j flag to speed up the process on multicore machines):

scons llvm

Compile clang:

scons clang

Finally, compile morfa:

scons morfa-package

Who do I talk to?

Morfa is developed and maintained by imapp. Just contact us at morfa@imapp.pl or the mailing list


Morfa incorporates code from the following open source projects: - LDC - DMD - LLVM - tango - ANTLRv2 - Mingw-w64 - ICU - clang - boost - zlib - bzip2