-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
read + appveyor & travis ci; boost and/or cereal serialization; unit …
…testing * add simple readme + build badges * add appveyor + travis builds and tests * cealn up cereal and/or boost serialization options + update xgboost submodule + disable tests for ios and android + fix indentation + fix travis + add option for to_string.h as needed (ANDROID listdc++ patch) * add src/3rdparty/xgboost submodule for inital development * move cereal + boost details from XGBoosterIOArchive*.cpp directly into xgboost * update cmake options * update bash build test scripts * add some common model serialization template functions for common boost/serial archives * add GTest + scikit gradient boosting “boston” regression problem + in memorty train + test + in memory train + cereal load and test + in memory train + boost load and test * fix android missing strings (stdlib) * add openmp global settings * add Hunter/config.cmake
- Loading branch information
1 parent
005b76a
commit 0fea134
Showing
28 changed files
with
1,924 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "src/3rdparty/xgboost"] | ||
path = src/3rdparty/xgboost | ||
url = https://github.com/hunter-packages/xgboost.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
# OSX/Linux (https://github.com/travis-ci-tester/toolchain-table) | ||
|
||
language: | ||
- cpp | ||
|
||
# Container-based infrastructure (Linux) | ||
# * https://docs.travis-ci.com/user/migrating-from-legacy/#How-can-I-use-container-based-infrastructure%3F | ||
sudo: | ||
- false | ||
|
||
# Install packages differs for container-based infrastructure | ||
# * https://docs.travis-ci.com/user/migrating-from-legacy/#How-do-I-install-APT-sources-and-packages%3F | ||
# * http://stackoverflow.com/a/30925448/2288008 | ||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- python3 | ||
|
||
# python3-pip package is not available, use 'easy_install3': | ||
# * https://github.com/travis-ci/apt-package-whitelist/issues/768 | ||
- python3-setuptools # easy_install3 | ||
|
||
# https://github.com/travis-ci-tester/travis-test-clang-cxx-11 | ||
- libstdc++-4.8-dev | ||
|
||
# https://github.com/travis-ci-tester/travis-test-gcc-cxx-11 | ||
- g++-4.8 | ||
|
||
# Packages for Android development: http://superuser.com/a/360398/252568 | ||
- libncurses5:i386 | ||
- libstdc++6:i386 | ||
- zlib1g:i386 | ||
|
||
matrix: | ||
include: | ||
# Linux { | ||
- os: linux | ||
env: CONFIG=Release TOOLCHAIN=gcc-4-8-pic-hid-sections INSTALL=--strip TO_STRING=OFF | ||
# - os: linux | ||
# env: CONFIG=Debug TOOLCHAIN=gcc-4-8-pic-hid-sections INSTALL=--strip TO_STRING=OFF | ||
- os: linux | ||
env: CONFIG=Release TOOLCHAIN=android-ndk-r10e-api-19-armeabi-v7a-neon-hid-sections INSTALL=--strip TO_STRING=ON | ||
# - os: linux | ||
# env: CONFIG=Debug TOOLCHAIN=android-ndk-r10e-api-19-armeabi-v7a-neon-hid-sections INSTALL=--strip TO_STRING=ON | ||
# } | ||
|
||
# OSX { | ||
# - os: osx | ||
# env: CONFIG=Release TOOLCHAIN=libcxx-hid-sections INSTALL=--strip TO_STRING=OFF | ||
# - os: osx | ||
# env: CONFIG=Debug TOOLCHAIN=libcxx-hid-sections INSTALL=--strip TO_STRING=OFF | ||
- os: osx | ||
env: CONFIG=Release TOOLCHAIN=osx-10-11-hid-sections INSTALL=--install TO_STRING=OFF | ||
# - os: osx | ||
# env: CONFIG=Debug TOOLCHAIN=osx-10-11-hid-sections INSTALL=--install TO_STRING=OFF | ||
- os: osx | ||
env: CONFIG=Release TOOLCHAIN=ios-nocodesign-9-3-device-hid-sections INSTALL=--install TO_STRING=OFF | ||
# - os: osx | ||
# env: CONFIG=Debug TOOLCHAIN=ios-nocodesign-9-3-device-hid-sections INSTALL=--install TO_STRING=OFF | ||
- os: osx | ||
osx_image: xcode8.1 | ||
env: CONFIG=Release TOOLCHAIN=osx-10-12-sanitize-address-hid-sections INSTALL=--install TO_STRING=OFF | ||
- os: osx | ||
osx_image: xcode8.1 | ||
env: CONFIG=Debug TOOLCHAIN=osx-10-12-sanitize-address-hid-sections INSTALL=--install TO_STRING=OFF | ||
- os: osx | ||
env: CONFIG=Release TOOLCHAIN=android-ndk-r10e-api-19-armeabi-v7a-neon-hid-sections INSTALL=--strip TO_STRING=ON | ||
# - os: osx | ||
# env: CONFIG=Debug TOOLCHAIN=android-ndk-r10e-api-19-armeabi-v7a-neon-hid-sections INSTALL=--strip TO_STRING=ON | ||
# } | ||
|
||
# disable the default submodule logic to support local modification of .gitmodules paths | ||
git: | ||
submodules: false | ||
|
||
before_install: | ||
# Add '--quiet' to avoid leaking the token to logs | ||
- git submodule update --init --recursive --quiet | ||
|
||
install: | ||
# Info about OS | ||
- uname -a | ||
|
||
# Install Python 3 | ||
- if [[ "`uname`" == "Darwin" ]]; then travis_retry brew install python3; fi | ||
|
||
# Install Python package 'requests' | ||
# 'easy_install3' is not installed by 'brew install python3' on OS X 10.9 Maverick | ||
- if [[ "`uname`" == "Darwin" ]]; then pip3 install requests; fi | ||
- if [[ "`uname`" == "Linux" ]]; then travis_retry easy_install3 --user requests==2.10.0; fi | ||
|
||
# Install latest Polly toolchains and scripts | ||
- wget https://github.com/ruslo/polly/archive/master.zip | ||
- unzip master.zip | ||
- POLLY_ROOT="`pwd`/polly-master" | ||
- export PATH="${POLLY_ROOT}/bin:${PATH}" | ||
|
||
# Install dependencies (CMake, Android NDK) | ||
- install-ci-dependencies.py | ||
|
||
# Tune locations | ||
- export PATH="`pwd`/_ci/cmake/bin:${PATH}" | ||
|
||
# Installed if toolchain is Android (otherwise directory doesn't exist) | ||
- export ANDROID_NDK_r10e="`pwd`/_ci/android-ndk-r10e" | ||
|
||
script: | ||
|
||
# optional to_string.h | ||
- > | ||
polly.py | ||
--toolchain ${TOOLCHAIN} | ||
--config ${CONFIG} | ||
--verbose | ||
--fwd | ||
HUNTER_CONFIGURATION_TYPES=${CONFIG} | ||
XGBOOSTER_ADD_TO_STRING=${TO_STRING} | ||
--test | ||
--discard 10 | ||
--tail 100 | ||
${INSTALL} | ||
branches: | ||
except: | ||
- /^pr\..*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Windows (https://github.com/travis-ci-tester/toolchain-table) | ||
|
||
environment: | ||
matrix: | ||
### | ||
- TOOLCHAIN: "default" | ||
CONFIG: Release | ||
|
||
- TOOLCHAIN: "default" | ||
CONFIG: Debug | ||
|
||
### | ||
- TOOLCHAIN: "vs-14-2015" | ||
CONFIG: Release | ||
|
||
- TOOLCHAIN: "vs-14-2015" | ||
CONFIG: Debug | ||
|
||
install: | ||
# Python 3 | ||
- cmd: set PATH=C:\Python34-x64;C:\Python34-x64\Scripts;%PATH% | ||
|
||
# Install Python package 'requests' | ||
- cmd: pip install requests | ||
|
||
# Install latest Polly toolchains and scripts | ||
- cmd: appveyor DownloadFile https://github.com/ruslo/polly/archive/master.zip | ||
- cmd: 7z x master.zip | ||
- cmd: set POLLY_SOURCE_DIR=%cd%\polly-master | ||
|
||
# Install dependencies (CMake, Ninja) | ||
- cmd: python %POLLY_SOURCE_DIR%\bin\install-ci-dependencies.py | ||
|
||
# Tune locations | ||
- cmd: set PATH=%cd%\_ci\cmake\bin;%PATH% | ||
- cmd: set PATH=%cd%\_ci\ninja;%PATH% | ||
|
||
# Add '--quiet' to avoid leaking the token to logs | ||
- cmd: git submodule update --init --recursive --quiet | ||
|
||
# Remove entry with sh.exe from PATH to fix error with MinGW toolchain | ||
# (For MinGW make to work correctly sh.exe must NOT be in your path) | ||
# * http://stackoverflow.com/a/3870338/2288008 | ||
- cmd: set PATH=%PATH:C:\Program Files\Git\usr\bin;=% | ||
|
||
# Use MinGW from Qt tools because version is higher | ||
# * http://www.appveyor.com/docs/installed-software#qt | ||
- cmd: set MINGW_PATH=C:\Qt\Tools\mingw492_32\bin | ||
|
||
# MSYS2 location | ||
- cmd: set MSYS_PATH=C:\msys64\usr\bin | ||
|
||
build_script: | ||
- cmd: python %POLLY_SOURCE_DIR%\bin\polly.py --toolchain "%TOOLCHAIN%" --config "%CONFIG%" --verbose --test | ||
|
||
branches: | ||
except: | ||
- /^pr\..*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
#!/bin/bash | ||
|
||
build.py --toolchain android-ndk-r10e-api-16-armeabi-v7a-neon-clang-35 --verbose --fwd HUNTER_CONFIGURATION_TYPES=Release ANDROID=TRUE --clear | ||
TOOLCHAIN=android-ndk-r10e-api-19-armeabi-v7a-neon-hid-sections | ||
|
||
ARGS=( | ||
--verbose | ||
--config Release | ||
--fwd ANDROID=TRUE | ||
HUNTER_CONFIGURATION_TYPES=Release | ||
XGBOOSTER_SERIALIZE_WITH_BOOST=OFF | ||
XGBOOSTER_SERIALIZE_WITH_CEREAL=ON | ||
XGBOOSTER_ADD_TO_STRING=ON | ||
) | ||
|
||
export HUNTER_ROOT=${HOME}/devel/ruslo/hunter | ||
build.py --toolchain ${TOOLCHAIN} ${ARGS[@]} --clear |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
set(XGBOOST_CMAKE_ARGS | ||
XGBOOST_USE_HALF=ON | ||
XGBOOST_USE_BOOST=ON | ||
XGBOOST_DO_LEAN=ON | ||
XGBOOST_ADD_TO_STRING=${XGBOOSTER_ADD_TO_STRING} | ||
XGBOOST_USE_BOOST=${XGBOOSTER_SERIALIZE_WITH_BOOST} | ||
XGBOOST_USE_CEREAL=${XGBOOSTER_SERIALIZE_WITH_CEREAL} | ||
) | ||
|
||
if(ANDROID) | ||
list(APPEND XGBOOST_CMAKE_ARGS XGBOOST_ADD_TO_STRING=ON) | ||
endif() | ||
|
||
hunter_config(Boost VERSION ${HUNTER_Boost_VERSION} CMAKE_ARGS IOSTREAMS_NO_BZIP2=1) | ||
hunter_config(xgboost VERSION ${HUNTER_xgboost_VERSION} CMAKE_ARGS ${XGBOOST_CMAKE_ARGS}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,33 @@ | ||
############### | ||
### xgboost ### | ||
############### | ||
|
||
option(DRISHTI_USE_LOCAL_XGBOOST "Use local xgboost" ON) | ||
if(DRISHTI_USE_LOCAL_XGBOOST) | ||
option(SKIP_INSTALL "Avoid installation of submodule libraries" OFF) | ||
|
||
option(SKIP_INSTALL "Skip the package install" OFF) | ||
option(XGBOOST_USE_BOOST "Use boost serialization" ${XGBOOSTER_SERIALIZE_WITH_BOOST}) | ||
option(XGBOOST_USE_CEREAL "Use cereal serialization" ${XGBOOSTER_SERIALIZE_WITH_CEREAL}) | ||
option(XGBOOST_ADD_TO_STRING "Add standard library std::to_string()" ${XGBOOSTER_ADD_TO_STRING}) | ||
option(XGBOOST_USE_HALF "Support half precision floating point storage" ON) | ||
option(XGBOOST_DO_LEAN "Build lean library for evaluation only" OFF) | ||
|
||
add_subdirectory(3rdparty/xgboost) | ||
unset(SKIP_INSTALL CACHE) | ||
add_library(xgboost::xgboost ALIAS xgboost) | ||
set_property(TARGET xgboost PROPERTY FOLDER "libs/3rdparty") | ||
target_include_directories(xgboost PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/3rdparty>") | ||
|
||
else() | ||
hunter_add_package(xgboost) | ||
find_package(xgboost CONFIG REQUIRED) | ||
endif() | ||
|
||
message("XGBOOST_USE_BOOST = ${XGBOOST_USE_BOOST}") | ||
message("XGBOOST_USE_CEREAL = ${XGBOOST_USE_CEREAL}") | ||
message("XGBOOSTER_SERIALIZE_WITH_BOOST = ${XGBOOSTER_SERIALIZE_WITH_BOOST}") | ||
message("XGBOOSTER_SERIALIZE_WITH_CEREAL = ${XGBOOSTER_SERIALIZE_WITH_CEREAL}") | ||
|
||
add_subdirectory(lib) | ||
add_subdirectory(test) |
Oops, something went wrong.