diff --git a/Makefile b/Makefile index 3230661d4..7f3317cbc 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ export CC = gcc -export CXX = g++ +export CXX = clang++ export LDFLAGS= -pthread -lm export CFLAGS = -Wall -O3 -msse2 -Wno-unknown-pragmas -fPIC -pedantic diff --git a/README.md b/README.md index a2dc4fee1..d69189824 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Features Build ===== -* Simply type make +* Run ```bash build.sh``` (you can also type make) * If your compiler does not come with OpenMP support, it will fire an warning telling you that the code will compile into single thread mode, and you will get single thread xgboost * You may get a error: -lgomp is not found - You can type ```make no_omp=1```, this will get you single thread xgboost diff --git a/build.sh b/build.sh new file mode 100755 index 000000000..42109f5b3 --- /dev/null +++ b/build.sh @@ -0,0 +1,11 @@ +#!/bin/bash +if make; then + echo "Successfully build multi-thread xgboost" +else + echo "-----------------------------" + echo "Building multi-thread xgboost failed" + echo "Start to build single-thread xgboost" + make clean + make no_omp=1 + echo "Successfully build single-thread xgboost" +fi \ No newline at end of file