CMS Compilation/Windows

From CIRPwiki
Jump to navigation Jump to search

Installation with Visual Studio¶

To obtain the pre-built CMS executable, it can be found here, CMS Releases.


Our team generally uses the following tools for compiling the production release version of CMS.

  • Microsoft Visual Studio 2022 (Community version is fine)
  • Intel oneAPI Base and HPC kits (2024.1)

Install the three tools in the following order.

  1. Install MS Visual Studio 2022 (or 2019)
    • Make sure “Desktop development with C++” is selected at a minimum
  2. Install Intel oneAPI Base kit (C++ language only) with Visual Studio integration.
  3. Install Intel oneAPI HPC kit (adds Fortran) with Visual Studio integration.


Note: It has been mentioned there may be an Intel oneAPI Fortran only build which may be possibly used but we have not yet tested it.

Settings for Visual Studio

Release Configuration Properties

Project Settings:

Linker | Input - Additional Dependencies =>
"..\external_libraries\XMDF\xmdf2.2x64.lib"
Linker | System - Stack Reserve Size => 92428800
Fortran | Optimization - Optimization => Maximum Speed plus Higher Level Optimizations
Fortran | Optimization - Global Optimizations => Yes (/Og)
Fortran | Language - Process OpenMP Directives => Generate Parallel Code (/Qopenmp)
Fortran | Floating Point | Floating Point Exception Handling =>
Underflow gives 0.0; Abort on other IEEE exceptions (/fpe:0) (giving problems with ICCG solver) or Produce NaN, signed infinities, and denormal results (more stable for some reason)
Fortran | Run-time - Generate Traceback Information => Yes
Fortran | Run-time - Check Array and Sting Bounds => Yes
Fortran | Run-time - Check Uninitialized Variables => Yes
Fortran | Preprocessor - Preprocess source file => Yes
Fortran | Preprocessor - Additional include directories => ..\source\main\
Debug Configuration Properties

Project Settings:

Linker | Input - Additional Dependencies
"..\external_libraries\XMDF\xmdf2.2dx64.lib"
Linker | System - Stack Reserve Size => 92428800
Linker | Debugging - Generate Debug Infor =>Yes (/DEBUG)
Linker | Input - Ignore specific library => LIBCMT.lib (bug in Visual Studio 2010+)
Fortran | Debugging - Debug Information Format => Full(/debug:full)
Fortran | Debugging - Information for PARAMETER Constants => All(/debug-parameters:all)
Fortran | Diagnostics - Compile time diagnostics => Show All (/warn:all)
Fortran | Preprocessor - Preprocess source file => Yes
Fortran | Preprocessor - Additional include directories => ..\source\main\

Specific file Properties for the following files: - CMS-Wave_v3.4W_Jan2025.f90

Fortran | Diagnostics - Compile time diagnostics => Disable All (/warn:none)