add settings for OS X

This commit is contained in:
huangzixuan 2015-12-20 20:47:30 +08:00
parent 1456585249
commit 7d23ea7e9e
2 changed files with 14 additions and 3 deletions

View File

@ -19,6 +19,10 @@ ifeq ($(UNAME), Linux)
JAVAINCFLAGS += -I${JAVA_HOME}/include/linux
endif
ifeq ($(UNAME), Darwin)
JAVAINCFLAGS += -I${JAVA_HOME}/include/darwin
endif
ifeq ($(no_omp),1)
CFLAGS += -DDISABLE_OPENMP
else

View File

@ -1,6 +1,13 @@
echo "build java wrapper"
dylib="so"
omp="0"
if [ $(uname) == "Darwin" ]; then
export JAVA_HOME=$(/usr/libexec/java_home)
dylib="dylib"
omp="1"
fi
cd ..
make java
make java no_omp=${omp}
cd java
echo "move native lib"
@ -9,7 +16,7 @@ if [ ! -d "$libPath" ]; then
mkdir -p "$libPath"
fi
rm -f xgboost4j/src/main/resources/lib/libxgboost4j.so
mv libxgboost4j.so xgboost4j/src/main/resources/lib/
rm -f xgboost4j/src/main/resources/lib/libxgboost4j.${dylib}
mv libxgboost4j.so xgboost4j/src/main/resources/lib/libxgboost4j.${dylib}
echo "complete"