diff --git a/Makefile b/Makefile index cf002f319..cfccec781 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ export CC = gcc export CXX = g++ 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) CFLAGS += -DDISABLE_OPENMP @@ -17,7 +17,7 @@ SLIB = wrapper/libxgboostwrapper.so .PHONY: clean all python -all: $(BIN) $(OBJ) $(SLIB) +all: $(BIN) $(OBJ) $(SLIB) python: wrapper/libxgboostwrapper.so # now the wrapper takes in two files. io and wrapper part @@ -40,5 +40,17 @@ $(OBJ) : install: 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: $(RM) $(OBJ) $(BIN) $(SLIB) *.o *~ */*~ */*/*~ diff --git a/R-package/src/Makevars b/R-package/src/Makevars index bfd52838f..1e77150db 100644 --- a/R-package/src/Makevars +++ b/R-package/src/Makevars @@ -1,12 +1,13 @@ +# package root +PKGROOT=../../ # _*_ mode: Makefile; _*_ export CC = gcc export CXX = g++ -# package root -PKGROOT=../../ # expose these flags to R CMD SHLIB PKG_CPPFLAGS = -O3 -Wno-unknown-pragmas -DXGBOOST_CUSTOMIZE_ERROR_ -fPIC $(SHLIB_OPENMP_CFLAGS) +PKG_CPPFLAGS += -I$(PKGROOT) PKG_LIBS = $(SHLIB_OPENMP_CFLAGS) ifeq ($(no_omp),1) diff --git a/R-package/src/Makevars.win b/R-package/src/Makevars.win index 4cf21511a..c6d10bf1c 100644 --- a/R-package/src/Makevars.win +++ b/R-package/src/Makevars.win @@ -1,12 +1,13 @@ +# package root +PKGROOT=../../ # _*_ mode: Makefile; _*_ export CC = gcc export CXX = g++ -# package root -PKGROOT=../../ # expose these flags to R CMD SHLIB PKG_CPPFLAGS = -O3 -Wno-unknown-pragmas -DXGBOOST_CUSTOMIZE_ERROR_ -fopenmp -fPIC $(SHLIB_OPENMP_CFLAGS) +PKG_CPPFLAGS += -I$(PKGROOT) PKG_LIBS = $(SHLIB_OPENMP_CFLAGS) # add flag to build native code even in cross compiler diff --git a/R-package/src/xgboost_R.cpp b/R-package/src/xgboost_R.cpp index a353041e0..b358ef4ae 100644 --- a/R-package/src/xgboost_R.cpp +++ b/R-package/src/xgboost_R.cpp @@ -3,10 +3,10 @@ #include #include #include "xgboost_R.h" -#include "../../wrapper/xgboost_wrapper.h" -#include "../../src/utils/utils.h" -#include "../../src/utils/omp.h" -#include "../../src/utils/matrix_csr.h" +#include "wrapper/xgboost_wrapper.h" +#include "src/utils/utils.h" +#include "src/utils/omp.h" +#include "src/utils/matrix_csr.h" using namespace xgboost; // implements error handling