Repository navigation
WindowsOneAPIBuild
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 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 :)
- configure git and best is to add shh keys to the gitlab server
- add
C:\Program Files\Git\usr\binto your Path in environment settings. openCFS need patch.exe from there. Make sure by callingpatch --helpon cmd that this worked. Otherwise openCFS will fail building it's cfsdeps. - add
C:\Program Files (x86)\Intel\oneAPIto your Path and always runsetvarsbefore creating a new openCFS build directory with cmake - prepare a
.cfs_platform_defaults.cmakeand place it in your home directory.
- start cmd and make sure that
nmake,patch --helpandifortare found. Iifortwas not found, you probably forgot to callsetvars - clone cfs e.g. to
code\cfsin your home - create there build directory, e.g.
code\cfs\releaseand go there
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)
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.
with cmake-gui you can choose the Generator (use NMake Makefiles) and choose the compilers before configuring openCFS
- 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