diff --git a/docs/maintainer/knowledge_base.mdx b/docs/maintainer/knowledge_base.mdx index a81fdf8d2e..6ef688dd77 100644 --- a/docs/maintainer/knowledge_base.mdx +++ b/docs/maintainer/knowledge_base.mdx @@ -782,8 +782,8 @@ corresponding compilers in `requirements/build` as normal. The default OpenMP runtime used depends on the compiler and platform used. GCC (on Linux and the Windows MinGW toolchain) uses the `libgomp` runtime. Clang (on all platforms) and GNU Fortran on macOS default to the `llvm-openmp` -runtime. MSVC may use its own runtime or `llvm-openmp`. However, individual projects may force building against -a different runtime through their build system configuration. +runtime. For MSVC `llvm-openmp` is recommended, though `llvm-openmp` requires use of the `/openmp:llvm` option. +However, individual projects may force building against a different runtime through their build system configuration. On Linux, building against `libgomp` is recommended as the other OpenMP providers are backwards compatible with it. When packages are built against `libgomp`, it is possible to use both `libgomp` and `llvm-openmp` provider at runtime. @@ -794,19 +794,31 @@ to the defaults, though individual packages may require a different set: ```recipe +build: + script: + - set "CXXFLAGS=%CXXFLAGS% /openmp:llvm" # [win] + +... + requirements: host: - - llvm-openmp # [osx] - libgomp # [linux] + - llvm-openmp # [not linux] ``` ```recipe +build: + script: + - if: win + then: set "CXXFLAGS=%CXXFLAGS% /openmp:llvm" + +... + requirements: host: - - if: osx - then: llvm-openmp - if: linux then: libgomp + else: llvm-openmp ```