OpenMP 3.0 기능이 필요하기 때문에 Visual Studio 2015에서 clang 5.0.0을 사용하려고합니다. 것을, 지금 또는 툴체인 LLVM-vs2014
없이 MSVC 14 2015 Win64
빌드를 구성하려고하면MSVC에서 OpenMP를 사용하여 clang을 얻는 방법 2015
cmake_minimum_required(VERSION 2.8.10)
project(myproject)
find_package(OpenMP)
if (OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
include_directories("include")
add_library(libFoo STATIC Foo.cpp)
install(TARGETS Foo libFoo LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
난 항상 오류를 얻을 : 나는 (어떤 OpenMP를 지원하지 않습니다하지 vs2015 버전) 그 소리 컴파일러와 사용 cmake를 설치 OpenMP를 찾을 수 없습니다 :
이The C compiler identification is Clang 5.0.0
The CXX compiler identification is Clang 5.0.0
Check for working C compiler: D:/Program Files/LLVM/msbuild-bin/cl.exe
Check for working C compiler: D:/Program Files/LLVM/msbuild-bin/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: D:/Program Files/LLVM/msbuild-bin/cl.exe
Check for working CXX compiler: D:/Program Files/LLVM/msbuild-bin/cl.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES) (found version "1.0")
Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES) (found version "1.0")
Configuring done
사용 된 컴파일러는 오른쪽에 하나 (설치된 그 소리가 아닌 Microsoft 버전) 것 같다, 그것은 그 소리-CL 바이너리를 자동 감지하지만, OpenMP는 실패합니다. "네이티브 컴파일러 지정"을 사용하여 수동으로 컴파일러를 지정하고 동일한 결과를 얻으려고했습니다. 심지어 clang ++ 대신 clang-cl 버전을 선택합니다. 문제가 해결되지 않을
관련 대답 :
- Compiling C code with openmp using clang-cl - 최근 그 소리는 libomp.lib을 가지고 있으며, libiomp5.dll는 그것은 cmake 자동 감지 아무튼 정말 조금 까다 롭습니다 및