Compiling MM-PIHM on Windows requires CMake and Visual Studio.
Compiling MM-PIHM requires CMake version higher than 3.1.3
.
For Visual Studio, please use Visual Studio 2017.
- In
MM-PIHM/cvode
directory, create two separate folders,builddir
andinstdir
- Open a Visual Studio Command Prompt and
cd
tobuilddir
- Run
cmake-gui ../
- Back in the VS Command Window
- Run
msbuild ALL_BUILD.vcxproj
- Run
msbuild INSTALL.vcxproj
- Run
The resulting libraries will be in the instdir
.
The sundials project can also now be opened in Visual Studio.
Double click on the ALL_BUILD.vcxproj
file to open the project.
Build the whole solution to create the sundials libraries.
Note: the following procedures have been tested using Visual Studio 2017. Visual Studio 2019, however, will report errors using the following instruction.
-
Open Visual Studio and create a new
Console App
project. Choose a project name as you desire -
Add corresponding source files
-
In
Configuration properties
->C/C++/General
, add additional include directoriessrc/include; cvode/instdir/include
-
In
Configuration properties
->C/C++/Preprocessor
, add preprocessor definition_CRT_SECURE_NO_WARNINGS
, and other preprocessor definition (e.g.,_NOAH_
for Flux-PIHM, etc.). Note that you may need to remove some files unrelated to your module from your workspace. For example, you will need to remove RT and BGC source files if you only want to compile Flux-PIHM. -
In
Linker
->Input
, add additional dependenciesXXX\MM-PIHM\cvode\instdir\lib\sundials_cvode.lib
andXXX\MM-PIHM\cvode\instdir\lib\sundials_nvecserial.lib
-
Build your project