Skip to content

Commit

Permalink
updated installation instructions based on comments
Browse files Browse the repository at this point in the history
  • Loading branch information
imatiach-msft committed Feb 12, 2019
1 parent 09e1661 commit 06775c4
Showing 1 changed file with 67 additions and 8 deletions.
75 changes: 67 additions & 8 deletions docs/Installation-Guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -671,20 +671,79 @@ On Linux Java wrapper of LightGBM can be built using **Java**, **SWIG**, **CMake
make -j4
macOS
^^^^^
~~~~~

On macOS Java wrapper of LightGBM can be build using **Java**, **SWIG**, **CMake** and **gcc** or **Apple Clang**
On macOS Java wrapper of LightGBM can be built using **Java**, **SWIG**, **CMake** and **Apple Clang** or **gcc**.

1. Install `CMake`_, `SWIG`_ and **Java** (also make sure that ``JAVA_HOME`` is set properly).
First, install `SWIG`_ and **Java** (also make sure that ``JAVA_HOME`` is set properly).
Then, either follow the **Apple Clang** or **gcc** installation instructions below.

2. Run the following commands:
Apple Clang
^^^^^^^^^^^

Only **Apple Clang** version 8.1 or higher is supported.

1. Install `CMake`_ (3.12 or higher):

.. code::
brew install cmake
2. Install **OpenMP**:

.. code::
git clone --recursive https://github.com/Microsoft/LightGBM ; cd LightGBM
mkdir build ; cd build
cmake -DUSE_SWIG=ON -DAPPLE_OUTPUT_DYLIB=ON ..
make -j4
brew install libomp
3. Run the following commands:

.. code::
git clone --recursive https://github.com/Microsoft/LightGBM ; cd LightGBM
mkdir build ; cd build
# For Mojave (10.14)
cmake \
-DUSE_SWIG=ON \
-DAPPLE_OUTPUT_DYLIB=ON \
-DOpenMP_C_FLAGS="-Xpreprocessor -fopenmp -I$(brew --prefix libomp)/include" \
-DOpenMP_C_LIB_NAMES="omp" \
-DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp -I$(brew --prefix libomp)/include" \
-DOpenMP_CXX_LIB_NAMES="omp" \
-DOpenMP_omp_LIBRARY=$(brew --prefix libomp)/lib/libomp.dylib \
..
# For High Sierra or earlier (<= 10.13)
cmake -DUSE_SWIG=ON -DAPPLE_OUTPUT_DYLIB=ON ..
make -j4
gcc
^^^

1. Install `CMake`_ (3.2 or higher):

.. code::
brew install cmake
2. Install **gcc**:

.. code::
brew install gcc
3. Run the following commands:

.. code::
git clone --recursive https://github.com/Microsoft/LightGBM ; cd LightGBM
export CXX=g++-7 CC=gcc-7 # replace "7" with version of gcc installed on your machine
mkdir build ; cd build
cmake -DUSE_SWIG=ON -DAPPLE_OUTPUT_DYLIB=ON ..
make -j4
Also, you may want to read `gcc Tips <./gcc-Tips.rst>`__.


.. |download artifacts| image:: ./_static/images/artifacts-not-available.svg
Expand Down

0 comments on commit 06775c4

Please sign in to comment.