forked from dmlc/xgboost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·55 lines (47 loc) · 1.7 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# This is a simple script to make xgboost in MAC and Linux
# Basically, it first try to make with OpenMP, if fails, disable OpenMP and make it again.
# This will automatically make xgboost for MAC users who don't have OpenMP support.
# In most cases, type make will give what you want.
# See additional instruction in doc/build.md
set -e
if make; then
echo "Successfully build multi-thread xgboost"
else
not_ready=0
if [[ ! -e ./rabit/Makefile ]]; then
echo ""
echo "Please clone the rabit repository into this directory."
echo "Here are the commands:"
echo "rm -rf rabit"
echo "git clone https://github.com/dmlc/rabit.git rabit"
not_ready=1
fi
if [[ ! -e ./dmlc-core/Makefile ]]; then
echo ""
echo "Please clone the dmlc-core repository into this directory."
echo "Here are the commands:"
echo "rm -rf dmlc-core"
echo "git clone https://github.com/dmlc/dmlc-core.git dmlc-core"
not_ready=1
fi
if [[ "${not_ready}" == "1" ]]; then
echo ""
echo "Please fix the errors above and retry the build or reclone the repository with:"
echo "git clone --recursive https://github.com/dmlc/xgboost.git"
echo ""
exit 1
fi
echo "-----------------------------"
echo "Building multi-thread xgboost failed"
echo "Start to build single-thread xgboost"
make clean_all
make config=make/minimum.mk
if [ $? -eq 0 ] ;then
echo "Successfully build single-thread xgboost"
echo "If you want multi-threaded version"
echo "See additional instructions in doc/build.md"
else
echo "Failed to build single-thread xgboost"
fi
fi