C API example (#4333)
This commit is contained in:
committed by
Rory Mitchell
parent
2e052e74b6
commit
9080bba815
19
demo/c-api/Makefile
Normal file
19
demo/c-api/Makefile
Normal file
@@ -0,0 +1,19 @@
|
||||
SRC=c-api-demo.c
|
||||
TGT=c-api-demo
|
||||
|
||||
cc=cc
|
||||
CFLAGS ?=-O3
|
||||
XGBOOST_ROOT ?=../..
|
||||
INCLUDE_DIR=-I$(XGBOOST_ROOT)/include -I$(XGBOOST_ROOT)/dmlc-core/include -I$(XGBOOST_ROOT)/rabit/include
|
||||
LIB_DIR=-L$(XGBOOST_ROOT)/lib
|
||||
|
||||
build: $(TGT)
|
||||
|
||||
$(TGT): $(SRC) Makefile
|
||||
$(cc) $(CFLAGS) $(INCLUDE_DIR) $(LIB_DIR) -o $(TGT) $(SRC) -lxgboost
|
||||
|
||||
run: $(TGT)
|
||||
LD_LIBRARY_PATH=$(XGBOOST_ROOT)/lib ./$(TGT)
|
||||
|
||||
clean:
|
||||
rm -f $(TGT)
|
||||
Reference in New Issue
Block a user