Skip to content

How to compile MONICA (Windows)

Sanny Schulz edited this page Sep 10, 2018 · 1 revision

If you look for the older version you will find it here [How to compile MONICA?(old)](wiki/How-to-compile-MONICA-old)

Windows

Required Software

  • VisualStudio 2017 (community edition) with Language package English (If you don’t want to run Visual Studio as editor, install Visual Studio Build Tools instead)

  • Boost (Version 1.66.0)

  • Python 2.7 (x64) and/or Python27-x86

  • cmake 3.6 or newer

  • git

Please install - Python 2.7 (x64) to a folder Python27 - Python 2.7 (x86) to a folder Python27-x86.

Note: Don’t forget to install the English language package for Visual Studio(or Visual Studio Build Tools)

Environment Variables

make sure environment variables are set, usually this is done during installation of the program 'Path' should contain the executable paths to:

  • Python27 (e.g. C:\Python27\;C:\Python27\Scripts)

  • Python27-x86 (e.g. C:\Python27-x86\;C:\Python27-x86\Scripts)

  • 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

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 https://github.com/zalf-rpm/monica.git
    git clone https://github.com/zalf-rpm/monica-parameters.git
    git clone https://github.com/zalf-rpm/sys-libs.git
    git clone https://github.com/zalf-rpm/util.git
  • checkout vcpkg for dependent libs

    git clone https://github.com/Microsoft/vcpkg.git
  • build vcpkg

    cd vcpkg
    .\bootstrap-vcpkg.bat
    .\vcpkg install zeromq:x64-windows-static
    .\vcpkg install zeromq:x86-windows-static
  • download boost from https://www.boost.org/ (older versions are available on sourceforge.net)

  • unzip boost, you will probably get something like this folder structure

    |_ boost_1_66_0
         |_ boost
         |_ doc
         |_ lib
         |_ ...
  • you can either copy the boost_1_66_0 folder into your working folder or create a symlink > mklink /D boost <your boost path>` (e.g. mklink /D boost C:\boost_1_66_0)

Assuming boost has been extracted at C:\boost_1_66_0:

cd c:\zalf-rpm
cmd /c mklink /D boost C:\boost_1_66_0

Your folder structure should look like that:

working folder (e.g. 'c:\zalf-rpm')
          |_ monica
          |_ sys-lib
          |_ util
          |_ monica-parameters
          |_ vcpkg
          |_ boost
             |_ boost
             |_ doc
             |_ lib
             |_ ...
  • create a visual studio solution by using cmake change to monica in your working folder (e.g. 'c:\zalf-rpm')

    cd c:\zalf-rpm\monica
  • execute update_solution.cmd to build a 32 bit version

    update_solution.cmd
  • update_solution_x64.cmd to build a 64 bit version

    update_solution_x64.cmd
  • change to the newly created _cmake_win32 folder or _cmake_win64 open monica.sln with visual studio and compile

  • (optional) or run msbuild

    msbuild _cmake_win32/monica.sln /p:Configuration=Release /p:Platform="Win32"
    msbuild _cmake_win64/monica.sln /p:Configuration=Release /p:Platform="x64"

Creating an installer-file for Windows

Prerequesites

  • NSIS Installer (e.g. 3.0.3)

  • EnvVarUpdate.nsh (Download and save it in the 'installer'-Folder (e.g. monica-master/monica/installer)

  • MONICA should be built as Release using Visual Studio (s. above)

Run NSIS to create installer file

  • open command line and switch into the installer directory of MONICA

  • execute run-installer-x86.bat or run-installer-x64.bat

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.