Although there is some installation guide given in the FLAME documentation, not everything was very clear to us. So, here is some information on how to install FLAME, gathered from around the web.
First you need to download the FLAME-framework components as indicated on http://www.flame.ac.uk/docs/install.html. You will be linked to CCPforge.com where the files are stored.
- Download Xparser
- Unzip the package to a folder of your choice (preferably a folder called FLAME in your personal folder)
- On the command line change to the xparser directory and run make
This creates the xparser executable
- Download libmboard
- Untar the package to your FLAME-folder
You will now have to have a look into the readme-file in the libmboard-folder inside your FLAME-folder. Before you install the libmboard you need to make sure to have some other programes installed.
- a C compiler, e.g. GCC (should be already available on Ubuntu)
- GNU Make (should also be already available on Ubuntu, otherwise
sudo apt-get install make
sudo apt-get install libtool
- Doxygen from http://www.doxygen.org
sudo apt-get install doxygen doxygen-doc doxygen-gui graphviz
- An MPI Library to use parallel computation. We would recommend OpenMPI, as mpich2 seems to be done being supported
sudo apt-get install libopenmpi-dev openmpi-bin libhdf5-openmpi-dev
- Support for pthreads (http://en.wikipedia.org/wiki/POSIX_Threads)
sudo apt-get install libpthread-stubs0-dev
- CUnit, to compile unit tests (http://cunit.sourceforge.net/)
sudo apt-get install libcunit1 libcunit1-doc libcunit1-dev
In our first installation we left out Doxygen and CUnit as they did not work on our system and had no effect on the functionality of FLAME. When you install the libraries/programes make sure no other or previous version is installed (e.g. mpich2 when you want to use OpenMPI). (The easiest way would be to search for the name in the software centre). If one of the above commands does not work, google ‘apt-get install’ plus the name of the programme.
At some point we needed to change the libmboard path in the xparser by hand. So if you renamed the libmboard-folder you might need to change the path to the libmboard in the xparsers c-file.
After all prerequisities are installed, got to the libmboard directory in your command line and enter, after you made sure the previous command executed succesfully.
./configure make make install
You might need to add the “–disable-tests” option after “./ configure”, depending on if you installed CUnit. The same can be done for the parallel processing with “–disable-paralle”. If you discover any problems you can call “–help” to see all options. You may need to sudo the ‘make install’ command.
Running the model
To run your first model you will need to create a model.xml to determine your model structure, a 0.xml to initiate your starting population and c-files to determine the communication and action of agents. Once you have created these 3 files, put them together in one folder. The running of your model is performed in three steps:
- Create model.xml and 0.xml
- Parsing your files
- Create the executable
- Running the model
First you need to run the Agent_Maker_GUI using the command “python3 Agent_maker_GUI_alpha_lxml.py alter_2012_test.csv” There you can enter or modify different parameters or modules of the model.
First you need to run the xparser (from the xparser-directory) on your model.xml by entering “./xparser /home/path-to-your-model.xml”
Go to the folder of your model-files and enter “make” into your command line. This will create an exectuable for your model.
By entering “./main <No. of iterations> ./0.xml” the model will be run for as many iterations as indicated in the command line, using your predefined starting population.
You should now see your model running [depending on the print-commands in your c-files ;-)]