How to compile MONICA (Windows) (original) (raw)
Windows
Required Software
- VisualStudio 2022 (community edition) with Language package English (If you don’t want to run Visual Studio as editor, install Visual Studio Build Tools instead)
- cmake 3.28 or newer
- git
Environment Variables
make sure environment variables are set, usually this is done during installation of the program 'Path' should contain the executable paths to:
- git (2.13 or higher) (e.g. C:\Program Files\Git\cmd)
- cmake (e.g. C:\Program Files\CMake\bin)
- (optional) msbuild -if using the VS Build Tools
Note: Don’t forget to install the English language package for Visual Studio(or Visual Studio Build Tools)
Steps (Windows 10 using PowerShell)
- create and switch to your working folder e.g 'c:\zalf-rpm'
mkdir c:\zalf-rpm
cd c:\zalf-rpm - checkout monica and related repositories with git
git clone --recurse-submodules https://github.com/zalf-rpm/monica.git
git clone https://github.com/zalf-rpm/monica-parameters.git - checkout vcpkg for dependent libs, but use the tagged version found in the vcpkg_tag.txt file in the root of the MONICA repository
git clone -b 2025.10.17 https://github.com/Microsoft/vcpkg.git - build vcpkg
cd vcpkg
.\bootstrap-vcpkg.bat
.\vcpkg install zeromq:x64-windows-static
.\vcpkg install capnproto:x64-windows-static
.\vcpkg install libsodium:x64-windows-static
.\vcpkg install tomlplusplus:x64-windows-static
Your folder structure should look like that:
working folder (e.g. 'c:\zalf-rpm') |_ monica |_ monica-parameters |_ vcpkg
- create a visual studio solution by using cmake change to monica in your working folder (e.g. 'c:\zalf-rpm')
- create_solution_x64_VS17_2022.cmd to build
.\create_solution_x64_VS17_2022.cmd - change to the newly created _cmake_win64 open monica.sln with visual studio and compile
- (optional) or run msbuild msbuild _cmake_win64/monica.sln /p:Configuration=Release /p:Platform="x64"
Creating an installer-file for Windows
Prerequesites
- MONICA should be built as Release using Visual Studio (s. above)