From 47d6d09081d171b1ab73eb87fb18f9e87acb2d51 Mon Sep 17 00:00:00 2001 From: yanqingmen Date: Tue, 29 Dec 2015 20:47:47 +0800 Subject: [PATCH] add osx build instruction --- java/README.md | 9 +++++++-- java/create_wrap.sh | 7 ++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/java/README.md b/java/README.md index 12cbb4582..f7f3fa707 100644 --- a/java/README.md +++ b/java/README.md @@ -17,12 +17,17 @@ core of this wrapper is two classes: ## build native library -for windows: open the xgboost.sln in "../windows" folder, you will found the xgboostjavawrapper project, you should do the following steps to build wrapper library: +for windows: open the xgboost.sln in "../windows" folder, you will found the xgboost4j project, you should do the following steps to build wrapper library: * Select x64/win32 and Release in build - * (if you have setted `JAVA_HOME` properly in windows environment variables, escape this step) right click on xgboostjavawrapper project -> choose "Properties" -> click on "C/C++" in the window -> change the "Additional Include Directories" to fit your jdk install path. + * (if you have setted `JAVA_HOME` properly in windows environment variables, escape this step) right click on xgboost4j project -> choose "Properties" -> click on "C/C++" in the window -> change the "Additional Include Directories" to fit your jdk install path. * rebuild all * double click "create_wrap.bat" to set library to proper place for linux: * make sure you have installed jdk and `JAVA_HOME` has been setted properly * run "create_wrap.sh" + +for osx: + * make sure you have installed jdk + * for single thread xgboost, simply run "create_wrap.sh" + * for build with openMP, please refer to [build.md](../doc/build.md) to get openmp supported compiler first, and change the line "dis_omp=1" to "dis_omp=0" in "create_wrap.sh", then run "create_wrap.sh" \ No newline at end of file diff --git a/java/create_wrap.sh b/java/create_wrap.sh index fd8b46add..d894b60e3 100755 --- a/java/create_wrap.sh +++ b/java/create_wrap.sh @@ -1,13 +1,14 @@ echo "build java wrapper" dylib="so" -omp="0" +dis_omp=0 if [ $(uname) == "Darwin" ]; then export JAVA_HOME=$(/usr/libexec/java_home) dylib="dylib" - omp="1" + #change this to 0 if your compiler support openmp + dis_omp=1 fi cd .. -make java no_omp=${omp} +make java no_omp=${dis_omp} cd java echo "move native lib"