Commit ce766adc authored by Qiwei Ye's avatar Qiwei Ye
Browse files

Merge commit 'refs/pull/1501/head' of https://github.com/Microsoft/LightGBM

parents ca30afe1 40b60eb4
if(MSVC)
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
cmake_minimum_required(VERSION 3.12)
elseif(MSVC)
cmake_minimum_required(VERSION 3.8)
elseif(USE_GPU OR APPLE)
cmake_minimum_required(VERSION 3.2)
......@@ -23,8 +25,6 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.8")
message(FATAL_ERROR "Insufficient Clang version")
endif()
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")
endif()
if(APPLE)
......@@ -183,6 +183,13 @@ if(USE_MPI)
TARGET_LINK_LIBRARIES(_lightgbm ${MPI_CXX_LIBRARIES})
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)
TARGET_LINK_LIBRARIES(lightgbm ${OpenCL_LIBRARY} ${Boost_LIBRARIES})
TARGET_LINK_LIBRARIES(_lightgbm ${OpenCL_LIBRARY} ${Boost_LIBRARIES})
......
......@@ -87,7 +87,25 @@ Also you may want to read `gcc Tips <./gcc-Tips.rst>`__.
macOS
~~~~~
LightGBM depends on **OpenMP** for compiling, which isn't supported by Apple Clang.
LightGBM can use Apple Clang (9.0 or higher), or GCC/G++ to build in macOS.
Apple Clang (9.0 or higher)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
1. Install `CMake`_ (3.12 or higher).
2. Run the following commands:
.. code::
brew install libomp
git clone --recursive https://github.com/Microsoft/LightGBM ; cd LightGBM
mkdir build ; cd build
cmake ..
make -j4
GCC/G++
^^^^^^^
Please install **gcc/g++** by using the following commands:
......@@ -330,7 +348,25 @@ LightGBM uses **CMake** to build. Run the following commands:
macOS
^^^^^
LightGBM depends on **OpenMP** for compiling, which isn't supported by Apple Clang.
LightGBM can use Apple Clang (9.0 or higher), or GCC/G++ to build in macOS.
Apple Clang (9.0 or higher)
***************************
1. Install `CMake`_ (3.12 or higher).
2. Run the following commands:
.. code::
brew install libomp
git clone --recursive https://github.com/Microsoft/LightGBM ; cd LightGBM
mkdir build ; cd build
cmake -DUSE_HDFS=ON ..
make -j4
GCC/G++
*******
Please install **gcc/g++** by using the following commands:
......
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