Build From Source
Notes
  • If you only want to build your own BRAHMS Components, you do not need to build BRAHMS from source. Rather, you should install the latest release of BRAHMS in an easier way, and build your component against the SDK supplied with that.

This page describes the steps you will need to complete in order to build BRAHMS from source. If you don't know what "building from source" is, you probably shouldn't attempt this - this is not an introductory page. Building from source is a last resort if there is no package available that will run on your system.

The route we take here on Linux was developed on Ubuntu (Edgy/Feisty/Gutsy, variously), but you shouldn't have to detour too far to get it working on your distro. On Windows, these steps should work without modification, unless you've been changing your system around, in which case you must be clued-up enough to work it all out anyway. The procedure on OSX is identical to that for Linux, I think.

Preparations

Warnings
  • We have seen problems on some *nix operating systems interpreting the tilde "~" if you use it to indicate your home path in SYSTEMML_INSTALL_PATH. It is recommended that you set your home path explicitly.
  • Uninstall any existing BRAHMS installation. This step is not strictly necessary, and you may at your option go ahead and try building a new copy of BRAHMS alongside an existing installation, but if something goes wrong, please try the whole thing again after uninstalling before concluding you've got a problem.
  • Install a C++ compiler.
    • Windows Microsoft's free optimizing compiler, cl, version 14. You can download this bundled in with Microsoft's free IDE, Visual Studio Express, or one of your colleagues may have it already. Make sure cl.exe is on your machine PATH, and set the environment variables INCLUDE and LIB to point at the bundled libraries. If you type cl at the prompt you should get an info message from the compiler. You will also need the Platform SDK and to add the SDK paths to your INCLUDE and LIB variables.
    • Linux The GNU C++ compiler, g++, version 4.2. You can install this on Ubuntu using the command sudo apt-get install g++-4.2 or using Synaptic Package Manager. Other g++ versions may also work.
  • Windows Only Install Unix Utilities, a large selection of Unix Command Line tools (like grep) compiled for Windows. The BRAHMS makefiles make use of these tools, since it's easier then to maintain platform independence. If installed correctly, you should be able to run grep from the Windows Command Prompt. IMPORTANT Rename file <UnxUtils>\bin\date.exe to <UnxUtils>\bin\unixdate.exe (this circumvents a conflict with the windows date command - unixdate is used by the makefiles).
  • Install Subversion. Subversion (SVN) is the source code revision control facility used by the BRAHMS project. You will need an SVN client in order to "check out" (download) a copy of the BRAHMS source code. When installed, you should be able to run svn at the shell prompt.
    • Linux Probably already installed, but if not you can use Synaptic Package Manager or just type sudo apt-get install subversion at the prompt.
    • Windows At time of writing, there is a Windows binary package available here.
  • Set environment variables. If these environment variables are not set, you will be prompted. If they are set incorrectly, expect some error message about not being able to find something or finding something not writeable. NOTE THAT THE BUILD WILL WRITE INTO SYSTEMML_INSTALL_PATH SO YOU SHOULD ENSURE IT IS SET CORRECTLY
    • Set SYSTEMML_INSTALL_PATH=/home/<username>/SystemML, or to wherever you want to install BRAHMS as you build it. Note that if you are trying to compile alongside an existing installation, this path should be different from the path to the existing installation or you will overwrite it!
    • Linux Set SYSTEMML_MATLAB_PATH to the path to the Matlab install folder (for the version you want to compile against - R2007b recommended). This is only needed for compiling the matlab bindings, so you can skip this if you aren't planning on compiling them. If you already have a variable MATLAB that points at your Matlab install folder, this will suffice, but if you need to override it, set SYSTEMML_MATLAB_PATH instead, and MATLAB will be ignored during the build. On our cluster, ACE, this path is MATLAB=/usr/local/encap/matlab-R2007b.
    • Windows On windows, the path to the Matlab include and lib files moves around depending on the Matlab release, so it's not hard-coded into the makefiles. You will, therefore, have to add these paths to your INCLUDE and LIB environment variables manually. Should be something like matlab/extern/include and matlab/extern/lib/win32/microsoft with perhaps something like msvc71 suffixed.
    • Add the path SYSTEMML_INSTALL_PATH/BRAHMS/bin to the machine path.
  • Linux only Install some X development libraries, libxv and libxaw, for the GUI. There are several versions of this available on my Ubuntu (Gutsy), and initially I installed the wrong one, and I got seg faults. Initially I installed libxaw6-dev, without noticing that Ubuntu was running libxaw7. The result was seg faults immediately after the progress bar is displayed. The fix was, naturally, to install the same dev libraries as the runtime I am using, which was libxaw7 (and uninstall libxaw6-dev, probably best if you can do so). You should check which libxaw you are running (use Synaptic Package Manager and search for libxaw and see which one is installed) then install the dev version of that. Though probably actually the thing to do is just make sure you're running 7, dev and runtime. From the shell, use sudo apt-get install libxv-dev and sudo apt-get install libxaw7-dev.
  • Linux only If building the comms layer, you'll need the zlib development package. From the shell, use sudo apt-get install zlib1-dev. If you install this package yourself, note that you'll need version 1.2.3 or greater. I just discovered that my new Ubuntu (8.04) doesn't have zlib1-dev in the standard repositories. I installed zlib1g-dev instead, and it compiled ok - perhaps this is the new thing to use?
  • If you intend to build the Python component bindings, install Python (2.5 or above) and Numpy (1.1 or above).
    • Windows For example, install python-2.5.2.msi followed by numpy-1.1.0-win32-superpack-python2.5.exe.
    • Linux For example, use apt-get to install python2.5, python2.5-dev and python-numpy.
  • If you intend to build the Matlab component bindings, install Matlab (R2007b or above); you may have success with earlier releases, but this is not supported.
  • Linux only If building the WX processes (development Standard Library processes) and/or the WX GUI (not available at time of writing), you will need to sudo apt-get install libwxgtk-dev, or whatever is the equivalent on your platform.
  • Linux only If building the MPI comms layer, you will need to sudo apt-get install mpich2, or whatever is the equivalent on your platform.

Check out a copy of the BRAHMS source code

That's all the tools ready. Now we're going to grab the latest BRAHMS source code via SVN. Create a development folder where you will store your copy of the source and other files that may be related, e.g. ~/devbrahms or c:\devbrahms. Open a console window and navigate to this folder. Check out the files by typing svn co https://brahms.svn.sourceforge.net/svnroot/brahms src. If prompted, select "permanent". SVN will download all the files comprising BRAHMS and return you to the prompt. If all went well, you should have folders ~/devbrahms/src/trunk and ~/devbrahms/src/branches.

wxWidgets

For wxWidgets on Ubuntu, for instance, use

OS Shell Prompt
sudo apt-get install libwxgtk2.8-dev

Install companion packages

Pre-built installers package BRAHMS along with the SystemML Toolbox. Since you are going to build from source, you'll have to install this companion package manually. The preparatory work for both has already been done (it uses SYSTEMML_INSTALL_PATH to find its install folder, and the Windows make uses ~UnxUtils). Proceed as follows:

Check out the SystemML Toolbox using SVN and make the project as follows.

OS Shell Prompt
cd ~/devbrahms svn co https://systemml.svn.sourceforge.net/svnroot/systemml systemml cd systemml/trunk make

Build BRAHMS

If you need to override any of the make configuration settings, make a new makefile at one of the paths listed for inclusion at the bottom of ~/devbrahms/src/trunk/make.brahms, and place your settings in it. These will be read after make.brahms, so you can override settings from that file or add additional settings of your own.

Navigate to ~/devbrahms/src/trunk and execute make.

Notes
  • Windows You may get an error saying grep wasn't found. As a workaround invoke shell by typing sh at the prompt. This should change the appearance of the prompt (computer name followed by hash). Execute make from this prompt, instead.
  • Linux You may get an error RTLD_DEEPBIND undefined - this symbol is only available on post-2004 versions of glibc. If you are developing on a legacy system, your only option may be to upgrade to a more current version of glibc.

If successful so far, execute make all to build all the groups and bindings as well. Things that have been built already will not be built again.

Linux only You may have to make the BRAHMS executables executable. This should happen automatically, but we had some trouble before, particularly with the shell script brahms. Look in the bin folder (SYSTEMML_INSTALL_PATH/BRAHMS/bin) and make sure brahms and brahms-execute are both executable (try chmod u+x <filename>).

Third-party packages

The self-installer packages BRAHMS and the SystemML Toolbox, so you now have everything you need to run BRAHMS. If you want to use Python or Matlab with BRAHMS, you may have to install these (if you do not already have them installed). If you want to build your own C or C++ processes, you will need a compiler. If BRAHMS won't run, you may be missing a required library. See Prerequisites for more information.