modify java wrapper settings for new refactor
This commit is contained in:
parent
263b7befde
commit
a662340fda
12
Makefile
12
Makefile
@ -39,6 +39,8 @@ endif
|
|||||||
export LDFLAGS= -pthread -lm $(ADD_LDFLAGS) $(DMLC_LDFLAGS)
|
export LDFLAGS= -pthread -lm $(ADD_LDFLAGS) $(DMLC_LDFLAGS)
|
||||||
export CFLAGS= -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -fPIC -Iinclude $(ADD_CFLAGS)
|
export CFLAGS= -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -fPIC -Iinclude $(ADD_CFLAGS)
|
||||||
CFLAGS += -I$(DMLC_CORE)/include -I$(RABIT)/include
|
CFLAGS += -I$(DMLC_CORE)/include -I$(RABIT)/include
|
||||||
|
#java include path
|
||||||
|
export JAVAINCFLAGS = -I${JAVA_HOME}/include -I./java
|
||||||
|
|
||||||
ifndef LINT_LANG
|
ifndef LINT_LANG
|
||||||
LINT_LANG= "all"
|
LINT_LANG= "all"
|
||||||
@ -46,6 +48,11 @@ endif
|
|||||||
|
|
||||||
ifeq ($(UNAME), Linux)
|
ifeq ($(UNAME), Linux)
|
||||||
LDFLAGS += -lrt
|
LDFLAGS += -lrt
|
||||||
|
JAVAINCFLAGS += -I${JAVA_HOME}/include/linux
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(UNAME), Darwin)
|
||||||
|
JAVAINCFLAGS += -I${JAVA_HOME}/include/darwin
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(USE_OPENMP), 1)
|
ifeq ($(USE_OPENMP), 1)
|
||||||
@ -54,6 +61,7 @@ else
|
|||||||
CFLAGS += -DDISABLE_OPENMP
|
CFLAGS += -DDISABLE_OPENMP
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
# specify tensor path
|
# specify tensor path
|
||||||
.PHONY: clean all lint clean_all rcpplint Rpack Rbuild Rcheck
|
.PHONY: clean all lint clean_all rcpplint Rpack Rbuild Rcheck
|
||||||
|
|
||||||
@ -65,6 +73,7 @@ $(DMLC_CORE)/libdmlc.a:
|
|||||||
$(RABIT)/lib/$(LIB_RABIT):
|
$(RABIT)/lib/$(LIB_RABIT):
|
||||||
+ cd $(RABIT); make lib/$(LIB_RABIT); cd $(ROOTDIR)
|
+ cd $(RABIT); make lib/$(LIB_RABIT); cd $(ROOTDIR)
|
||||||
|
|
||||||
|
java: java/libxgboost4j.so
|
||||||
|
|
||||||
SRC = $(wildcard src/*.cc src/*/*.cc)
|
SRC = $(wildcard src/*.cc src/*/*.cc)
|
||||||
ALL_OBJ = $(patsubst src/%.cc, build/%.o, $(SRC))
|
ALL_OBJ = $(patsubst src/%.cc, build/%.o, $(SRC))
|
||||||
@ -95,6 +104,9 @@ lib/libxgboost.so: $(ALL_DEP)
|
|||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
$(CXX) $(CFLAGS) -shared -o $@ $(filter %.o %.a, $^) $(LDFLAGS)
|
$(CXX) $(CFLAGS) -shared -o $@ $(filter %.o %.a, $^) $(LDFLAGS)
|
||||||
|
|
||||||
|
java/libxgboost4j.so: java/xgboost4j_wrapper.cpp lib/libxgboost.a $(LIB_DEP)
|
||||||
|
$(CXX) $(CFLAGS) $(JAVAINCFLAGS) -shared -o $@ $(filter %.cpp %.o %.a, $^) $(LDFLAGS)
|
||||||
|
|
||||||
xgboost: $(CLI_OBJ) lib/libxgboost.a $(LIB_DEP)
|
xgboost: $(CLI_OBJ) lib/libxgboost.a $(LIB_DEP)
|
||||||
$(CXX) $(CFLAGS) -o $@ $(filter %.o %.a, $^) $(LDFLAGS)
|
$(CXX) $(CFLAGS) -o $@ $(filter %.o %.a, $^) $(LDFLAGS)
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../wrapper/xgboost_wrapper.h"
|
#include "xgboost/c_api.h"
|
||||||
#include "xgboost4j_wrapper.h"
|
#include "xgboost4j_wrapper.h"
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user