Skip to content
James Edmondson edited this page Jul 10, 2018 · 22 revisions

Table of Contents


Linux

It is highly recommended that for Ubuntu Linux, you use the GAMS Linux build scripts. They have been designed to make MADARA installation on Linux as easy as possible. For instance, if you download and use the GAMS scripts, you can essentially build all of MADARA with the following:

$GAMS_ROOT/scripts/linux/base_build.sh prereqs madara

We can potentially update this Wiki to advise how to do this by hand, but right now, we advise building MADARA using the GAMS build scripts.

To get a list of all features that can be enabled in the build script, pass help as an option.


Mac

It is highly recommended that for Mac, you use the GAMS Mac build scripts. They have been designed to make MADARA installation on Mac as easy as possible. For instance, if you download and use the GAMS scripts, you can essentially build all of MADARA with the following (after installing Homebrew on Mac):

$GAMS_ROOT/scripts/mac/base_build.sh prereqs madara

To get a list of all features that can be enabled in the build script, pass help as an option.


Windows

To install on Windows, you should understand that the old build instructions at Sourceforge are slightly wrong. We are moving away from ACE (from the CORBA/ACE+TAO world) and are instead using STL and Boost where possible for threading, OS functionality, etc. The new requirements for installing base MADARA on Windows are the following:


Windows Prerequisites

  • Install Perl (ActiveState)
  • Install Git (TortoiseGit), which requires Git for Windows. It is highly recommended that when prompted to install command line tools, do so. The Windows Builds instructions below expect you to have command line git available. If you don't, download the MADARA repo as you would do normally with how you are comfortable on Windows.
  • Download Boost (Boost)
  • Install Oracle JDK (if you want Java) (preferably 1.8)
  • Install Visual Studio (recommend 2017 but 2015 also works)

Windows Build

:: Open up the Visual Studio Command Line for building. For VS 2017, it can be invoked with the following:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat"

:: Build the system module for Boost. The following will build debug and release versions of 32 bit and 64 bit Boost
cd %BOOST_ROOT%
.\bootstrap.bat
.\b2 --with-system

:: set environment variables for BOOST locally but these should really be set in your computer's user or system
:: environment variables
set BOOST_ROOT=c:\code\boost\boost_1_67_0
set BOOST_STATIC_LIB_PREFIX=lib
set PROJECTS_ROOT=C:\code
set MADARA_ROOT=%PROJECTS_ROOT%\madara
set MPC_ROOT=%PROJECTS_ROOT%\MPC
set PATH=%PATH%:%MPC_ROOT%/bin:%BOOST_ROOT%/stage/lib:%MADARA_ROOT%/lib:

:: Download MPC (the build system we're currently using for MADARA)
git clone https://github.com/DOCGroup/MPC.git %PROJECTS_ROOT%\MPC

:: Do a git clone of MADARA into a directory you want MADARA installed into
git clone -b master --single-branch https://github.com/jredmondson/madara %PROJECTS_ROOT%\madara

:: Generate MADARA build files with whatever features you want for the toolset you want to build with
:: toolset recommendations: vs2017 or vc14 (VS 2015)
:: See the default features file at %MADARA_ROOT%\default.features for all supported features
cd %MADARA_ROOT%
%MPC_ROOT%\mwc.pl -type vs2017 -features tests=1 MADARA.mwc
MADARA.sln

:: The above should open MADARA.sln. It is recommended that you build the main MADARA project in Debug and Release
:: and that you build all tests for Release. All projects should likely be 64 bit on the target. Building for 32 bit
:: will require setting %BOOST_ARCH% to x32 on the command line BEFORE you call mwc.pl above. Also, definitely
:: enable Multi-processor Compilation. This will use all of your processor cores to compile.