Fixed OpenMP installation on MacOSX with gcc-6 (#1460)
* Fixed OpenMP installation on MacOSX with gcc-6 - Modified makefile from gcc-5 to gcc-6 - Removed deprecated install instructions from doc (gcc-5 was automatically forced if available in makefile on OSX) * Fixed OpenMP installation on MacOSX with gcc-6 - Modified makefile from gcc-5 to gcc-6 - Removed deprecated install instructions from doc (gcc-5 was automatically forced if available in makefile on OSX)
This commit is contained in:
parent
93e85139bc
commit
d754ce7dc1
10
Makefile
10
Makefile
@ -33,18 +33,18 @@ include $(XGB_PLUGINS)
|
||||
|
||||
# use customized config file
|
||||
ifndef CC
|
||||
export CC = $(if $(shell which gcc-5),gcc-5,gcc)
|
||||
export CC = $(if $(shell which gcc-6),gcc-6,gcc)
|
||||
endif
|
||||
ifndef CXX
|
||||
export CXX = $(if $(shell which g++-5),g++-5,g++)
|
||||
export CXX = $(if $(shell which g++-6),g++-6,g++)
|
||||
endif
|
||||
|
||||
# on Mac OS X, force brew gcc-5, since the Xcode c++ fails anyway
|
||||
# on Mac OS X, force brew gcc-6, since the Xcode c++ fails anyway
|
||||
# it is useful for pip install compiling-on-the-fly
|
||||
OS := $(shell uname)
|
||||
ifeq ($(OS), Darwin)
|
||||
export CC = $(if $(shell which gcc-5),gcc-5,clang)
|
||||
export CXX = $(if $(shell which g++-5),g++-5,clang++)
|
||||
export CC = $(if $(shell which gcc-6),gcc-6,clang)
|
||||
export CXX = $(if $(shell which g++-6),g++-6,clang++)
|
||||
endif
|
||||
|
||||
export LDFLAGS= -pthread -lm $(ADD_LDFLAGS) $(DMLC_LDFLAGS) $(PLUGIN_LDFLAGS)
|
||||
|
||||
24
doc/build.md
24
doc/build.md
@ -69,7 +69,7 @@ See the following paragraph for OpenMP enabled xgboost.
|
||||
|
||||
|
||||
Here is the complete solution to use OpenMP-enabled compilers to install XGBoost.
|
||||
Obtain gcc-5.x.x with openmp support by `brew install gcc --without-multilib`. (`brew` is the de facto standard of `apt-get` on OS X. So installing [HPC](http://hpc.sourceforge.net/) separately is not recommended, but it should work.). Installation of `gcc` can take a while (~ 30 minutes)
|
||||
Obtain gcc-6.x.x with openmp support by `brew install gcc --without-multilib`. (`brew` is the de facto standard of `apt-get` on OS X. So installing [HPC](http://hpc.sourceforge.net/) separately is not recommended, but it should work.). Installation of `gcc` can take a while (~ 30 minutes)
|
||||
|
||||
Now, clone the repository
|
||||
|
||||
@ -77,27 +77,7 @@ Now, clone the repository
|
||||
git clone --recursive https://github.com/dmlc/xgboost
|
||||
```
|
||||
|
||||
The next step is to update the compliers in xgboost's configuration file
|
||||
|
||||
```bash
|
||||
cd xgboost
|
||||
```
|
||||
|
||||
Open make/config.mk file and replace the following two lines
|
||||
|
||||
```bash
|
||||
export CC = gcc
|
||||
export CXX = g++
|
||||
```
|
||||
|
||||
with
|
||||
|
||||
```bash
|
||||
export CC = gcc-5
|
||||
export CXX = g++-5
|
||||
```
|
||||
|
||||
Now, build using the following commands
|
||||
and build using the following commands
|
||||
|
||||
```bash
|
||||
cd ..; cp make/config.mk ./config.mk; make -j4
|
||||
|
||||
@ -3,11 +3,11 @@
|
||||
#
|
||||
# If you want to change the configuration, please use the following
|
||||
# steps. Assume you are on the root directory of xgboost.
|
||||
# First copy the this file so that any local changes will be ignored by git
|
||||
# First copy this file so that any local changes will be ignored by git
|
||||
#
|
||||
# $ cp make/config.mk .
|
||||
#
|
||||
# Next modify the according entries, and then compile by
|
||||
# Next modify the according entries in the copied file and then compile by
|
||||
#
|
||||
# $ make
|
||||
#
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user