Instructions on Compiling MSX with CMake
Repositories
USEPA/EPANETMSX Submodule
The USEPA/EPANETMSX repository contains a submodule reference to EPANET2.2. Therefore, it's important that you run the following commands after cloning the public USEPA repository:
cd EPANETMSX
git submodule init
git submodule update
Build Instructions
⚠️ NOTE: If in the USEPA repository, make sure you performed the submodule steps before attempting to build!
CMake CMake can be used to build EPANETMSX applications. The project's CMake file (CMakeLists.txt) is located in its root directory and supports builds for Linux, Mac OS and Windows. To build the EPANETMSX library and its command line executable using CMake, first open a console window and navigate to the project's root directory. Then enter the following commands:
cmake -B build .
cmake --build build --config Release --target package
Alternatively, OWA uses these steps for building EPANET with CMake and the same steps can be used for EPANETMSX:
mkdir build
cd build
cmake ..
cmake --build . --config Release
Documentation
EPANET-MSX manual can be found here: MSX manual
Run MSX exe
The EXE is located in either the debug or release of the following local path: \EPANETMSX\build\src\run\Debug
In order to run the exe located in this file you need to copy the DLLs from one level up: \EPANETMSX\build\src\run you will need both epanet2.dll and epanetmsx.dll Copy these dll's to the same location as the exe
Open a terminal window. cd to the folder that has the exe run runepanetmsx.exe with the input files. In this case I have the input files in my testing folder C:\test. We are providing MSX with 2 input files as parameters example.inp and example.msx. The other two parameters are output files that will be written to by MSX. The Output files do not have to exist before running the EXE. If they do exist they will be overwritten.
cd C:\Git\public\EPANETMSX\build\src\run\Debug
runepanetmsx.exe "C:\test\Examples\example.inp" "C:\test\Examples\example.msx" "C:\test\Examples\example.rpt" "C:\test\Examples\example.out"