make it packable
This commit is contained in:
parent
2e96bc51f5
commit
3e92eb13d3
16
Makefile
16
Makefile
@ -2,7 +2,7 @@ export CC = gcc
|
|||||||
export CXX = g++
|
export CXX = g++
|
||||||
export LDFLAGS= -pthread -lm
|
export LDFLAGS= -pthread -lm
|
||||||
|
|
||||||
export CFLAGS = -Wall -O3 -msse2 -Wno-unknown-pragmas -fPIC
|
export CFLAGS = -Wall -O3 -msse2 -Wno-unknown-pragmas -fPIC -pedantic
|
||||||
|
|
||||||
ifeq ($(no_omp),1)
|
ifeq ($(no_omp),1)
|
||||||
CFLAGS += -DDISABLE_OPENMP
|
CFLAGS += -DDISABLE_OPENMP
|
||||||
@ -17,7 +17,7 @@ SLIB = wrapper/libxgboostwrapper.so
|
|||||||
|
|
||||||
.PHONY: clean all python
|
.PHONY: clean all python
|
||||||
|
|
||||||
all: $(BIN) $(OBJ) $(SLIB)
|
all: $(BIN) $(OBJ) $(SLIB)
|
||||||
|
|
||||||
python: wrapper/libxgboostwrapper.so
|
python: wrapper/libxgboostwrapper.so
|
||||||
# now the wrapper takes in two files. io and wrapper part
|
# now the wrapper takes in two files. io and wrapper part
|
||||||
@ -40,5 +40,17 @@ $(OBJ) :
|
|||||||
install:
|
install:
|
||||||
cp -f -r $(BIN) $(INSTALL_PATH)
|
cp -f -r $(BIN) $(INSTALL_PATH)
|
||||||
|
|
||||||
|
R-package.tar.gz:
|
||||||
|
rm -rf xgboost-R
|
||||||
|
cp -r R-package xgboost-R
|
||||||
|
rm -rf xgboost-R/src/*.o xgboost-R/src/*.so xgboost-R/src/*.dll
|
||||||
|
cp -r src xgboost-R/src/src
|
||||||
|
cp -r wrapper xgboost-R/src/wrapper
|
||||||
|
cp ./LICENSE xgboost-R
|
||||||
|
cat R-package/src/Makevars|sed '2s/.*/PKGROOT=./' > xgboost-R/src/Makevars
|
||||||
|
cat R-package/src/Makevars.win|sed '2s/.*/PKGROOT=./' > xgboost-R/src/Makevars.win
|
||||||
|
tar czf $@ xgboost-R
|
||||||
|
rm -rf xgboost-R
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) $(OBJ) $(BIN) $(SLIB) *.o *~ */*~ */*/*~
|
$(RM) $(OBJ) $(BIN) $(SLIB) *.o *~ */*~ */*/*~
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
|
# package root
|
||||||
|
PKGROOT=../../
|
||||||
# _*_ mode: Makefile; _*_
|
# _*_ mode: Makefile; _*_
|
||||||
export CC = gcc
|
export CC = gcc
|
||||||
export CXX = g++
|
export CXX = g++
|
||||||
|
|
||||||
# package root
|
|
||||||
PKGROOT=../../
|
|
||||||
|
|
||||||
# expose these flags to R CMD SHLIB
|
# expose these flags to R CMD SHLIB
|
||||||
PKG_CPPFLAGS = -O3 -Wno-unknown-pragmas -DXGBOOST_CUSTOMIZE_ERROR_ -fPIC $(SHLIB_OPENMP_CFLAGS)
|
PKG_CPPFLAGS = -O3 -Wno-unknown-pragmas -DXGBOOST_CUSTOMIZE_ERROR_ -fPIC $(SHLIB_OPENMP_CFLAGS)
|
||||||
|
PKG_CPPFLAGS += -I$(PKGROOT)
|
||||||
PKG_LIBS = $(SHLIB_OPENMP_CFLAGS)
|
PKG_LIBS = $(SHLIB_OPENMP_CFLAGS)
|
||||||
|
|
||||||
ifeq ($(no_omp),1)
|
ifeq ($(no_omp),1)
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
|
# package root
|
||||||
|
PKGROOT=../../
|
||||||
# _*_ mode: Makefile; _*_
|
# _*_ mode: Makefile; _*_
|
||||||
export CC = gcc
|
export CC = gcc
|
||||||
export CXX = g++
|
export CXX = g++
|
||||||
|
|
||||||
# package root
|
|
||||||
PKGROOT=../../
|
|
||||||
|
|
||||||
# expose these flags to R CMD SHLIB
|
# expose these flags to R CMD SHLIB
|
||||||
PKG_CPPFLAGS = -O3 -Wno-unknown-pragmas -DXGBOOST_CUSTOMIZE_ERROR_ -fopenmp -fPIC $(SHLIB_OPENMP_CFLAGS)
|
PKG_CPPFLAGS = -O3 -Wno-unknown-pragmas -DXGBOOST_CUSTOMIZE_ERROR_ -fopenmp -fPIC $(SHLIB_OPENMP_CFLAGS)
|
||||||
|
PKG_CPPFLAGS += -I$(PKGROOT)
|
||||||
PKG_LIBS = $(SHLIB_OPENMP_CFLAGS)
|
PKG_LIBS = $(SHLIB_OPENMP_CFLAGS)
|
||||||
|
|
||||||
# add flag to build native code even in cross compiler
|
# add flag to build native code even in cross compiler
|
||||||
|
|||||||
@ -3,10 +3,10 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include "xgboost_R.h"
|
#include "xgboost_R.h"
|
||||||
#include "../../wrapper/xgboost_wrapper.h"
|
#include "wrapper/xgboost_wrapper.h"
|
||||||
#include "../../src/utils/utils.h"
|
#include "src/utils/utils.h"
|
||||||
#include "../../src/utils/omp.h"
|
#include "src/utils/omp.h"
|
||||||
#include "../../src/utils/matrix_csr.h"
|
#include "src/utils/matrix_csr.h"
|
||||||
|
|
||||||
using namespace xgboost;
|
using namespace xgboost;
|
||||||
// implements error handling
|
// implements error handling
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user