Skip to content

Commit d754ce7

Browse files
ghegotqchen
authored andcommitted
Fixed OpenMP installation on MacOSX with gcc-6 (dmlc#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)
1 parent 93e8513 commit d754ce7

File tree

3 files changed

+9
-29
lines changed

3 files changed

+9
-29
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,18 @@ include $(XGB_PLUGINS)
3333

3434
# use customized config file
3535
ifndef CC
36-
export CC = $(if $(shell which gcc-5),gcc-5,gcc)
36+
export CC = $(if $(shell which gcc-6),gcc-6,gcc)
3737
endif
3838
ifndef CXX
39-
export CXX = $(if $(shell which g++-5),g++-5,g++)
39+
export CXX = $(if $(shell which g++-6),g++-6,g++)
4040
endif
4141

42-
# on Mac OS X, force brew gcc-5, since the Xcode c++ fails anyway
42+
# on Mac OS X, force brew gcc-6, since the Xcode c++ fails anyway
4343
# it is useful for pip install compiling-on-the-fly
4444
OS := $(shell uname)
4545
ifeq ($(OS), Darwin)
46-
export CC = $(if $(shell which gcc-5),gcc-5,clang)
47-
export CXX = $(if $(shell which g++-5),g++-5,clang++)
46+
export CC = $(if $(shell which gcc-6),gcc-6,clang)
47+
export CXX = $(if $(shell which g++-6),g++-6,clang++)
4848
endif
4949

5050
export LDFLAGS= -pthread -lm $(ADD_LDFLAGS) $(DMLC_LDFLAGS) $(PLUGIN_LDFLAGS)

doc/build.md

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -69,35 +69,15 @@ See the following paragraph for OpenMP enabled xgboost.
6969

7070

7171
Here is the complete solution to use OpenMP-enabled compilers to install XGBoost.
72-
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)
72+
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)
7373

7474
Now, clone the repository
7575

7676
```bash
7777
git clone --recursive https://github.com/dmlc/xgboost
7878
```
7979

80-
The next step is to update the compliers in xgboost's configuration file
81-
82-
```bash
83-
cd xgboost
84-
```
85-
86-
Open make/config.mk file and replace the following two lines
87-
88-
```bash
89-
export CC = gcc
90-
export CXX = g++
91-
```
92-
93-
with
94-
95-
```bash
96-
export CC = gcc-5
97-
export CXX = g++-5
98-
```
99-
100-
Now, build using the following commands
80+
and build using the following commands
10181

10282
```bash
10383
cd ..; cp make/config.mk ./config.mk; make -j4

make/config.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
#
44
# If you want to change the configuration, please use the following
55
# steps. Assume you are on the root directory of xgboost.
6-
# First copy the this file so that any local changes will be ignored by git
6+
# First copy this file so that any local changes will be ignored by git
77
#
88
# $ cp make/config.mk .
99
#
10-
# Next modify the according entries, and then compile by
10+
# Next modify the according entries in the copied file and then compile by
1111
#
1212
# $ make
1313
#

0 commit comments

Comments
 (0)