A new version of the metasim library slightly redesigned
Authors: Giuseppe Lipari, Gerardo Lamastra, Antonino Casile, Luigi Palopoli, Cesare Bartolini
Contributors: Luca Abeni, Marco Caccamo, Fabio Rossi, Claudio Scordino, Fabio Cremona, Matteo Morelli, Andrea Parri
Copyright: Retis Laboratory, Scuola Superiore Sant'Anna email: [email protected]
This is open source software and is distributed under the terms of the Gnu Public License (GPL). See COPYING for more details.
======================================================================
SUMMARY
- INTRODUCTION
- RELEASE NOTES
- COMPILING
- INSTALLING
- RUNNING THE EXAMPLES
- ADD A NEW EXAMPLE
- BUGS AND CONTRIBUTIONS
======================================================================
MetaSim2.0 is a library for discrete event simulation written in C++. It has been developed as an internal project at Scuola Superiore Sant'Anna as part of many research project, mainly thanks to the work of many PhD students.
This software has been tested under Linux, MacOSX and Windows. Supported (tested) compilers are:
- g++ (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
- clang++ (Apple LLVM version 5.1 (clang-503.0.40))
- Microsoft Visual Studio 2012
We assume the user has the compiler already installed on his machine.
The software can be compiled on any platform with the appropriate compiler as listed in section 2.
MetaSim2.0 build system is based on CMake, the cross-platform, open-source build system. To compile MetaSim2.0 you must have CMake (ver. >= 2.6) installed on your machine.
If you altready have CMake installed on your machine you can skip the following section and jump to section 3.2.
Follow the instructions at http://www.cmake.org/cmake/help/install.html
The steps to build and install the software are the usual ones:
cd metasim2.0
mkdir build
cd build
cmake ..
The execution of "ccmake .." command cause CMake program execution. To generate the makefile needed to compile the library, you have to press 'c' key twice and then press 'g'. By pressing 'g' CMake will generate the makefile and will go back the the command line. Now you can compile the library:
make
Last step will compile the library, the executable for the test and the examples included with the library. Output directories are: - src/ - test/ - examples/
The library is located in src/
execute CMake
In the location "Where is the source code:" indicate the path to the folder metasim2.0
In the location "Where to build the binaries:" indicate the path to the folder where you want to put the output (usually = ${Path to metasim2.0}/build).
Now click "Configure". CMake will ask to specify the generator for the project.
You should select Visual Studio 11 and click Finish. When the process will finish, click again on "Configure" and then click to "Generate". This last step will generate the Visual Studio project "metasim.sln".
Open the folder you selected for your output and double click on the generated file "metasim.sln" to open the project. In Visual Studio and then in the command bar select the BUILD menu and click Build Solution. Compilation process will start.
Output directories are: - src/Debug/ - test/Debug/ - examples/Debug/
The library is located in src/Debug
Even if testing is not mandatory, we highly recommend to execute it. The test suite is located in test/ (unix-like systems) or in /test/Debug (windows systems) and can be executed to test if the compilation flow went ok.
cd metasim2.0/build
make
ctest --output-on-failure
Open the MetaSim project generated by CMake and build ALL_BUILD
. Then,
cd metasim2.0/build
ctest --output-on-failure -C Debug
or
ctest --output-on-failure -C Release
The execution must terminate with all tests passed.
The tests have been written using the Catch library, which is a single include file that you can find in the test directory.
https://github.com/philsquared/Catch
The testing process is automated by CTest, as an element of the CMake suite.
Currently, installation is not supported. After compilation, all header files and the library file are found in the src/ (src/Debug for Windows systems) directory. Simply put the path of the src directory in the CPPFLAGS and in the LDFLAGS when you want to use the library.
Every directory under one of the "examples" directories contains a different example. Go inside the directory and run the executable file.
To run the eth example, go inside the directory examples/eth and type
./eth
Other examples are available and can be executed in the same way.
To run the eth example, go inside the directory examples/Debug/eth and double click on eth.exe. Other examples are available and can be executed in the same way.
To add a new example to the library, you have to
-
Create a new folder in metasim2.0/examples with the name of your example.
-
Edit the file metasim2.0/examples/CMakeLists.txt adding the specification for your example:
add_subdirectory(name_of_your_example)
Once you wrote the code of your example, you should re-generate the makefile. Follow the instructions in section 3 for the generation of the makefile and compile.
For bug reports, feature requests and other issues you may encounter, please refer to the appropriate pages on the github site:
http://github.com/glipari/metasim2.0
Giuseppe Lipari [email protected]
Fabio Cremona [email protected]