Skip to content

Commit

Permalink
initial import of xgboost cpp test lib and app
Browse files Browse the repository at this point in the history
  • Loading branch information
headupinclouds committed Apr 28, 2017
1 parent 20dae18 commit 7d4d6f2
Show file tree
Hide file tree
Showing 21 changed files with 1,677 additions and 3 deletions.
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod

# Emacs files
*.*~

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

_*
53 changes: 53 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Copyright (c) 2015-2017, David Hirvonen, Ruslan Baratov
# All rights reserved.

# WIP C++ interface + serialization for xgboost library
# NOTE: This is using the xgboost fork in the hunter
# package manager which has some non-standard extensions
# for cross platform and size reduced serialization.
# It also uses OpenMP, whereas the lastest versions
# uses a C++11 thread interface.

# TODO: Add a more recent xgboost to hunter

cmake_minimum_required(VERSION 3.0)

### Hunter snapshot that will be used ###
include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.18.44.tar.gz"
SHA1 "a78f0b377b8e53c038f12fc18b0c02564c4534c8"
)

set(XGBOOSTCPP_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}")

project(xgboostcpp VERSION 0.1.0) # WIP!

set_property(GLOBAL PROPERTY USE_FOLDERS ON)

option(XGBOOSTER_BUILD_TESTS "Build tests" ON)
option(XGBOOSTER_SERIALIZE_WITH_BOOST "Serialize w/ boost" ON)
option(XGBOOSTER_SERIALIZE_WITH_CEREAL "Serialize w/ cereal" ON)

###################
## Dependencies ###
###################

hunter_add_package(xgboost)
find_package(xgboost CONFIG REQUIRED)

if(XGBOOSTER_SERIALIZE_WITH_BOOST)
hunter_add_package(boost-pba)
find_package(boost-pba CONFIG REQUIRED)
endif()

if(XGBOOSTER_SERIALIZE_WITH_CEREAL)
hunter_add_package(cereal)
find_package(cereal CONFIG REQUIRED)
endif()

##############
## Project ###
##############

add_subdirectory(src)
5 changes: 2 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
BSD 2-Clause License

Copyright (c) 2017, elucideye
Copyright (c) 2015, David Hirvonen
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand All @@ -23,3 +21,4 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

3 changes: 3 additions & 0 deletions bin/build-android.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

build.py --toolchain android-ndk-r10e-api-16-armeabi-v7a-neon-clang-35 --verbose --fwd HUNTER_CONFIGURATION_TYPES=Release ANDROID=TRUE --clear
5 changes: 5 additions & 0 deletions bin/build-libcxx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

build.py --toolchain libcxx --verbose --fwd HUNTER_CONFIGURATION_TYPES=Release --jobs 8 --clear --strip


11 changes: 11 additions & 0 deletions bin/build-xcode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

ARGS=(
--verbose
--fwd HUNTER_CONFIGURATION_TYPES=Release
--jobs 8
--reconfig
--install
)

build.py --toolchain xcode ${ARGS[@]} --open --nobuild
3 changes: 3 additions & 0 deletions bin/tags.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

find src -name "*.cpp" -or -name "*.h" -or -name "*.hpp" -or -name CMakeLists.txt | xargs etags --append
16 changes: 16 additions & 0 deletions cmake/Config.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@PACKAGE_INIT@

include(CMakeFindDependencyMacro)

find_dependency(xgboost CONFIG)

if(@XGBOOSTER_SERIALIZE_WITH_BOOST@)
find_dependency(boost-pba CONFIG)
endif()

if(@XGBOOSTER_SERIALIZE_WITH_CEREAL@)
find_dependency(cereal CONFIG REQUIRED)
endif()

include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
check_required_components("@PROJECT_NAME@")
Loading

0 comments on commit 7d4d6f2

Please sign in to comment.