Skip to content

WindowsBuild

Mirror Bot edited this page Aug 31, 2026 · 3 revisions

Configure and Build for Windows

Note: This article might not longer be up to date. Please consult Building CFS on Windows for the latest guide.

PREREQUISITES

Intel® Parallel Studio XE and Visual Studio. First install Visual Studio (with Python environment), then install Intel® Parallel Studio XE.

PREPARATIONS

You will need the following Python Packages: lxml, numpy, mpi4py

How to install:

  1. Open Visual Studio
  2. Create a new Python Project
  3. Click on the right hand side at `Python-Environment´
  4. In the line overview choose Packages(PiPy)
  5. Search for the package you would like to install
  6. Click pip install

Do also:

  • Create in C:\Users\user\ a file (e.g. Code) and clone the repository
cd C:\Users\user
md code
  • Create in C:\Users\user\ a file (e.g. CFSdev)
md CFSdev

and insert both files cfs_Intel2020, CFS_Intel2020

  • Open properties of the shortcut CFS_Intel2020 and edit the target of the batch -file.

  • Edit the batch - file cfs_Intel2020 and edit the directory paths individually.

  • Edit the file Microsoft.Cl.Common.props

    • located in C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\
    • change Default to stdcpp14

    NOTE: stdcpp17 or higher would also apply, however, flann will not compile

  • Install Unixutils.msi and make sure the path of installation in the batch-file cfs_Intel2020 coincides with place of installation.

MAIN PART

There will be explained four versions: NMake or Visual Studio as compiler and Debug or Release version.

Release version & NMAKE

RN1) Create in C:\Users\user\CFSdev a file (e.g. CFSbulid)

md CFSbuild
set CFS_ROOT_DIR=%cd%

RN2) Open the shortcut CFS_Intel2020 and run

cmake-gui 

Cmake opens

  • browse bulid: enter the path of CFSbulid file
  • browse source: enter the path of the repository containing CFS Code
  • press configure and use NMake makefiles as generator
  • press configure until everything is settled, then generate

RN3) Open your Explorer and copy rectangle.msh file in Testsuite\TESTSUIT\Solver\feast\real-symmetric\rectangle.msh

to all directories you can find in Testsuite\TESTSUIT\Solver\feast

RN4) Type in the administration terminal in order to build cfsdeps first:

nmake cfsdeps 

RN5) type

nmake 

RN6) In order to test your Version, change to the directory CFSbuild/testsuite and run

ctest

Debug Version and NMAKE

DN1) Create a local branch

git branch dev-local
git checkout dev-local

DN2) Copy all files (source, cfsdeps, cmake_modules) in the code file.

DN3) Create a file (e.g. devUser) in C:\Users\user\CFSdev

DN4) Open the shortcut CFS_Intel2020 and run

set CFS_ROOT_DIR=%cd% 
cmake-gui

cmake opens

  • browse bulid: enter the path of devUser file
  • configure: use NMake makefiles as generator
  • type at CMAKE_BUILD_TYPE only Debug
  • enable Debug
  • press configure until everything is settled, then generate

DN5) If not already done, do RN3)

DN6) In the command shell type

nmake cfsdeps
nmake

Release Version and Visual Studio

RV1) Create a file (e.g. devUser_VS) in C:\Users\user\CFSdev

RV2) Open the shortcut CFS_Intel2020 and run

set CFS_ROOT_DIR=%cd%
cmake-gui 

cmake opens

  • browse bulid: enter the path of devUser_VS file *configure:
    • choose in first row VS2019
    • type in second row Intel C++ Compiler 19.1
    • enable Specify native Compilers
  • type at CMAKE_CONFIGURATION_TYPES only Release
  • type at CMAKE_CXX_COMPILER and CMAKE_C_COMPILER: C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2020.2.254/windows/bin/intel64/icl.exe
  • type at CMAKE_Fortran_COMPILER C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2020.2.254/windows/bin/intel64/ifort.exe
  • disable DEBUG
  • enable BUILD_TESTING
  • press configure until everything is settled, then generate

RV3) If not already done, do RN3)

RV4) In the command shell type

devenv CFS.sln

Visual Studio opens

RV5) In the project map CFS, click at cfsdeps and then create

RV6) Click at ALL_BUILD and then create

RV7) Click at CFS_tests and then create In order to run the tests.

Debug Version & Visual Studio

If not already done, do the steps DN1) and DN2). Then go on with

DV1) Create a file (e.g. devUser_VSDebug) in C:\Users\user\CFSdev

DV2) Open the shortcut CFS_Intel2020 and run

set CFS_ROOT_DIR=%cd%
cmake-gui

cmake opens

  • browse bulid: enter the path of devUser_VSDebug file
  • configure:
    • choose in first row VS2019
    • type in second row Intel C++ Compiler 19.1
    • enable Specify native Compilers
  • type at CMAKE_CONFIGURATION_TYPES only Debug
  • type at CMAKE_CXX_COMPILER and CMAKE_C_COMPILER: C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2020.2.254/windows/bin/intel64/icl.exe
  • type at CMAKE_Fortran_COMPILER C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2020.2.254/windows/bin/intel64/ifort.exe
  • enable DEBUG
  • enable BUILD_TESTING
  • press configure until everything is settled, then generate

Do the steps RN3) and RV3) to RV6)

Using SNOPT and SCPIP

If you want to use this optimizers in your current CFS version,

  1. create two directories snopt and scpip in CFSdev/version/cfsdeps/cache/sources
  2. Copy the both zip - files (snopt, scpip) in the corresponding directory, you currently created.
  1. In the command shell run
cmake-gui

cmake opens

  • enable USE_SNOPT, USE_SCPIP
  • configure and generate
  1. Compile your Version again (either with nmake or Viusal Studio).

Clone this wiki locally