Skip to content

WindowsOneAPIBuild

Fabian Wein edited this page Dec 18, 2022 · 15 revisions

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.

List of compiler names

  • cl - Microsoft Visual Studio C/C++ compiler
  • icx, icpx, ifx - Intel oneAPI C, C++ and Fortran compiler based on LLVM
  • icc, icpc, ifort - Intel oneAPI classical C, C++ and Fortran compiler - to be replaced by LLVM in future

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

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 like set CC=ifx, set GCC=ifpx
  • 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