refactor and ci
This commit is contained in:
parent
59b91cf205
commit
af0a451dc4
1
.gitignore
vendored
1
.gitignore
vendored
@ -66,3 +66,4 @@ java/xgboost4j-demo/data/
|
|||||||
java/xgboost4j-demo/tmp/
|
java/xgboost4j-demo/tmp/
|
||||||
java/xgboost4j-demo/model/
|
java/xgboost4j-demo/model/
|
||||||
nb-configuration*
|
nb-configuration*
|
||||||
|
dmlc-core
|
||||||
|
|||||||
61
.travis.yml
61
.travis.yml
@ -1,36 +1,45 @@
|
|||||||
language: c
|
|
||||||
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- _R_CHECK_TIMINGS_=0
|
|
||||||
- R_BUILD_ARGS="--no-build-vignettes --no-manual"
|
|
||||||
- R_CHECK_ARGS="--no-vignettes --no-manual"
|
|
||||||
|
|
||||||
warnings_are_errors: false
|
|
||||||
|
|
||||||
sudo: true
|
sudo: true
|
||||||
|
|
||||||
|
# Use Build Matrix to do lint and build seperately
|
||||||
|
env:
|
||||||
|
matrix:
|
||||||
|
- TASK=lint LINT_LANG=cpp
|
||||||
|
- TASK=lint LINT_LANG=python
|
||||||
|
- TASK="R-package"
|
||||||
|
- TASK="python-package"
|
||||||
|
- TASK=build CXX=g++
|
||||||
|
- TASK=build-with-dmlc CXX=g++
|
||||||
|
|
||||||
|
# dependent apt packages
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- doxygen
|
||||||
|
- libopenmpi-dev
|
||||||
|
- wget
|
||||||
|
- libcurl4-openssl-dev
|
||||||
|
- unzip
|
||||||
|
- python-numpy
|
||||||
|
- python-nose
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- curl -OL http://raw.github.com/craigcitro/r-travis/master/scripts/travis-tool.sh
|
- git clone https://github.com/dmlc/dmlc-core
|
||||||
- chmod 755 ./travis-tool.sh
|
- export TRAVIS=dmlc-core/scripts/travis/
|
||||||
- ./travis-tool.sh bootstrap
|
- export PYTHONPATH=${PYTHONPATH}:${PWD}/wrapper
|
||||||
|
- source ${TRAVIS}/travis_setup_env.sh
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- make Rpack
|
- pip install cpplint pylint --user `whoami`
|
||||||
- cd ./xgboost
|
|
||||||
- ../travis-tool.sh install_deps
|
|
||||||
|
|
||||||
script:
|
script: scripts/travis_script.sh
|
||||||
- bash ../travis-tool.sh run_tests
|
|
||||||
|
|
||||||
|
after_failure:
|
||||||
|
- scripts/travis_after_failure.sh
|
||||||
|
|
||||||
after_failure: cat /home/travis/build/dmlc/xgboost/R-package/xgboost.Rcheck/00install.out
|
|
||||||
|
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
recipients:
|
on_success: change
|
||||||
- hetong007@gmail.com
|
on_failure: always
|
||||||
- tqchen@cs.washington.edu
|
|
||||||
on_success: change
|
|
||||||
on_failure: always
|
|
||||||
|
|
||||||
|
|||||||
36
Makefile
36
Makefile
@ -1,7 +1,7 @@
|
|||||||
export CC = gcc
|
export CC = gcc
|
||||||
export CXX = g++
|
export CXX = g++
|
||||||
export MPICXX = mpicxx
|
export MPICXX = mpicxx
|
||||||
export LDFLAGS= -pthread -lm
|
export LDFLAGS= -pthread -lm
|
||||||
export CFLAGS = -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops
|
export CFLAGS = -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops
|
||||||
# java include path
|
# java include path
|
||||||
export JAVAINCFLAGS = -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -I./java
|
export JAVAINCFLAGS = -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -I./java
|
||||||
@ -12,8 +12,8 @@ ifeq ($(OS), Windows_NT)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(no_omp),1)
|
ifeq ($(no_omp),1)
|
||||||
CFLAGS += -DDISABLE_OPENMP
|
CFLAGS += -DDISABLE_OPENMP
|
||||||
else
|
else
|
||||||
CFLAGS += -fopenmp
|
CFLAGS += -fopenmp
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ ifdef dmlc
|
|||||||
config = $(dmlc)/config.mk
|
config = $(dmlc)/config.mk
|
||||||
else
|
else
|
||||||
config = $(dmlc)/make/config.mk
|
config = $(dmlc)/make/config.mk
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
include $(config)
|
include $(config)
|
||||||
include $(dmlc)/make/dmlc.mk
|
include $(dmlc)/make/dmlc.mk
|
||||||
@ -43,7 +43,7 @@ ifndef WITH_FPIC
|
|||||||
WITH_FPIC = 1
|
WITH_FPIC = 1
|
||||||
endif
|
endif
|
||||||
ifeq ($(WITH_FPIC), 1)
|
ifeq ($(WITH_FPIC), 1)
|
||||||
CFLAGS += -fPIC
|
CFLAGS += -fPIC
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ else
|
|||||||
TARGET = $(BIN)
|
TARGET = $(BIN)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: clean all mpi python Rpack
|
.PHONY: clean all mpi python Rpack lint
|
||||||
|
|
||||||
all: $(TARGET)
|
all: $(TARGET)
|
||||||
mpi: $(MPIBIN)
|
mpi: $(MPIBIN)
|
||||||
@ -78,9 +78,9 @@ 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
|
||||||
updater.o: src/tree/updater.cpp src/tree/*.hpp src/*.h src/tree/*.h src/utils/*.h
|
updater.o: src/tree/updater.cpp src/tree/*.hpp src/*.h src/tree/*.h src/utils/*.h
|
||||||
dmlc_simple.o: src/io/dmlc_simple.cpp src/utils/*.h
|
dmlc_simple.o: src/io/dmlc_simple.cpp src/utils/*.h
|
||||||
gbm.o: src/gbm/gbm.cpp src/gbm/*.hpp src/gbm/*.h
|
gbm.o: src/gbm/gbm.cpp src/gbm/*.hpp src/gbm/*.h
|
||||||
io.o: src/io/io.cpp src/io/*.hpp src/utils/*.h src/learner/dmatrix.h src/*.h
|
io.o: src/io/io.cpp src/io/*.hpp src/utils/*.h src/learner/dmatrix.h src/*.h
|
||||||
main.o: src/xgboost_main.cpp src/utils/*.h src/*.h src/learner/*.hpp src/learner/*.h
|
main.o: src/xgboost_main.cpp src/utils/*.h src/*.h src/learner/*.hpp src/learner/*.h
|
||||||
xgboost: updater.o gbm.o io.o main.o $(LIBRABIT) $(LIBDMLC)
|
xgboost: updater.o gbm.o io.o main.o $(LIBRABIT) $(LIBDMLC)
|
||||||
wrapper/xgboost_wrapper.dll wrapper/libxgboostwrapper.so: wrapper/xgboost_wrapper.cpp src/utils/*.h src/*.h src/learner/*.hpp src/learner/*.h updater.o gbm.o io.o $(LIBRABIT) $(LIBDMLC)
|
wrapper/xgboost_wrapper.dll wrapper/libxgboostwrapper.so: wrapper/xgboost_wrapper.cpp src/utils/*.h src/*.h src/learner/*.hpp src/learner/*.h updater.o gbm.o io.o $(LIBRABIT) $(LIBDMLC)
|
||||||
|
|
||||||
@ -97,11 +97,11 @@ subtree/rabit/lib/librabit_mock.a: subtree/rabit/src/engine_mock.cc
|
|||||||
subtree/rabit/lib/librabit_mpi.a: subtree/rabit/src/engine_mpi.cc
|
subtree/rabit/lib/librabit_mpi.a: subtree/rabit/src/engine_mpi.cc
|
||||||
+ cd subtree/rabit;make lib/librabit_mpi.a; cd ../..
|
+ cd subtree/rabit;make lib/librabit_mpi.a; cd ../..
|
||||||
|
|
||||||
$(BIN) :
|
$(BIN) :
|
||||||
$(CXX) $(CFLAGS) -fPIC -o $@ $(filter %.cpp %.o %.c %.cc %.a, $^) $(LDFLAGS)
|
$(CXX) $(CFLAGS) -fPIC -o $@ $(filter %.cpp %.o %.c %.cc %.a, $^) $(LDFLAGS)
|
||||||
|
|
||||||
$(MOCKBIN) :
|
$(MOCKBIN) :
|
||||||
$(CXX) $(CFLAGS) -o $@ $(filter %.cpp %.o %.c %.cc %.a, $^) $(LDFLAGS)
|
$(CXX) $(CFLAGS) -o $@ $(filter %.cpp %.o %.c %.cc %.a, $^) $(LDFLAGS)
|
||||||
|
|
||||||
$(SLIB) :
|
$(SLIB) :
|
||||||
$(CXX) $(CFLAGS) -fPIC -shared -o $@ $(filter %.cpp %.o %.c %.a %.cc, $^) $(LDFLAGS) $(DLLFLAGS)
|
$(CXX) $(CFLAGS) -fPIC -shared -o $@ $(filter %.cpp %.o %.c %.a %.cc, $^) $(LDFLAGS) $(DLLFLAGS)
|
||||||
@ -109,13 +109,13 @@ $(SLIB) :
|
|||||||
$(JLIB) :
|
$(JLIB) :
|
||||||
$(CXX) $(CFLAGS) -fPIC -shared -o $@ $(filter %.cpp %.o %.c %.a %.cc, $^) $(LDFLAGS) $(JAVAINCFLAGS)
|
$(CXX) $(CFLAGS) -fPIC -shared -o $@ $(filter %.cpp %.o %.c %.a %.cc, $^) $(LDFLAGS) $(JAVAINCFLAGS)
|
||||||
|
|
||||||
$(OBJ) :
|
$(OBJ) :
|
||||||
$(CXX) -c $(CFLAGS) -o $@ $(firstword $(filter %.cpp %.c %.cc, $^) )
|
$(CXX) -c $(CFLAGS) -o $@ $(firstword $(filter %.cpp %.c %.cc, $^) )
|
||||||
|
|
||||||
$(MPIOBJ) :
|
$(MPIOBJ) :
|
||||||
$(MPICXX) -c $(CFLAGS) -o $@ $(firstword $(filter %.cpp %.c, $^) )
|
$(MPICXX) -c $(CFLAGS) -o $@ $(firstword $(filter %.cpp %.c, $^) )
|
||||||
|
|
||||||
$(MPIBIN) :
|
$(MPIBIN) :
|
||||||
$(MPICXX) $(CFLAGS) -o $@ $(filter %.cpp %.o %.c %.cc %.a, $^) $(LDFLAGS)
|
$(MPICXX) $(CFLAGS) -o $@ $(filter %.cpp %.o %.c %.cc %.a, $^) $(LDFLAGS)
|
||||||
|
|
||||||
install:
|
install:
|
||||||
@ -157,6 +157,10 @@ Rcheck:
|
|||||||
make Rbuild
|
make Rbuild
|
||||||
R CMD check --as-cran xgboost*.tar.gz
|
R CMD check --as-cran xgboost*.tar.gz
|
||||||
|
|
||||||
|
# lint requires dmlc to be in current folder
|
||||||
|
lint:
|
||||||
|
dmlc-core/scripts/lint.py xgboost $(LINT_LANG) src wrapper R-package
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) -rf $(OBJ) $(BIN) $(MPIBIN) $(MPIOBJ) $(SLIB) *.o */*.o */*/*.o *~ */*~ */*/*~
|
$(RM) -rf $(OBJ) $(BIN) $(MPIBIN) $(MPIOBJ) $(SLIB) *.o */*.o */*/*.o *~ */*~ */*/*~
|
||||||
cd subtree/rabit; make clean; cd ..
|
cd subtree/rabit; make clean; cd ..
|
||||||
|
|||||||
14
scripts/travis_R_script.sh
Executable file
14
scripts/travis_R_script.sh
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Test R package of xgboost
|
||||||
|
set -e
|
||||||
|
export _R_CHECK_TIMINGS_=0
|
||||||
|
export R_BUILD_ARGS="--no-build-vignettes --no-manual"
|
||||||
|
export R_CHECK_ARGS="--no-vignettes --no-manual"
|
||||||
|
|
||||||
|
curl -OL http://raw.github.com/craigcitro/r-travis/master/scripts/travis-tool.sh
|
||||||
|
chmod 755 ./travis-tool.sh
|
||||||
|
./travis-tool.sh bootstrap
|
||||||
|
make Rpack
|
||||||
|
cd ./xgboost
|
||||||
|
../travis-tool.sh install_deps
|
||||||
|
../travis-tool.sh run_tests
|
||||||
5
scripts/travis_after_failure.sh
Executable file
5
scripts/travis_after_failure.sh
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ ${TASK} == "R-package" ]; then
|
||||||
|
cat R-package/xgboost.Rcheck/00install.out
|
||||||
|
fi
|
||||||
28
scripts/travis_scripts.sh
Executable file
28
scripts/travis_scripts.sh
Executable file
@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# main script of travis
|
||||||
|
if [ ${TASK} == "lint" ]; then
|
||||||
|
make lint || exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ${TASK} == "build" ]; then
|
||||||
|
make all CXX=${CXX} || exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ${TASK} == "build-with-dmlc" ]; then
|
||||||
|
cd dmlc-core
|
||||||
|
cp make/config.mk .
|
||||||
|
echo "USE_S3=1" >> config.mk
|
||||||
|
make all CXX=${CXX}|| exit -1
|
||||||
|
cd ..
|
||||||
|
make dmlc=dmlc-core CXX=${CXX} || exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ${TASK} == "R-package" ]; then
|
||||||
|
scripts/travis_R_script.sh || exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ${TASK} == "python-package" ]; then
|
||||||
|
make all CXX=${CXX} || exit -1
|
||||||
|
nosetests tests/python || exit -1
|
||||||
|
fi
|
||||||
Loading…
x
Reference in New Issue
Block a user