add multi-thread static link for MAC
This commit is contained in:
parent
cbb52b1d5d
commit
13c8d2ba74
10
Makefile
10
Makefile
@ -21,9 +21,17 @@ endif
|
|||||||
ifeq ($(no_omp),1)
|
ifeq ($(no_omp),1)
|
||||||
CFLAGS += -DDISABLE_OPENMP
|
CFLAGS += -DDISABLE_OPENMP
|
||||||
else
|
else
|
||||||
CFLAGS += -fopenmp
|
#CFLAGS += -fopenmp
|
||||||
|
ifeq ($(omp_mac_static),1)
|
||||||
|
#CFLAGS += -fopenmp -Bstatic
|
||||||
|
CFLAGS += -static-libgcc -static-libstdc++ -L. -fopenmp
|
||||||
|
#LDFLAGS += -Wl,--whole-archive -lpthread -Wl --no-whole-archive
|
||||||
|
else
|
||||||
|
CFLAGS += -fopenmp
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
# by default use c++11
|
# by default use c++11
|
||||||
ifeq ($(cxx11),1)
|
ifeq ($(cxx11),1)
|
||||||
CFLAGS += -std=c++11
|
CFLAGS += -std=c++11
|
||||||
|
|||||||
12
build.sh
12
build.sh
@ -6,6 +6,18 @@
|
|||||||
|
|
||||||
# See additional instruction in doc/build.md
|
# See additional instruction in doc/build.md
|
||||||
|
|
||||||
|
#for building static OpenMP lib in MAC for easier installation in MAC
|
||||||
|
#doesn't work with XCode clang/LLVM since Apple doesn't support,
|
||||||
|
#needs brew install gcc 4.9+ with OpenMP
|
||||||
|
static_omp=1
|
||||||
|
if ((${static_omp}==1)); then
|
||||||
|
rm libgomp.a
|
||||||
|
ln -s `g++ -print-file-name=libgomp.a`
|
||||||
|
make clean
|
||||||
|
make omp_mac_static=1
|
||||||
|
echo "Successfully build multi-thread static link xgboost"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
if make; then
|
if make; then
|
||||||
echo "Successfully build multi-thread xgboost"
|
echo "Successfully build multi-thread xgboost"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user