Hello, I encountered the same problem as two days ago.
The error : Compiler must support OpenMP 4.0 or later with Kokkos_ENABLE_OPENMP
Last time I solved this by upgrading my ubuntu system, but now I am trying to install this KOKKOS package on supercomputer, so cannot upgrade this system, can only load module.
I tried two commands but yielding the same error,
- cmake -C …/cmake/presets/basic.cmake -C …/cmake/presets/kokkos-openmp.cmake …/cmake
- cmake -C …/cmake/presets/kokkos-openmp.cmake -D Kokkos_ARCH_HSW=yes -D Kokkos_ENABLE_OPENMP=yes -D BUILD_OMP=yes …/cmake
The output is shown below.
loading initial cache file …/cmake/presets/basic.cmake
loading initial cache file …/cmake/presets/kokkos-openmp.cmake
– The CXX compiler identification is GNU 6.5.0
– Check for working CXX compiler: /app/gcc/6.5.0/bin/c++
– Check for working CXX compiler: /app/gcc/6.5.0/bin/c++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– Found Git: /usr/bin/git (found version “1.7.1”)
– Appending /app/gcc/SCILibs/lib:/app/gcc/SCILibs/lib64:/app/isl/0.14/lib:/app/mpc/1.0.3/lib:/app/mpfr/3.1.4/lib:/app/gmp/6.1.0/lib to CMAKE_LIBRARY_PATH: /app/gcc/SCILibs/lib:/app/gcc/SCILibs/lib64:/app/isl/0.14/lib:/app/mpc/1.0.3/lib:/app/mpfr/3.1.4/lib:/app/gmp/6.1.0/lib
– Running check for auto-generated files from make-based build system
– Looking for C++ include omp.h
– Looking for C++ include omp.h - found
– Found OpenMP_CXX: -fopenmp (found version “4.5”)
– Found OpenMP: TRUE (found version “4.5”)
– Found JPEG: /usr/lib64/libjpeg.so (found version “62”)
– Found GZIP: /bin/gzip
– Could NOT find FFMPEG (missing: FFMPEG_EXECUTABLE)
– Found PkgConfig: /usr/bin/pkg-config (found version “0.23”)
– Checking for module ‘fftw3’
– Found fftw3, version 3.2.1
– Found FFTW3: /usr/lib64/libfftw3.so
– Looking for C++ include cmath
– Looking for C++ include cmath - found
CMake Error at Modules/Packages/KOKKOS.cmake:19 (message):
Compiler must support OpenMP 4.0 or later with Kokkos_ENABLE_OPENMP
Call Stack (most recent call first):
CMakeLists.txt:638 (include)
I loaded several modules as the below picture,
And complier versions of limited number are available on supercomputer, as the below picture.
I have noticed on the gcc wiki, they says:
GCC 4.9 supports OpenMP 4.0 for C/C++, GCC 4.9.1 also for Fortran. GCC 5 adds support for Offloading. OpenMP 4.5 is supported for C/C++ since GCC 6 and since GCC 7 for Fortran (with omissions, largest missing item is structure element mapping).
So I don’t know what’s wrong with the current version of gcc/4.9.3. Could you help me?