Commit d6bd3c21 authored by fanliwen's avatar fanliwen
Browse files

support AppleClang with openmp

https://github.com/Microsoft/LightGBM/issues/1492
parent 9187c75f
...@@ -24,7 +24,7 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") ...@@ -24,7 +24,7 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
message(FATAL_ERROR "Insufficient Clang version") message(FATAL_ERROR "Insufficient Clang version")
endif() endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
message(FATAL_ERROR "AppleClang isn't supported. Please see https://github.com/Microsoft/LightGBM/blob/master/docs/Installation-Guide.rst#macos") cmake_minimum_required(VERSION 3.12)
endif() endif()
if(APPLE) if(APPLE)
...@@ -183,6 +183,13 @@ if(USE_MPI) ...@@ -183,6 +183,13 @@ if(USE_MPI)
TARGET_LINK_LIBRARIES(_lightgbm ${MPI_CXX_LIBRARIES}) TARGET_LINK_LIBRARIES(_lightgbm ${MPI_CXX_LIBRARIES})
endif(USE_MPI) endif(USE_MPI)
if(USE_OPENMP)
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
TARGET_LINK_LIBRARIES(lightgbm ${OpenMP_libomp_LIBRARY})
TARGET_LINK_LIBRARIES(_lightgbm ${OpenMP_libomp_LIBRARY})
endif()
endif(USE_OPENMP)
if(USE_GPU) if(USE_GPU)
TARGET_LINK_LIBRARIES(lightgbm ${OpenCL_LIBRARY} ${Boost_LIBRARIES}) TARGET_LINK_LIBRARIES(lightgbm ${OpenCL_LIBRARY} ${Boost_LIBRARIES})
TARGET_LINK_LIBRARIES(_lightgbm ${OpenCL_LIBRARY} ${Boost_LIBRARIES}) TARGET_LINK_LIBRARIES(_lightgbm ${OpenCL_LIBRARY} ${Boost_LIBRARIES})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment