Commit d51f2b4f authored by Nikita Titov's avatar Nikita Titov Committed by Guolin Ke
Browse files

[ci] [docs] compilation on macOS (#1088)

* updated travis

* renamed OSX->macOS; updated gcc installation on macOS

* updated travis macos installation

 Please enter the commit message for your changes. Lines starting

* updated installation guide for macos

* fixed spelling

* renamed appveyor file

* updated Travis
parent e951a3d7
#!/bin/bash #!/bin/bash
if [[ $TRAVIS_OS_NAME == "osx" ]]; then if [[ $TRAVIS_OS_NAME == "osx" ]]; then
brew install gcc --without-multilib if [[ ${TASK} == "mpi" ]]; then
brew install openmpi brew install open-mpi
else
brew install gcc
fi
brew link --overwrite gcc
wget -O conda.sh https://repo.continuum.io/miniconda/Miniconda${PYTHON_VERSION:0:1}-latest-MacOSX-x86_64.sh wget -O conda.sh https://repo.continuum.io/miniconda/Miniconda${PYTHON_VERSION:0:1}-latest-MacOSX-x86_64.sh
else else
if [[ ${TASK} != "pylint" ]] && [[ ${TASK} != "check-docs" ]]; then if [[ ${TASK} != "pylint" ]] && [[ ${TASK} != "check-docs" ]]; then
......
...@@ -21,7 +21,7 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") ...@@ -21,7 +21,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 wasn't supported. Please see https://github.com/Microsoft/LightGBM/blob/master/docs/Installation-Guide.rst#osx") message(FATAL_ERROR "AppleClang wasn't supported. Please see https://github.com/Microsoft/LightGBM/blob/master/docs/Installation-Guide.rst#macos")
endif() endif()
if(APPLE) if(APPLE)
......
...@@ -22,9 +22,9 @@ For users who wants to install online with GPU or want to choose a specific comp ...@@ -22,9 +22,9 @@ For users who wants to install online with GPU or want to choose a specific comp
**Warning for Windows users**: it is recommended to use *Visual Studio* for its better multi-threading efficency in Windows for many core systems. For very simple systems (dual core computers or worse), MinGW64 is recommended for maximum performance. If you do not know what to choose, it is recommended to use [Visual Studio](https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2017), the default compiler. **Do not try using MinGW in Windows on many core systems. It may result in 10x slower results than Visual Studio.** **Warning for Windows users**: it is recommended to use *Visual Studio* for its better multi-threading efficency in Windows for many core systems. For very simple systems (dual core computers or worse), MinGW64 is recommended for maximum performance. If you do not know what to choose, it is recommended to use [Visual Studio](https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2017), the default compiler. **Do not try using MinGW in Windows on many core systems. It may result in 10x slower results than Visual Studio.**
#### Mac OS X Preparation #### macOS Preparation
gcc with OpenMP support must be installed first. Refer to [Installation-Guide](https://github.com/Microsoft/LightGBM/blob/master/docs/Installation-Guide.rst#osx) for installing gcc with OpenMP support. gcc with OpenMP support must be installed first. Refer to [Installation-Guide](https://github.com/Microsoft/LightGBM/blob/master/docs/Installation-Guide.rst#macos) for installing gcc with OpenMP support.
### Install ### Install
...@@ -33,7 +33,7 @@ Install LightGBM R-package with the following command: ...@@ -33,7 +33,7 @@ Install LightGBM R-package with the following command:
```sh ```sh
git clone --recursive https://github.com/Microsoft/LightGBM git clone --recursive https://github.com/Microsoft/LightGBM
cd LightGBM/R-package cd LightGBM/R-package
# export CXX=g++-7 CC=gcc-7 # for OSX # export CXX=g++-7 CC=gcc-7 # for macOS
R CMD INSTALL --build . --no-multiarch R CMD INSTALL --build . --no-multiarch
``` ```
...@@ -43,7 +43,7 @@ Or build a self-contained R package which can be installed afterwards: ...@@ -43,7 +43,7 @@ Or build a self-contained R package which can be installed afterwards:
git clone --recursive https://github.com/Microsoft/LightGBM git clone --recursive https://github.com/Microsoft/LightGBM
cd LightGBM/R-package cd LightGBM/R-package
Rscript build_package.R Rscript build_package.R
# export CXX=g++-7 CC=gcc-7 # for OSX # export CXX=g++-7 CC=gcc-7 # for macOS
R CMD INSTALL lightgbm_2.0.4.tar.gz --no-multiarch R CMD INSTALL lightgbm_2.0.4.tar.gz --no-multiarch
``` ```
......
...@@ -7,7 +7,7 @@ This directory contains `Dockerfile` to make it easy to build and run LightGBM v ...@@ -7,7 +7,7 @@ This directory contains `Dockerfile` to make it easy to build and run LightGBM v
Follow the general installation instructions Follow the general installation instructions
[on the Docker site](https://docs.docker.com/installation/): [on the Docker site](https://docs.docker.com/installation/):
* [OSX](https://docs.docker.com/installation/mac/): [docker toolbox](https://www.docker.com/toolbox) * [macOS](https://docs.docker.com/installation/mac/): [docker toolbox](https://www.docker.com/toolbox)
* [Ubuntu](https://docs.docker.com/installation/ubuntulinux/) * [Ubuntu](https://docs.docker.com/installation/ubuntulinux/)
## Using CLI Version of LightGBM via Docker ## Using CLI Version of LightGBM via Docker
......
...@@ -68,7 +68,7 @@ Now we are ready to checkout LightGBM and compile it with GPU support: ...@@ -68,7 +68,7 @@ Now we are ready to checkout LightGBM and compile it with GPU support:
You will see two binaries are generated, ``lightgbm`` and ``lib_lightgbm.so``. You will see two binaries are generated, ``lightgbm`` and ``lib_lightgbm.so``.
If you are building on OSX, you probably need to remove macro ``BOOST_COMPUTE_USE_OFFLINE_CACHE`` in ``src/treelearner/gpu_tree_learner.h`` to avoid a known crash bug in Boost.Compute. If you are building on macOS, you probably need to remove macro ``BOOST_COMPUTE_USE_OFFLINE_CACHE`` in ``src/treelearner/gpu_tree_learner.h`` to avoid a known crash bug in Boost.Compute.
Install Python Interface (optional) Install Python Interface (optional)
----------------------------------- -----------------------------------
......
...@@ -84,8 +84,8 @@ LightGBM uses **CMake** to build. Run the following commands: ...@@ -84,8 +84,8 @@ LightGBM uses **CMake** to build. Run the following commands:
Also you may want to reed `gcc Tips <./gcc-Tips.rst>`__. Also you may want to reed `gcc Tips <./gcc-Tips.rst>`__.
OSX macOS
~~~ ~~~~~
LightGBM depends on **OpenMP** for compiling, which isn't supported by Apple Clang. LightGBM depends on **OpenMP** for compiling, which isn't supported by Apple Clang.
...@@ -94,7 +94,7 @@ Please install **gcc/g++** by using the following commands: ...@@ -94,7 +94,7 @@ Please install **gcc/g++** by using the following commands:
.. code:: .. code::
brew install cmake brew install cmake
brew install gcc --without-multilib brew install gcc
Then install LightGBM: Then install LightGBM:
...@@ -179,16 +179,15 @@ Then run the following commands: ...@@ -179,16 +179,15 @@ Then run the following commands:
**Note**: glibc >= 2.14 is required. **Note**: glibc >= 2.14 is required.
OSX macOS
^^^ ^^^^^
Install **gcc** and **Open MPI** first: Install **Open MPI** first:
.. code:: .. code::
brew install openmpi brew install open-mpi
brew install cmake brew install cmake
brew install gcc --without-multilib
Then run the following commands: Then run the following commands:
...@@ -227,7 +226,7 @@ To build LightGBM GPU version, run the following commands: ...@@ -227,7 +226,7 @@ To build LightGBM GPU version, run the following commands:
git clone --recursive https://github.com/Microsoft/LightGBM ; cd LightGBM git clone --recursive https://github.com/Microsoft/LightGBM ; cd LightGBM
mkdir build ; cd build mkdir build ; cd build
cmake -DUSE_GPU=1 .. cmake -DUSE_GPU=1 ..
# if you have installed the NVIDIA OpenGL, please using following instead # if you have installed the NVIDIA OpenGL, please use following command instead
# sudo cmake -DUSE_GPU=1 -DOpenCL_LIBRARY=/usr/local/cuda/lib64/libOpenCL.so -OpenCL_INCLUDE_DIR=/usr/local/cuda/include/ .. # sudo cmake -DUSE_GPU=1 -DOpenCL_LIBRARY=/usr/local/cuda/lib64/libOpenCL.so -OpenCL_INCLUDE_DIR=/usr/local/cuda/include/ ..
make -j4 make -j4
......
...@@ -11,7 +11,7 @@ Preparation ...@@ -11,7 +11,7 @@ Preparation
`setuptools <https://pypi.python.org/pypi/setuptools>`_ is needed. `setuptools <https://pypi.python.org/pypi/setuptools>`_ is needed.
For Mac OS X users, gcc with OpenMP support must be installed first. Refer to `Installation Guide <https://github.com/Microsoft/LightGBM/blob/master/docs/Installation-Guide.rst#osx>`__ for installing gcc with OpenMP support. For macOS users, gcc with OpenMP support must be installed first. Refer to `Installation Guide <https://github.com/Microsoft/LightGBM/blob/master/docs/Installation-Guide.rst#macos>`__ for installing gcc with OpenMP support.
Note: 32-bit Python is not supported. Please install 64-bit version. Note: 32-bit Python is not supported. Please install 64-bit version.
...@@ -32,9 +32,9 @@ Build from Sources ...@@ -32,9 +32,9 @@ Build from Sources
pip install --no-binary :all: lightgbm pip install --no-binary :all: lightgbm
For Linux and Mac OS X users, installation from sources requires installed `CMake <https://cmake.org/>`_. For Linux and macOS users, installation from sources requires installed `CMake <https://cmake.org/>`_.
For Mac OS X users, you need to specify compilers by runnig ``export CXX=g++-7 CC=gcc-7`` first. For macOS users, you need to specify compilers by runnig ``export CXX=g++-7 CC=gcc-7`` first.
For Windows users, Visual Studio (or `MS Build <https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2017>`_) is needed. If you get any errors during installation, you may need to install `CMake <https://cmake.org/>`_ (version 3.8 or higher). For Windows users, Visual Studio (or `MS Build <https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2017>`_) is needed. If you get any errors during installation, you may need to install `CMake <https://cmake.org/>`_ (version 3.8 or higher).
...@@ -61,7 +61,7 @@ Note: `CMake <https://cmake.org/>`_ and `MinGW-w64 <https://mingw-w64.org/>`_ sh ...@@ -61,7 +61,7 @@ Note: `CMake <https://cmake.org/>`_ and `MinGW-w64 <https://mingw-w64.org/>`_ sh
Install from GitHub Install from GitHub
''''''''''''''''''' '''''''''''''''''''
For Linux and Mac OS X users, installation from GitHub requires installed `CMake <https://cmake.org/>`_. For Linux and macOS users, installation from GitHub requires installed `CMake <https://cmake.org/>`_.
For Windows users, Visual Studio (or `MS Build <https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2017>`_) is needed. If you get any errors during installation and there is the warning ``WARNING:LightGBM:Compilation with MSBuild from existing solution file failed.`` in the log, you should install `CMake <https://cmake.org/>`_ (version 3.8 or higher). For Windows users, Visual Studio (or `MS Build <https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2017>`_) is needed. If you get any errors during installation and there is the warning ``WARNING:LightGBM:Compilation with MSBuild from existing solution file failed.`` in the log, you should install `CMake <https://cmake.org/>`_ (version 3.8 or higher).
...@@ -69,7 +69,7 @@ For Windows users, Visual Studio (or `MS Build <https://www.visualstudio.com/dow ...@@ -69,7 +69,7 @@ For Windows users, Visual Studio (or `MS Build <https://www.visualstudio.com/dow
git clone --recursive https://github.com/Microsoft/LightGBM.git git clone --recursive https://github.com/Microsoft/LightGBM.git
cd LightGBM/python-package cd LightGBM/python-package
# export CXX=g++-7 CC=gcc-7 # for Mac OS X users only # export CXX=g++-7 CC=gcc-7 # for macOS users only
python setup.py install python setup.py install
Note: ``sudo`` (or administrator rights in Windows) may be needed to perform the command. Note: ``sudo`` (or administrator rights in Windows) may be needed to perform the command.
......
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