1

I'm trying to run this cmake file on windows

cmake_minimum_required(VERSION 3.8) set(CMAKE_C_COMPILER "C:/Program Files/LLVM/bin/clang") set(CMAKE_CXX_COMPILER "C:/Program Files/LLVM/bin/clang++") set(OPENMP_LIBRARIES "C:/Program Files/LLVM/lib") set(OPENMP_INCLUDES "C:/Program Files/LLVM/include") set(OpenMP_C "${CMAKE_C_COMPILER}") set(OpenMP_C_FLAGS "-fopenmp=libomp -Wno-unused-command-line-argument") set(OpenMP_C_LIB_NAMES "libomp" "libgomp" "libiomp5") set(OpenMP_libomp_LIBRARY ${OpenMP_C_LIB_NAMES}) set(OpenMP_libgomp_LIBRARY ${OpenMP_C_LIB_NAMES}) set(OpenMP_libiomp5_LIBRARY ${OpenMP_C_LIB_NAMES}) set(OpenMP_CXX "${CMAKE_CXX_COMPILER}") set(OpenMP_CXX_FLAGS "-fopenmp=libomp -Wno-unused-command-line-argument") set(OpenMP_CXX_LIB_NAMES "libomp" "libgomp" "libiomp5") set(OpenMP_libomp_LIBRARY ${OpenMP_CXX_LIB_NAMES}) set(OpenMP_libgomp_LIBRARY ${OpenMP_CXX_LIB_NAMES}) set(OpenMP_libiomp5_LIBRARY ${OpenMP_CXX_LIB_NAMES}) message("!!!!!!!!!!!!!!!! " ${OpenMP_C_FLAGS} ) find_package(OpenMP REQUIRED) 

With this command line parameters:

cmake -G"Visual Studio 15 2017" -T LLVM ..

It is strange that I get the fallowing error even if OpenMP_C_FLAGS is defined according to the output:

-- The C compiler identification is Clang 9.0.0 -- The CXX compiler identification is Clang 9.0.0 -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done !!!!!!!!!!!!!!!! -fopenmp=libomp -Wno-unused-command-line-argument CMake Error at C:/Program Files/CMake/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS) Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE) C:/Program Files/CMake/share/cmake-3.13/Modules/FindOpenMP.cmake:473 (find_package_handle_standard_args) CMakeLists.txt:25 (find_package) -- Configuring incomplete, errors occurred! 

If I run cmake without -T LLVM flag, then cmake FindOpenMP.cmake runs fine (uses windows compiler). clang doesn't support openmp on windows ?

2
  • Explanation of missing: OpenMP_C_FLAGS in CMake output: This phrase means that corresponded FindXXX.cmake script (FindOpenMP.cmake in your case) has been failed to assign the variable an appropriate value. This message does not imply that a user may set the variable for help the script. (Well, sometimes a user-specified variable works, but not in the given case). Commented Feb 18, 2019 at 22:22
  • There is a similar question on SO that I answered here. It looks like this may help in your situation. Commented Oct 12, 2019 at 17:33

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.