Build EMOD from source code¶
You can build the Eradication.exe for Windows 10, Windows Server 12, and Windows HPC Server 12 (64-bit) using Microsoft Visual Studio or SCons. You can build the Eradication binary for Linux for CentOS 7.1 using SCons.
If you want full debugging support, you must build using Visual Studio. However, Visual Studio is only capable of a monolithic build that includes all supported simulation types.
EMOD supports the following simulation types for modeling a variety of diseases:
- Generic disease (GENERIC_SIM), which can be used for modeling a variety of diseases such as influenza or measles
- Vector-borne diseases (VECTOR_SIM), which can be used for modeling vector-borne diseases such as dengue
- Malaria (MALARIA_SIM), which adds features specific to malaria biology and treatment
- Tuberculosis with HIV coinfection (TBHIV_SIM), which can be used for modeling TB transmission, with the option to add HIV coinfection as a contributing factor
- Sexually transmitted infections (STI_SIM), which adds features for sexual relationship networks
- HIV (HIV_SIM), which adds features specific to HIV biology and treatment
- Environmental transmission (ENVIRONMENTAL_SIM), which adds features for diseases transmitted through contaminated food or water
- Typhoid (TYPHOID_SIM), which adds features specific to typhoid biology and treatment
If you want to create a disease-specific build, you must build using SCons. However, SCons builds build only the release version without extensive debugging information.
Build a monolithic Eradication.exe with Visual Studio¶
You can use the Microsoft Visual Studio solution file in the EMOD source code repository to build the monolithic version of the EMOD executable (Eradication.exe), which can be either a release or debug build. Visual Studio 2015 (Professional, Premium, or Ultimate) is the currently supported version.
Visual Studio creates a debug build by default. However, you must use a release build to commission simulations to COmputational Modeling Platform Service (COMPS); attempting to use a debug build will result in an error.
- In Visual Studio, navigate to the directory where the EMOD repository is cloned and open the EradicationKernel solution.
- If prompted to upgrade the C++ toolset used, do so.
- From the Solution Configurations ribbon, select Debug or Release.
- On the Build menu, select Build Solution.
Eradication.exe will be in a subdirectory of the Eradication directory.
Build Eradication.exe or Eradication binary for Linux with SCons¶
SCons is a software construction tool that is an alternative to the well-known “Make” build tool. It is implemented in Python and the SCons configuration files, SConstruct and SConscript, are executed as Python scripts. This allows for greater flexibility and extensibility, such as the creation of custom SCons abilities just for EMOD. For more information on Scons, see www.scons.org. SCons 3.0.1 is the currently supported version.
EMOD will not build if you use the
--Debug flag. To build a debug version, you must
use Visual Studio.
Open a Command Prompt window.
Go to the directory where EMOD is installed:
Run the following command to build Eradication.exe:
For a monolithic build:
For a disease-specific build, specify one of the supported disease types using the
scons --Release --Disease=Vector
The executable will be placed, by default, in the subdirectory build\x64\Release\Eradication\ of your local EMOD source.
Additionally, you can parallelize the build process with the
--jobs flag. This flag indicates
the number of jobs that can be run at the same time (a single core can only run one job at a time).
scons --Release --Disease=Vector --jobs=4