Installation¶
Quick Installation¶
Assuming you already have git and your compiler set up, you should be able to download and compile MABE by executing the following lines in your terminal:
git clone --recurse-submodules https://github.com/mercere99/MABE2.git
cd MABE2/build
make
If that doesn’t work, read the rest of this page for more detail.
Installing Git¶
Before attempting to install MABE2 you must have Git installed so that you can use the MABE2 software on your local computer. For information on installing Git on any device, see this guide. For more information about GitHub, checkout the GitHub Guides.
Downloading MABE2 from GitHub¶
The first step for installation on any machine is to visit MABE2 on GitHub. The simplest way to download source code form GitHub is to download the entire repository. MABE2 can be downloaded as a zip file, or via the command line.
Downloading MABE2 as a Zip File¶
From the repository’s main page, find the green Code button in the upper right hand corner. Click this button, then click DownLoad Zip to save the full zip of everything in MABE2’s master branch to your computer.
Downloading MABE2 via the Command Line¶
From the repository’s main page, find the green Code button in the upper right hand corner. Click this button, then click the clipboard icon to copy the URL to your clip board.
Note: You can also use SHH keys to clone and download a GitHub repository. For more information about SSH keys, checkout this guide.
Once you have the URL copied to your clipboard, open your command line.
Change your current working directory to the location where you want the cloned directory.
Type git clone
, then paste the URL into your command line. Use the --recurse-submodules
flag to ensure that all dependencies are made available.
$ git clone --recurse-submodules https://github.com/mercere99/MABE2.git
Then press enter to create your local clone! If all goes well, you will see the following in your terminal:
$ git clone --recurse-submodules https://github.com/mercere99/MABE2.git
> Cloning into `MABE2`...
> remote: Counting objects: 10, done.
> remote: Compressing objects: 100% (8/8), done.
> remove: Total 10 (delta 1), reused 10 (delta 1)
> Unpacking objects: 100% (10/10), done.
If you have issues cloning the repository, checkout this guide.
Necessary compilers¶
Once you have MABE2 downloaded you must make sure you have the necessary compilers installed so you can run your MABE2 projects.
To compile MABE2 you must have a native C++ compiler, particularly one for C++17 or above.
Mac and Linux¶
For Unix (e.g. Linux and MacOS) the most commonly used compilers are GCC and Clang. You can check if you have GCC or Clang installed by opening your terminal and entering:
$ which gcc
$ which clang
If a path is returned then you have gcc or clang, respectively. To check the version enter:
$ gcc --version
$ clang --version
To support C++17 you will need GCC version 5 or later or Clang version 5 or later.
If a path is not returned then you must install gcc.
For Linux, your package manager (e.g. yum, apt, etc) will allow you to do this. Enter the following into your terminal to install gcc;
$ apt-get install gcc-8
For MacOS, you will need Apple’s Command Line Tools for XCode. To install a recent release of gcc, you can use Homebrew with this formula.
Windows¶
The Windows Subsystem for Linux (WSL) makes it easy to run a GNU/Linux environment directly on Windows. For information on installing WSL, checkout this guide. Once WSL is installed you can follow the same instructions as above.
Compiling MABE¶
To compile MABE, go to the build
sub-directory within MABE and run make
:
cd MABE2/build
make
MABE can also be compiled in debug mode, which does various additional checking to make sure everything is running according to plan. Debug mode will make MABE run substantially slower, so it is not recommended for use when you are not actively debugging, but it very helpful for identifying the source of errors:
To compile MABE in debug mode, use the debug
make target:
cd MABE2/build
make debug
Next Steps¶
Once you have downloaded MABE2 and have a C++17 compiler you can begin using MABE2! Visit the Quickstart guide for detailed instructions about using MABE2 to run experiments.