Skip to content

WindowsOneAPIBuild

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

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

This is a brief guiedeline to build Windows on command line using Intel oneAPI

Install buildchain

  • Install Microsoft Visual Studio Community Edition for C++ with build tools (nmake, cmake, ...). Note that we will use the original cmake
  • Install Intel oneAPI C++/Fortran and Math Kernel Library with all dependent packages (the installer will help you) from oneAPI BaseKit and oneAPI HPCKit
  • Install git with options for command line
  • Install CMake from Kitware
  • Install a standard text editor like Notepad++ - one always needs a fast and good editor around :)

Setup buildchain

  • configure git and best is to add shh keys to the gitlab server
  • add C:\Program Files\Git\usr\bin to your Path in environment settings. openCFS need patch.exe from there. Make sure by calling patch --help on cmd that this worked. Otherwise openCFS will fail building it's cfsdeps.
  • add C:\Program Files (x86)\Intel\oneAPI to your Path and always run setvars before creating a new openCFS build directory with cmake
  • prepare a .cfs_platform_defaults.cmake and place it in your home directory.

First time build

  • start cmd and make sure that nmake, patch --help and ifort are found. I ifort was not found, you probably forgot to call setvars
  • clone cfs e.g. to code\cfs in your home
  • create there build directory, e.g. code\cfs\release and go there

List of compilers

Compilers can be selected prior initial build generation by cmake by setting the environment variables CC, CXX and FC. E.g. set CC=icc, set GCC=icpc. Make sure, the compilers are in Path (e.g. call setvars). On Linux usually different executables are used for C and C++ compiler, e.g. icc and icpx for Intel classic compilers. On Windows the compilers are often combined C/C++ and the names change for Intel compilers - be careful and set double, e.g. CC=icx and CXX=icx

  • cl - Microsoft Visual Studio C/C++ compiler
  • icx - Intel oneAPI combined C/C++ compiler based on LLVM with MSVC compatible command line interface
  • (icpx - Intel oneAPI combined (C/?)C++ compiler based on LLVM with gcc compatible command line interface - don't use)
  • (ifx - Intel oneAPI Fortran compiler based on LLVM - not really mature)
  • icl - Intel oneAPI classic combined C/C++ - announced to be removed mid 2023
  • ifort - Intel oneAPI classic Fortran compiler - currently superior to ifx
  • clang, clang++ - LLVM compiler distributed Microsoft Visual Studio (check with --version)
  • (clang, clang++ - from Intel oneAPI in windows\bin-llvm. Seems to be icx and icpx. check with --version)

CMake configuration

We assume to be in a created and empty (!) build directory within the cloned openCFS source. One can either call cmake-gui .. or cmake .. -G "NMake Makefiles. After the initial configuration one can always call cmake-gui . or cmake ., independent on what has been called before. The . can be optionally used instead of .. after the second call.

cmake-gui

with cmake-gui you can choose the Generator (use NMake Makefiles) and choose the compilers before configuring openCFS

cmake

  • when you don't want to use default compilers (MSVC for C/C++ and ifx for Fortran), you need to set them as environment variables, see above.
  • with cmake .. -G "NMake Makefiles" you can do an automated configuration based on the settings in .cfs_platform_defaults.cmake.
  • the settings can be altered via cmake-gui

Clone this wiki locally