Skip to content

CMake cannot find OpenMP with llvmPackages_13.libcxxStdenv #161062

@hmenke

Description

@hmenke

Describe the bug

Clang does not include the OpenMP runtime as part of the compiler like GCC does. It has to be installed separately and is packaged as llvmPackages.openmp. However, CMake is unable to find OpenMP despite adding it to buildInputs.

Below is an example consisting of three files that have to be placed in the same directory to reproduce.

The CMakeError.log suggests that the standard library is not setup correctly. There are lots of unknown type name errors. Using llvmPackages_13.stdenv instead of llvmPackages_13.libcxxStdenv works, but I want to build against libc++.

Steps To Reproduce

Tested failing on:

omp_test.cpp

#include <cstdio>
#include <omp.h>
int main() {
    #pragma omp parallel
    #pragma omp single
    printf("%d\n", omp_get_num_threads());
}

CMakeLists.txt

cmake_minimum_required(VERSION 3.13)
project(omp_test CXX)
add_executable(omp_test omp_test.cpp)
find_package(OpenMP REQUIRED COMPONENTS CXX)
target_link_libraries(omp_test PRIVATE OpenMP::OpenMP_CXX)
install(TARGETS omp_test)

default.nix

{ pkgs ? import <nixpkgs> {} }:
pkgs.llvmPackages_13.libcxxStdenv.mkDerivation {
  name = "omp_test";
  src = ./.;
  nativeBuildInputs = [ pkgs.cmake ];
  buildInputs = [ pkgs.llvmPackages_13.openmp ];
}
$ nix-build --keep-failed                                                                                                                                                                                                                    
this derivation will be built:                                                                                                                                                                                                                 
  /nix/store/bhkay6ykn9xmf65a639g5y4hdcl9qw0s-omp_test.drv                                                                                                                                                                                     
building '/nix/store/bhkay6ykn9xmf65a639g5y4hdcl9qw0s-omp_test.drv'...                                                                                                                                                                         
unpacking sources                                                                                                                                                                                                                              
unpacking source archive /nix/store/zw8kj8v9mx9zg1xccw46ll3l5sw90rsb-test                                                                                                                                                                      
source root is test                                                                                                                                                                                                                            
patching sources                                                                                                                                                                                                                               
configuring                                                                                                                                                                                                                                    
fixing cmake files...                                                                                                                                                                                                                          
cmake flags: -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_BUILD_RPATH=ON -DBUILD_TESTING=OFF -DCMAKE_INSTALL_LOCALEDIR=/nix
/store/66lpar56mr968f1k6m85fx1kznqrv3ag-omp_test/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/66lpar56mr968f1k6m85fx1kznqrv3ag-omp_test/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/66lpar56mr968f1k6m85fx1kznqrv3ag-omp_test/lib -DCMAKE_I
NSTALL_DOCDIR=/nix/store/66lpar56mr968f1k6m85fx1kznqrv3ag-omp_test/share/doc/omp_test -DCMAKE_INSTALL_INFODIR=/nix/store/66lpar56mr968f1k6m85fx1kznqrv3ag-omp_test/share/info -DCMAKE_INSTALL_MANDIR=/nix/store/66lpar56mr968f1k6m85fx1kznqrv3a
g-omp_test/share/man -DCMAKE_INSTALL_OLDINCLUDEDIR=/nix/store/66lpar56mr968f1k6m85fx1kznqrv3ag-omp_test/include -DCMAKE_INSTALL_INCLUDEDIR=/nix/store/66lpar56mr968f1k6m85fx1kznqrv3ag-omp_test/include -DCMAKE_INSTALL_SBINDIR=/nix/store/66lp
ar56mr968f1k6m85fx1kznqrv3ag-omp_test/sbin -DCMAKE_INSTALL_BINDIR=/nix/store/66lpar56mr968f1k6m85fx1kznqrv3ag-omp_test/bin -DCMAKE_INSTALL_NAME_DIR=/nix/store/66lpar56mr968f1k6m85fx1kznqrv3ag-omp_test/lib -DCMAKE_POLICY_DEFAULT_CMP0025=NEW
 -DCMAKE_OSX_SYSROOT= -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_STRIP=/nix/store/09vrbabr36jg49s3s4hfs5d0gx9mm3lc-clang-wrapper-13.0.0/bin/strip -DCMAKE_RANLIB=/nix/store/sga0l55gm9nlwglk79lmihwb2bpv597j-binutils-2.35.2/bin/ranlib -DCMAKE_AR=/ni
x/store/sga0l55gm9nlwglk79lmihwb2bpv597j-binutils-2.35.2/bin/ar -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_INSTALL_PREFIX=/nix/store/66lpar56mr968f1k6m85fx1kznqrv3ag-omp_test                                              
-- The CXX compiler identification is Clang 13.0.0                                                                                                                                                                                             
-- Detecting CXX compiler ABI info                                                                                                                                                                                                             
-- Detecting CXX compiler ABI info - done                                                                                                                                                                                                      
-- Check for working CXX compiler: /nix/store/09vrbabr36jg49s3s4hfs5d0gx9mm3lc-clang-wrapper-13.0.0/bin/clang++ - skipped                                                                                                                      
-- Detecting CXX compile features                                                                                                                                                                                                              
-- Detecting CXX compile features - done                                                                                                                                                                                                       
CMake Error at /nix/store/sgsvy949kd2sr2vsxcffz5jkv855rmib-cmake-3.22.2/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):                                                                                            
  Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES)                                                                                                                                                                   
Call Stack (most recent call first):                                                                                                                                                                                                           
  /nix/store/sgsvy949kd2sr2vsxcffz5jkv855rmib-cmake-3.22.2/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)                                                                                           
  /nix/store/sgsvy949kd2sr2vsxcffz5jkv855rmib-cmake-3.22.2/share/cmake-3.22/Modules/FindOpenMP.cmake:544 (find_package_handle_standard_args)                                                                                                   
  CMakeLists.txt:4 (find_package)                                                                                                                                                                                                              
                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                               
-- Configuring incomplete, errors occurred!                                                                                                                                                                                                    
See also "/build/test/build/CMakeFiles/CMakeOutput.log".                                                                                                                                                                                       
See also "/build/test/build/CMakeFiles/CMakeError.log".                                                                                                                                                                                        
note: keeping build directory '/tmp/nix-build-omp_test.drv-0'                                                                                                                                                                                  
error: builder for '/nix/store/bhkay6ykn9xmf65a639g5y4hdcl9qw0s-omp_test.drv' failed with exit code 1;                                                                                                                                         
       last 10 log lines:                                                                                                                                                                                                                      
       >   Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES)                                                                                                                                                          
       > Call Stack (most recent call first):                                                                                                                                                                                                  
       >   /nix/store/sgsvy949kd2sr2vsxcffz5jkv855rmib-cmake-3.22.2/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)                                                                                  
       >   /nix/store/sgsvy949kd2sr2vsxcffz5jkv855rmib-cmake-3.22.2/share/cmake-3.22/Modules/FindOpenMP.cmake:544 (find_package_handle_standard_args)                                                                                          
       >   CMakeLists.txt:4 (find_package)                                                                                                                                                                                                     
       >                                                                                                                                                                                                                                       
       >                                                                                                                                                                                                                                       
       > -- Configuring incomplete, errors occurred!                                                                                                                                                                                           
       > See also "/build/test/build/CMakeFiles/CMakeOutput.log".                                                                                                                                                                              
       > See also "/build/test/build/CMakeFiles/CMakeError.log".                                                                                                                                                                               
       For full logs, run 'nix log /nix/store/bhkay6ykn9xmf65a639g5y4hdcl9qw0s-omp_test.drv'.
/tmp/nix-build-omp_test.drv-0/test/build/CMakeFiles/CMakeError.log
Detecting CXX OpenMP failed with the following output:
Change Dir: /build/test/build/CMakeFiles/CMakeTmp

Run Build Command(s):/nix/store/is8wg3j77z9ndpsvkm85sfbrlvvqd66l-gnumake-4.3/bin/make -f Makefile cmTC_b2a2a/fast && /nix/store/is8wg3j77z9ndpsvkm85sfbrlvvqd66l-gnumake-4.3/bin/make  -f CMakeFiles/cmTC_b2a2a.dir/build.make CMakeFiles/cmTC_b2a2a.dir/build
make[1]: Entering directory '/build/test/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_b2a2a.dir/OpenMPTryFlag.cpp.o
/nix/store/09vrbabr36jg49s3s4hfs5d0gx9mm3lc-clang-wrapper-13.0.0/bin/clang++   -fopenmp=libomp -v -MD -MT CMakeFiles/cmTC_b2a2a.dir/OpenMPTryFlag.cpp.o -MF CMakeFiles/cmTC_b2a2a.dir/OpenMPTryFlag.cpp.o.d -o CMakeFiles/cmTC_b2a2a.dir/OpenMPTryFlag.cpp.o -c /build/test/build/CMakeFiles/FindOpenMP/OpenMPTryFlag.cpp
clang version 13.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /nix/store/9k6x3pif7fq745rqx295mwn94z9slx6n-clang-13.0.0/bin
Found candidate GCC installation: /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib/gcc/x86_64-unknown-linux-gnu/10.3.0
Found candidate GCC installation: /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0
Selected GCC installation: /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
 (in-process)
 "/nix/store/9k6x3pif7fq745rqx295mwn94z9slx6n-clang-13.0.0/bin/clang-13" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj --mrelax-relocations -disable-free -disable-llvm-verifier -discard-value-names -main-file-name OpenMPTryFlag.cpp -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=none -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -v -fcoverage-compilation-dir=/build/test/build/CMakeFiles/CMakeTmp -nostdsysteminc -resource-dir /nix/store/09vrbabr36jg49s3s4hfs5d0gx9mm3lc-clang-wrapper-13.0.0/resource-root -dependency-file CMakeFiles/cmTC_b2a2a.dir/OpenMPTryFlag.cpp.o.d -MT CMakeFiles/cmTC_b2a2a.dir/OpenMPTryFlag.cpp.o -sys-header-deps -idirafter /nix/store/vccvfa5bjb9dv4x6zq5gjf1yp58y4brg-glibc-2.33-108-dev/include -isystem /nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include -isystem /nix/store/6pg9132gkwqdpgpymf422igx98ffy7sl-libcxxabi-13.0.0-dev/include -isystem /nix/store/kqi2m0f8g3p4ylk8ja76wk61i53gqgqm-compiler-rt-libc-13.0.0-dev/include -isystem /nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include -isystem /nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include -isystem /nix/store/6pg9132gkwqdpgpymf422igx98ffy7sl-libcxxabi-13.0.0-dev/include -isystem /nix/store/kqi2m0f8g3p4ylk8ja76wk61i53gqgqm-compiler-rt-libc-13.0.0-dev/include -isystem /nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include -isystem /nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1 -D _FORTIFY_SOURCE=2 -internal-isystem /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0 -internal-isystem /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0/x86_64-unknown-linux-gnu -internal-isystem /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0/backward -internal-isystem /nix/store/09vrbabr36jg49s3s4hfs5d0gx9mm3lc-clang-wrapper-13.0.0/resource-root/include -O2 -Wformat -Wformat-security -Werror=format-security -fdeprecated-macro -fdebug-compilation-dir=/build/test/build/CMakeFiles/CMakeTmp -ferror-limit 19 -fopenmp -fwrapv -stack-protector 2 -stack-protector-buffer-size 4 -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -vectorize-loops -vectorize-slp -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_b2a2a.dir/OpenMPTryFlag.cpp.o -x c++ /build/test/build/CMakeFiles/FindOpenMP/OpenMPTryFlag.cpp
clang -cc1 version 13.0.0 based upon LLVM 13.0.0 default target x86_64-unknown-linux-gnu
ignoring duplicate directory "/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include"
ignoring duplicate directory "/nix/store/6pg9132gkwqdpgpymf422igx98ffy7sl-libcxxabi-13.0.0-dev/include"
ignoring duplicate directory "/nix/store/kqi2m0f8g3p4ylk8ja76wk61i53gqgqm-compiler-rt-libc-13.0.0-dev/include"
ignoring duplicate directory "/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include"
#include "..." search starts here:
#include <...> search starts here:
 /nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include
 /nix/store/6pg9132gkwqdpgpymf422igx98ffy7sl-libcxxabi-13.0.0-dev/include
 /nix/store/kqi2m0f8g3p4ylk8ja76wk61i53gqgqm-compiler-rt-libc-13.0.0-dev/include
 /nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include
 /nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1
 /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0
 /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0/x86_64-unknown-linux-gnu
 /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0/backward
 /nix/store/09vrbabr36jg49s3s4hfs5d0gx9mm3lc-clang-wrapper-13.0.0/resource-root/include
 /nix/store/vccvfa5bjb9dv4x6zq5gjf1yp58y4brg-glibc-2.33-108-dev/include
End of search list.
In file included from /build/test/build/CMakeFiles/FindOpenMP/OpenMPTryFlag.cpp:2:
In file included from /nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:18:
/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1/stdlib.h:142:34: error: unknown type name 'ldiv_t'
inline _LIBCPP_INLINE_VISIBILITY ldiv_t div(long __x, long __y) _NOEXCEPT {
                                 ^
/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1/stdlib.h:143:12: error: no member named 'ldiv' in the global namespace
  return ::ldiv(__x, __y);
         ~~^
/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1/stdlib.h:146:34: error: unknown type name 'lldiv_t'
inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x,
                                 ^
/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1/stdlib.h:148:12: error: no member named 'lldiv' in the global namespace
  return ::lldiv(__x, __y);
         ~~^
In file included from /build/test/build/CMakeFiles/FindOpenMP/OpenMPTryFlag.cpp:2:
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:142:58: error: use of undeclared identifier 'size_t'; did you mean 'std::size_t'?
    extern void* __KAI_KMPC_CONVENTION  omp_target_alloc(size_t, int);
                                                         ^
/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1/cstdlib:99:9: note: 'std::size_t' declared here
using ::size_t _LIBCPP_USING_IF_EXISTS;
        ^
In file included from /build/test/build/CMakeFiles/FindOpenMP/OpenMPTryFlag.cpp:2:
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:142:58: error: reference to unresolved using declaration
    extern void* __KAI_KMPC_CONVENTION  omp_target_alloc(size_t, int);
                                                         ^
/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1/cstdlib:99:1: note: using declaration annotated with 'using_if_exists' here
using ::size_t _LIBCPP_USING_IF_EXISTS;
^
In file included from /build/test/build/CMakeFiles/FindOpenMP/OpenMPTryFlag.cpp:2:
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:142:58: error: unknown type name 'size_t'
    extern void* __KAI_KMPC_CONVENTION  omp_target_alloc(size_t, int);
                                                         ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:145:81: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_memcpy(void *, const void *, size_t, size_t, size_t, int, int);
                                                                                ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:145:89: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_memcpy(void *, const void *, size_t, size_t, size_t, int, int);
                                                                                        ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:145:97: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_memcpy(void *, const void *, size_t, size_t, size_t, int, int);
                                                                                                ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:146:86: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_memcpy_rect(void *, const void *, size_t, int, const size_t *,
                                                                                     ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:146:105: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_memcpy_rect(void *, const void *, size_t, int, const size_t *,
                                                                                                        ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:147:51: error: unknown type name 'size_t'
                                            const size_t *, const size_t *, const size_t *, const size_t *, int, int);
                                                  ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:147:67: error: unknown type name 'size_t'
                                            const size_t *, const size_t *, const size_t *, const size_t *, int, int);
                                                                  ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:147:83: error: unknown type name 'size_t'
                                            const size_t *, const size_t *, const size_t *, const size_t *, int, int);
                                                                                  ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:147:99: error: unknown type name 'size_t'
                                            const size_t *, const size_t *, const size_t *, const size_t *, int, int);
                                                                                                  ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:148:94: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_associate_ptr(const void *, const void *, size_t, size_t, int);
                                                                                             ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:148:102: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_associate_ptr(const void *, const void *, size_t, size_t, int);
                                                                                                     ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:231:88: error: unknown type name 'size_t'
    extern int    __KAI_KMPC_CONVENTION  omp_target_memcpy_async(void *, const void *, size_t, size_t, size_t, int,
                                                                                       ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[1]: *** [CMakeFiles/cmTC_b2a2a.dir/build.make:79: CMakeFiles/cmTC_b2a2a.dir/OpenMPTryFlag.cpp.o] Error 1
make[1]: Leaving directory '/build/test/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_b2a2a/fast] Error 2



Detecting CXX OpenMP failed with the following output:
Change Dir: /build/test/build/CMakeFiles/CMakeTmp

Run Build Command(s):/nix/store/is8wg3j77z9ndpsvkm85sfbrlvvqd66l-gnumake-4.3/bin/make -f Makefile cmTC_1da41/fast && /nix/store/is8wg3j77z9ndpsvkm85sfbrlvvqd66l-gnumake-4.3/bin/make  -f CMakeFiles/cmTC_1da41.dir/build.make CMakeFiles/cmTC_1da41.dir/build
make[1]: Entering directory '/build/test/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_1da41.dir/OpenMPTryFlag.cpp.o
/nix/store/09vrbabr36jg49s3s4hfs5d0gx9mm3lc-clang-wrapper-13.0.0/bin/clang++   -fopenmp=libiomp5 -v -MD -MT CMakeFiles/cmTC_1da41.dir/OpenMPTryFlag.cpp.o -MF CMakeFiles/cmTC_1da41.dir/OpenMPTryFlag.cpp.o.d -o CMakeFiles/cmTC_1da41.dir/OpenMPTryFlag.cpp.o -c /build/test/build/CMakeFiles/FindOpenMP/OpenMPTryFlag.cpp
clang version 13.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /nix/store/9k6x3pif7fq745rqx295mwn94z9slx6n-clang-13.0.0/bin
Found candidate GCC installation: /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib/gcc/x86_64-unknown-linux-gnu/10.3.0
Found candidate GCC installation: /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0
Selected GCC installation: /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
 (in-process)
 "/nix/store/9k6x3pif7fq745rqx295mwn94z9slx6n-clang-13.0.0/bin/clang-13" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj --mrelax-relocations -disable-free -disable-llvm-verifier -discard-value-names -main-file-name OpenMPTryFlag.cpp -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=none -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -v -fcoverage-compilation-dir=/build/test/build/CMakeFiles/CMakeTmp -nostdsysteminc -resource-dir /nix/store/09vrbabr36jg49s3s4hfs5d0gx9mm3lc-clang-wrapper-13.0.0/resource-root -dependency-file CMakeFiles/cmTC_1da41.dir/OpenMPTryFlag.cpp.o.d -MT CMakeFiles/cmTC_1da41.dir/OpenMPTryFlag.cpp.o -sys-header-deps -idirafter /nix/store/vccvfa5bjb9dv4x6zq5gjf1yp58y4brg-glibc-2.33-108-dev/include -isystem /nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include -isystem /nix/store/6pg9132gkwqdpgpymf422igx98ffy7sl-libcxxabi-13.0.0-dev/include -isystem /nix/store/kqi2m0f8g3p4ylk8ja76wk61i53gqgqm-compiler-rt-libc-13.0.0-dev/include -isystem /nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include -isystem /nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include -isystem /nix/store/6pg9132gkwqdpgpymf422igx98ffy7sl-libcxxabi-13.0.0-dev/include -isystem /nix/store/kqi2m0f8g3p4ylk8ja76wk61i53gqgqm-compiler-rt-libc-13.0.0-dev/include -isystem /nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include -isystem /nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1 -D _FORTIFY_SOURCE=2 -internal-isystem /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0 -internal-isystem /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0/x86_64-unknown-linux-gnu -internal-isystem /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0/backward -internal-isystem /nix/store/09vrbabr36jg49s3s4hfs5d0gx9mm3lc-clang-wrapper-13.0.0/resource-root/include -O2 -Wformat -Wformat-security -Werror=format-security -fdeprecated-macro -fdebug-compilation-dir=/build/test/build/CMakeFiles/CMakeTmp -ferror-limit 19 -fopenmp -fwrapv -stack-protector 2 -stack-protector-buffer-size 4 -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -vectorize-loops -vectorize-slp -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_1da41.dir/OpenMPTryFlag.cpp.o -x c++ /build/test/build/CMakeFiles/FindOpenMP/OpenMPTryFlag.cpp
clang -cc1 version 13.0.0 based upon LLVM 13.0.0 default target x86_64-unknown-linux-gnu
ignoring duplicate directory "/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include"
ignoring duplicate directory "/nix/store/6pg9132gkwqdpgpymf422igx98ffy7sl-libcxxabi-13.0.0-dev/include"
ignoring duplicate directory "/nix/store/kqi2m0f8g3p4ylk8ja76wk61i53gqgqm-compiler-rt-libc-13.0.0-dev/include"
ignoring duplicate directory "/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include"
#include "..." search starts here:
#include <...> search starts here:
 /nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include
 /nix/store/6pg9132gkwqdpgpymf422igx98ffy7sl-libcxxabi-13.0.0-dev/include
 /nix/store/kqi2m0f8g3p4ylk8ja76wk61i53gqgqm-compiler-rt-libc-13.0.0-dev/include
 /nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include
 /nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1
 /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0
 /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0/x86_64-unknown-linux-gnu
 /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0/backward
 /nix/store/09vrbabr36jg49s3s4hfs5d0gx9mm3lc-clang-wrapper-13.0.0/resource-root/include
 /nix/store/vccvfa5bjb9dv4x6zq5gjf1yp58y4brg-glibc-2.33-108-dev/include
End of search list.
In file included from /build/test/build/CMakeFiles/FindOpenMP/OpenMPTryFlag.cpp:2:
In file included from /nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:18:
/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1/stdlib.h:142:34: error: unknown type name 'ldiv_t'
inline _LIBCPP_INLINE_VISIBILITY ldiv_t div(long __x, long __y) _NOEXCEPT {
                                 ^
/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1/stdlib.h:143:12: error: no member named 'ldiv' in the global namespace
  return ::ldiv(__x, __y);
         ~~^
/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1/stdlib.h:146:34: error: unknown type name 'lldiv_t'
inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x,
                                 ^
/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1/stdlib.h:148:12: error: no member named 'lldiv' in the global namespace
  return ::lldiv(__x, __y);
         ~~^
In file included from /build/test/build/CMakeFiles/FindOpenMP/OpenMPTryFlag.cpp:2:
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:142:58: error: use of undeclared identifier 'size_t'; did you mean 'std::size_t'?
    extern void* __KAI_KMPC_CONVENTION  omp_target_alloc(size_t, int);
                                                         ^
/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1/cstdlib:99:9: note: 'std::size_t' declared here
using ::size_t _LIBCPP_USING_IF_EXISTS;
        ^
In file included from /build/test/build/CMakeFiles/FindOpenMP/OpenMPTryFlag.cpp:2:
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:142:58: error: reference to unresolved using declaration
    extern void* __KAI_KMPC_CONVENTION  omp_target_alloc(size_t, int);
                                                         ^
/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1/cstdlib:99:1: note: using declaration annotated with 'using_if_exists' here
using ::size_t _LIBCPP_USING_IF_EXISTS;
^
In file included from /build/test/build/CMakeFiles/FindOpenMP/OpenMPTryFlag.cpp:2:
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:142:58: error: unknown type name 'size_t'
    extern void* __KAI_KMPC_CONVENTION  omp_target_alloc(size_t, int);
                                                         ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:145:81: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_memcpy(void *, const void *, size_t, size_t, size_t, int, int);
                                                                                ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:145:89: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_memcpy(void *, const void *, size_t, size_t, size_t, int, int);
                                                                                        ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:145:97: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_memcpy(void *, const void *, size_t, size_t, size_t, int, int);
                                                                                                ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:146:86: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_memcpy_rect(void *, const void *, size_t, int, const size_t *,
                                                                                     ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:146:105: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_memcpy_rect(void *, const void *, size_t, int, const size_t *,
                                                                                                        ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:147:51: error: unknown type name 'size_t'
                                            const size_t *, const size_t *, const size_t *, const size_t *, int, int);
                                                  ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:147:67: error: unknown type name 'size_t'
                                            const size_t *, const size_t *, const size_t *, const size_t *, int, int);
                                                                  ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:147:83: error: unknown type name 'size_t'
                                            const size_t *, const size_t *, const size_t *, const size_t *, int, int);
                                                                                  ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:147:99: error: unknown type name 'size_t'
                                            const size_t *, const size_t *, const size_t *, const size_t *, int, int);
                                                                                                  ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:148:94: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_associate_ptr(const void *, const void *, size_t, size_t, int);
                                                                                             ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:148:102: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_associate_ptr(const void *, const void *, size_t, size_t, int);
                                                                                                     ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:231:88: error: unknown type name 'size_t'
    extern int    __KAI_KMPC_CONVENTION  omp_target_memcpy_async(void *, const void *, size_t, size_t, size_t, int,
                                                                                       ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[1]: *** [CMakeFiles/cmTC_1da41.dir/build.make:79: CMakeFiles/cmTC_1da41.dir/OpenMPTryFlag.cpp.o] Error 1
make[1]: Leaving directory '/build/test/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_1da41/fast] Error 2



Detecting CXX OpenMP failed with the following output:
Change Dir: /build/test/build/CMakeFiles/CMakeTmp

Run Build Command(s):/nix/store/is8wg3j77z9ndpsvkm85sfbrlvvqd66l-gnumake-4.3/bin/make -f Makefile cmTC_c5a63/fast && /nix/store/is8wg3j77z9ndpsvkm85sfbrlvvqd66l-gnumake-4.3/bin/make  -f CMakeFiles/cmTC_c5a63.dir/build.make CMakeFiles/cmTC_c5a63.dir/build
make[1]: Entering directory '/build/test/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_c5a63.dir/OpenMPTryFlag.cpp.o
/nix/store/09vrbabr36jg49s3s4hfs5d0gx9mm3lc-clang-wrapper-13.0.0/bin/clang++   -fopenmp -v -MD -MT CMakeFiles/cmTC_c5a63.dir/OpenMPTryFlag.cpp.o -MF CMakeFiles/cmTC_c5a63.dir/OpenMPTryFlag.cpp.o.d -o CMakeFiles/cmTC_c5a63.dir/OpenMPTryFlag.cpp.o -c /build/test/build/CMakeFiles/FindOpenMP/OpenMPTryFlag.cpp
clang version 13.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /nix/store/9k6x3pif7fq745rqx295mwn94z9slx6n-clang-13.0.0/bin
Found candidate GCC installation: /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib/gcc/x86_64-unknown-linux-gnu/10.3.0
Found candidate GCC installation: /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0
Selected GCC installation: /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
 (in-process)
 "/nix/store/9k6x3pif7fq745rqx295mwn94z9slx6n-clang-13.0.0/bin/clang-13" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj --mrelax-relocations -disable-free -disable-llvm-verifier -discard-value-names -main-file-name OpenMPTryFlag.cpp -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=none -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -v -fcoverage-compilation-dir=/build/test/build/CMakeFiles/CMakeTmp -nostdsysteminc -resource-dir /nix/store/09vrbabr36jg49s3s4hfs5d0gx9mm3lc-clang-wrapper-13.0.0/resource-root -dependency-file CMakeFiles/cmTC_c5a63.dir/OpenMPTryFlag.cpp.o.d -MT CMakeFiles/cmTC_c5a63.dir/OpenMPTryFlag.cpp.o -sys-header-deps -idirafter /nix/store/vccvfa5bjb9dv4x6zq5gjf1yp58y4brg-glibc-2.33-108-dev/include -isystem /nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include -isystem /nix/store/6pg9132gkwqdpgpymf422igx98ffy7sl-libcxxabi-13.0.0-dev/include -isystem /nix/store/kqi2m0f8g3p4ylk8ja76wk61i53gqgqm-compiler-rt-libc-13.0.0-dev/include -isystem /nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include -isystem /nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include -isystem /nix/store/6pg9132gkwqdpgpymf422igx98ffy7sl-libcxxabi-13.0.0-dev/include -isystem /nix/store/kqi2m0f8g3p4ylk8ja76wk61i53gqgqm-compiler-rt-libc-13.0.0-dev/include -isystem /nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include -isystem /nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1 -D _FORTIFY_SOURCE=2 -internal-isystem /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0 -internal-isystem /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0/x86_64-unknown-linux-gnu -internal-isystem /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0/backward -internal-isystem /nix/store/09vrbabr36jg49s3s4hfs5d0gx9mm3lc-clang-wrapper-13.0.0/resource-root/include -O2 -Wformat -Wformat-security -Werror=format-security -fdeprecated-macro -fdebug-compilation-dir=/build/test/build/CMakeFiles/CMakeTmp -ferror-limit 19 -fopenmp -fwrapv -stack-protector 2 -stack-protector-buffer-size 4 -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -vectorize-loops -vectorize-slp -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_c5a63.dir/OpenMPTryFlag.cpp.o -x c++ /build/test/build/CMakeFiles/FindOpenMP/OpenMPTryFlag.cpp
clang -cc1 version 13.0.0 based upon LLVM 13.0.0 default target x86_64-unknown-linux-gnu
ignoring duplicate directory "/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include"
ignoring duplicate directory "/nix/store/6pg9132gkwqdpgpymf422igx98ffy7sl-libcxxabi-13.0.0-dev/include"
ignoring duplicate directory "/nix/store/kqi2m0f8g3p4ylk8ja76wk61i53gqgqm-compiler-rt-libc-13.0.0-dev/include"
ignoring duplicate directory "/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include"
#include "..." search starts here:
#include <...> search starts here:
 /nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include
 /nix/store/6pg9132gkwqdpgpymf422igx98ffy7sl-libcxxabi-13.0.0-dev/include
 /nix/store/kqi2m0f8g3p4ylk8ja76wk61i53gqgqm-compiler-rt-libc-13.0.0-dev/include
 /nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include
 /nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1
 /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0
 /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0/x86_64-unknown-linux-gnu
 /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0/backward
 /nix/store/09vrbabr36jg49s3s4hfs5d0gx9mm3lc-clang-wrapper-13.0.0/resource-root/include
 /nix/store/vccvfa5bjb9dv4x6zq5gjf1yp58y4brg-glibc-2.33-108-dev/include
End of search list.
In file included from /build/test/build/CMakeFiles/FindOpenMP/OpenMPTryFlag.cpp:2:
In file included from /nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:18:
/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1/stdlib.h:142:34: error: unknown type name 'ldiv_t'
inline _LIBCPP_INLINE_VISIBILITY ldiv_t div(long __x, long __y) _NOEXCEPT {
                                 ^
/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1/stdlib.h:143:12: error: no member named 'ldiv' in the global namespace
  return ::ldiv(__x, __y);
         ~~^
/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1/stdlib.h:146:34: error: unknown type name 'lldiv_t'
inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x,
                                 ^
/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1/stdlib.h:148:12: error: no member named 'lldiv' in the global namespace
  return ::lldiv(__x, __y);
         ~~^
In file included from /build/test/build/CMakeFiles/FindOpenMP/OpenMPTryFlag.cpp:2:
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:142:58: error: use of undeclared identifier 'size_t'; did you mean 'std::size_t'?
    extern void* __KAI_KMPC_CONVENTION  omp_target_alloc(size_t, int);
                                                         ^
/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1/cstdlib:99:9: note: 'std::size_t' declared here
using ::size_t _LIBCPP_USING_IF_EXISTS;
        ^
In file included from /build/test/build/CMakeFiles/FindOpenMP/OpenMPTryFlag.cpp:2:
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:142:58: error: reference to unresolved using declaration
    extern void* __KAI_KMPC_CONVENTION  omp_target_alloc(size_t, int);
                                                         ^
/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1/cstdlib:99:1: note: using declaration annotated with 'using_if_exists' here
using ::size_t _LIBCPP_USING_IF_EXISTS;
^
In file included from /build/test/build/CMakeFiles/FindOpenMP/OpenMPTryFlag.cpp:2:
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:142:58: error: unknown type name 'size_t'
    extern void* __KAI_KMPC_CONVENTION  omp_target_alloc(size_t, int);
                                                         ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:145:81: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_memcpy(void *, const void *, size_t, size_t, size_t, int, int);
                                                                                ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:145:89: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_memcpy(void *, const void *, size_t, size_t, size_t, int, int);
                                                                                        ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:145:97: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_memcpy(void *, const void *, size_t, size_t, size_t, int, int);
                                                                                                ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:146:86: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_memcpy_rect(void *, const void *, size_t, int, const size_t *,
                                                                                     ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:146:105: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_memcpy_rect(void *, const void *, size_t, int, const size_t *,
                                                                                                        ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:147:51: error: unknown type name 'size_t'
                                            const size_t *, const size_t *, const size_t *, const size_t *, int, int);
                                                  ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:147:67: error: unknown type name 'size_t'
                                            const size_t *, const size_t *, const size_t *, const size_t *, int, int);
                                                                  ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:147:83: error: unknown type name 'size_t'
                                            const size_t *, const size_t *, const size_t *, const size_t *, int, int);
                                                                                  ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:147:99: error: unknown type name 'size_t'
                                            const size_t *, const size_t *, const size_t *, const size_t *, int, int);
                                                                                                  ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:148:94: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_associate_ptr(const void *, const void *, size_t, size_t, int);
                                                                                             ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:148:102: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_associate_ptr(const void *, const void *, size_t, size_t, int);
                                                                                                     ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:231:88: error: unknown type name 'size_t'
    extern int    __KAI_KMPC_CONVENTION  omp_target_memcpy_async(void *, const void *, size_t, size_t, size_t, int,
                                                                                       ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[1]: *** [CMakeFiles/cmTC_c5a63.dir/build.make:79: CMakeFiles/cmTC_c5a63.dir/OpenMPTryFlag.cpp.o] Error 1
make[1]: Leaving directory '/build/test/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_c5a63/fast] Error 2



Detecting CXX OpenMP failed with the following output:
Change Dir: /build/test/build/CMakeFiles/CMakeTmp

Run Build Command(s):/nix/store/is8wg3j77z9ndpsvkm85sfbrlvvqd66l-gnumake-4.3/bin/make -f Makefile cmTC_d7eb1/fast && /nix/store/is8wg3j77z9ndpsvkm85sfbrlvvqd66l-gnumake-4.3/bin/make  -f CMakeFiles/cmTC_d7eb1.dir/build.make CMakeFiles/cmTC_d7eb1.dir/build
make[1]: Entering directory '/build/test/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_d7eb1.dir/OpenMPTryFlag.cpp.o
/nix/store/09vrbabr36jg49s3s4hfs5d0gx9mm3lc-clang-wrapper-13.0.0/bin/clang++   -Xclang -fopenmp -v -MD -MT CMakeFiles/cmTC_d7eb1.dir/OpenMPTryFlag.cpp.o -MF CMakeFiles/cmTC_d7eb1.dir/OpenMPTryFlag.cpp.o.d -o CMakeFiles/cmTC_d7eb1.dir/OpenMPTryFlag.cpp.o -c /build/test/build/CMakeFiles/FindOpenMP/OpenMPTryFlag.cpp
clang version 13.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /nix/store/9k6x3pif7fq745rqx295mwn94z9slx6n-clang-13.0.0/bin
Found candidate GCC installation: /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib/gcc/x86_64-unknown-linux-gnu/10.3.0
Found candidate GCC installation: /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0
Selected GCC installation: /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
 (in-process)
 "/nix/store/9k6x3pif7fq745rqx295mwn94z9slx6n-clang-13.0.0/bin/clang-13" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj --mrelax-relocations -disable-free -disable-llvm-verifier -discard-value-names -main-file-name OpenMPTryFlag.cpp -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=none -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -v -fcoverage-compilation-dir=/build/test/build/CMakeFiles/CMakeTmp -nostdsysteminc -resource-dir /nix/store/09vrbabr36jg49s3s4hfs5d0gx9mm3lc-clang-wrapper-13.0.0/resource-root -dependency-file CMakeFiles/cmTC_d7eb1.dir/OpenMPTryFlag.cpp.o.d -MT CMakeFiles/cmTC_d7eb1.dir/OpenMPTryFlag.cpp.o -sys-header-deps -idirafter /nix/store/vccvfa5bjb9dv4x6zq5gjf1yp58y4brg-glibc-2.33-108-dev/include -isystem /nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include -isystem /nix/store/6pg9132gkwqdpgpymf422igx98ffy7sl-libcxxabi-13.0.0-dev/include -isystem /nix/store/kqi2m0f8g3p4ylk8ja76wk61i53gqgqm-compiler-rt-libc-13.0.0-dev/include -isystem /nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include -isystem /nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include -isystem /nix/store/6pg9132gkwqdpgpymf422igx98ffy7sl-libcxxabi-13.0.0-dev/include -isystem /nix/store/kqi2m0f8g3p4ylk8ja76wk61i53gqgqm-compiler-rt-libc-13.0.0-dev/include -isystem /nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include -isystem /nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1 -D _FORTIFY_SOURCE=2 -internal-isystem /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0 -internal-isystem /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0/x86_64-unknown-linux-gnu -internal-isystem /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0/backward -internal-isystem /nix/store/09vrbabr36jg49s3s4hfs5d0gx9mm3lc-clang-wrapper-13.0.0/resource-root/include -O2 -Wformat -Wformat-security -Werror=format-security -fdeprecated-macro -fdebug-compilation-dir=/build/test/build/CMakeFiles/CMakeTmp -ferror-limit 19 -fwrapv -stack-protector 2 -stack-protector-buffer-size 4 -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -vectorize-loops -vectorize-slp -fopenmp -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_d7eb1.dir/OpenMPTryFlag.cpp.o -x c++ /build/test/build/CMakeFiles/FindOpenMP/OpenMPTryFlag.cpp
clang -cc1 version 13.0.0 based upon LLVM 13.0.0 default target x86_64-unknown-linux-gnu
ignoring duplicate directory "/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include"
ignoring duplicate directory "/nix/store/6pg9132gkwqdpgpymf422igx98ffy7sl-libcxxabi-13.0.0-dev/include"
ignoring duplicate directory "/nix/store/kqi2m0f8g3p4ylk8ja76wk61i53gqgqm-compiler-rt-libc-13.0.0-dev/include"
ignoring duplicate directory "/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include"
#include "..." search starts here:
#include <...> search starts here:
 /nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include
 /nix/store/6pg9132gkwqdpgpymf422igx98ffy7sl-libcxxabi-13.0.0-dev/include
 /nix/store/kqi2m0f8g3p4ylk8ja76wk61i53gqgqm-compiler-rt-libc-13.0.0-dev/include
 /nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include
 /nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1
 /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0
 /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0/x86_64-unknown-linux-gnu
 /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0/backward
 /nix/store/09vrbabr36jg49s3s4hfs5d0gx9mm3lc-clang-wrapper-13.0.0/resource-root/include
 /nix/store/vccvfa5bjb9dv4x6zq5gjf1yp58y4brg-glibc-2.33-108-dev/include
End of search list.
In file included from /build/test/build/CMakeFiles/FindOpenMP/OpenMPTryFlag.cpp:2:
In file included from /nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:18:
/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1/stdlib.h:142:34: error: unknown type name 'ldiv_t'
inline _LIBCPP_INLINE_VISIBILITY ldiv_t div(long __x, long __y) _NOEXCEPT {
                                 ^
/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1/stdlib.h:143:12: error: no member named 'ldiv' in the global namespace
  return ::ldiv(__x, __y);
         ~~^
/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1/stdlib.h:146:34: error: unknown type name 'lldiv_t'
inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x,
                                 ^
/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1/stdlib.h:148:12: error: no member named 'lldiv' in the global namespace
  return ::lldiv(__x, __y);
         ~~^
In file included from /build/test/build/CMakeFiles/FindOpenMP/OpenMPTryFlag.cpp:2:
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:142:58: error: use of undeclared identifier 'size_t'; did you mean 'std::size_t'?
    extern void* __KAI_KMPC_CONVENTION  omp_target_alloc(size_t, int);
                                                         ^
/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1/cstdlib:99:9: note: 'std::size_t' declared here
using ::size_t _LIBCPP_USING_IF_EXISTS;
        ^
In file included from /build/test/build/CMakeFiles/FindOpenMP/OpenMPTryFlag.cpp:2:
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:142:58: error: reference to unresolved using declaration
    extern void* __KAI_KMPC_CONVENTION  omp_target_alloc(size_t, int);
                                                         ^
/nix/store/ydb1lxv6wx9sc7zdnb5rvrcld9ylkqj1-libcxx-13.0.0-dev/include/c++/v1/cstdlib:99:1: note: using declaration annotated with 'using_if_exists' here
using ::size_t _LIBCPP_USING_IF_EXISTS;
^
In file included from /build/test/build/CMakeFiles/FindOpenMP/OpenMPTryFlag.cpp:2:
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:142:58: error: unknown type name 'size_t'
    extern void* __KAI_KMPC_CONVENTION  omp_target_alloc(size_t, int);
                                                         ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:145:81: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_memcpy(void *, const void *, size_t, size_t, size_t, int, int);
                                                                                ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:145:89: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_memcpy(void *, const void *, size_t, size_t, size_t, int, int);
                                                                                        ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:145:97: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_memcpy(void *, const void *, size_t, size_t, size_t, int, int);
                                                                                                ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:146:86: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_memcpy_rect(void *, const void *, size_t, int, const size_t *,
                                                                                     ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:146:105: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_memcpy_rect(void *, const void *, size_t, int, const size_t *,
                                                                                                        ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:147:51: error: unknown type name 'size_t'
                                            const size_t *, const size_t *, const size_t *, const size_t *, int, int);
                                                  ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:147:67: error: unknown type name 'size_t'
                                            const size_t *, const size_t *, const size_t *, const size_t *, int, int);
                                                                  ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:147:83: error: unknown type name 'size_t'
                                            const size_t *, const size_t *, const size_t *, const size_t *, int, int);
                                                                                  ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:147:99: error: unknown type name 'size_t'
                                            const size_t *, const size_t *, const size_t *, const size_t *, int, int);
                                                                                                  ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:148:94: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_associate_ptr(const void *, const void *, size_t, size_t, int);
                                                                                             ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:148:102: error: unknown type name 'size_t'
    extern int   __KAI_KMPC_CONVENTION  omp_target_associate_ptr(const void *, const void *, size_t, size_t, int);
                                                                                                     ^
/nix/store/ka2b8sn31b3msfcwsfc2s6ca84p940yb-openmp-13.0.0/include/omp.h:231:88: error: unknown type name 'size_t'
    extern int    __KAI_KMPC_CONVENTION  omp_target_memcpy_async(void *, const void *, size_t, size_t, size_t, int,
                                                                                       ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[1]: *** [CMakeFiles/cmTC_d7eb1.dir/build.make:79: CMakeFiles/cmTC_d7eb1.dir/OpenMPTryFlag.cpp.o] Error 1
make[1]: Leaving directory '/build/test/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_d7eb1/fast] Error 2

Expected behavior

It compiles.

Screenshots

N/A

Additional context

Discourse reference: https://discourse.nixos.org/t/cmake-is-unable-to-find-openmp-from-llvmpackages-13/17679

Notify maintainers

@lovek323 @7c6f434c @dtzWill @primeos

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

  • system: "x86_64-linux"
  • host os: Linux 5.4.0-97-generic, Ubuntu, 20.04.4 LTS (Focal Fossa)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.4
  • channels(root): "nixpkgs"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixpkgs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions