Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .ci/.ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,32 @@ jobs:
- job: Linux
timeoutInMinutes: 360
pool:
vmImage: 'ubuntu-latest'
vmImage: ubuntu-16.04

steps:
- template: linux-steps.yaml

- job: macOS
timeoutInMinutes: 360
pool:
vmImage: macOS-10.14
vmImage: macOS-latest

steps:
- template: macos-steps.yaml

# Windows build.
- job: WindowsVS15
- job: WindowsVS16
timeoutInMinutes: 360
displayName: Windows VS15
displayName: Windows VS16
pool:
vmImage: vs2017-win2016
vmImage: windows-2019

strategy:
matrix:
Plain:
CMakeArgs-mlpack: '-DDEBUG=ON -DPROFILE=OFF -DBUILD_PYTHON_BINDINGS=OFF -DBUILD_TESTS=OFF'
CMakeGenerator: '-G "Visual Studio 15 2017 Win64"'
MSBuildVersion: '15.0'
CMakeGenerator: '-G "Visual Studio 16 2019"'
MSBuildVersion: '16.0'

steps:
- template: windows-steps.yaml
9 changes: 7 additions & 2 deletions .ci/linux-steps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,17 @@ steps:
sudo apt-get install -y --allow-unauthenticated liblapack-dev g++ libboost1.70-dev libarmadillo-dev xz-utils
curl https://data.kurg.org/armadillo-8.400.0.tar.xz | tar -xvJ && cd armadillo*
cmake . && make && sudo make install && cd ..

# Install cereal.
wget https://github.com/USCiLab/cereal/archive/v1.3.0.tar.gz
tar -xvzpf v1.3.0.tar.gz # Unpack into cereal-1.3.0/.
cd cereal-1.3.0/
displayName: 'Install Build Dependencies'

# Configure CMake Args for mlpack.
- script: |
unset BOOST_ROOT
cd mlpack && mkdir build && cd build && cmake $(CMakeArgs-mlpack) ..
cd mlpack && mkdir build && cd build && cmake $(CMakeArgs-mlpack) -DCEREAL_INCLUDE_DIR=../../cereal-1.3.0/include/ ..
displayName: 'CMake for mlpack'

# Install mlpack
Expand All @@ -38,7 +43,7 @@ steps:
displayName: 'Installing Protobuf'

# Configure mlboard (CMake)
- script: mkdir build && cd build && cmake ..
- script: mkdir build && cd build && cmake -DCEREAL_INCLUDE_DIR=../cereal-1.3.0/include/ ..
displayName: 'CMake for mlboard'

# Build mlboard
Expand Down
10 changes: 7 additions & 3 deletions .ci/macos-steps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ steps:
# Install mlpack from master to get new functionalities instantly.
- script: |
set -e
sudo xcode-select --switch /Applications/Xcode_10.1.app/Contents/Developer
sudo xcode-select --switch /Applications/Xcode_12.2.app/Contents/Developer
unset BOOST_ROOT
pip install cython numpy pandas zipp configparser
brew install openblas armadillo boost
if [ "$(binding)" == "python" ]; then
pip install --upgrade pip
pip install cython numpy pandas zipp configparser
fi

brew install openblas armadillo boost cereal
git clone --depth 1 https://github.com/mlpack/jenkins-conf.git conf
git clone --depth 1 https://github.com/mlpack/mlpack.git
displayName: 'Install Build Dependencies'
Expand Down
14 changes: 6 additions & 8 deletions .ci/windows-steps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,26 @@ steps:
- powershell: |
nuget install OpenBLAS -o $(Agent.ToolsDirectory)
nuget install boost -o $(Agent.ToolsDirectory) -Version 1.60.0
nuget install boost_unit_test_framework-vc140 -o $(Agent.ToolsDirectory) -Version 1.60.0
nuget install boost_program_options-vc140 -o $(Agent.ToolsDirectory) -Version 1.60.0
nuget install boost_random-vc140 -o $(Agent.ToolsDirectory) -Version 1.60.0
nuget install boost_serialization-vc140 -o $(Agent.ToolsDirectory) -Version 1.60.0
nuget install boost_math_c99-vc140 -o $(Agent.ToolsDirectory) -Version 1.60.0
nuget install boost_filesystem-vc140 -o $(Agent.ToolsDirectory) -Version 1.60.0
nuget install boost_system-vc140 -o $(Agent.ToolsDirectory) -Version 1.60.0
nuget install boost_date_time-vc140 -o $(Agent.ToolsDirectory) -Version 1.60.0
nuget install boost_regex-vc140 -o $(Agent.ToolsDirectory) -Version 1.60.0
nuget install OpenBLAS -o $(Agent.ToolsDirectory)
nuget install unofficial-flayan-cereal -o $(Agent.ToolsDirectory)

mkdir -p $(Agent.ToolsDirectory)/boost_libs
cp $(Agent.ToolsDirectory)/boost_program_options-vc140.1.60.0.0/lib/native/address-model-64/lib/*.* $(Agent.ToolsDirectory)/boost_libs
cp $(Agent.ToolsDirectory)/boost_math_c99-vc140.1.60.0.0/lib/native/address-model-64/lib/*.* $(Agent.ToolsDirectory)/boost_libs
cp $(Agent.ToolsDirectory)/boost_random-vc140.1.60.0.0/lib/native/address-model-64/lib/*.* $(Agent.ToolsDirectory)/boost_libs
cp $(Agent.ToolsDirectory)/boost_serialization-vc140.1.60.0.0/lib/native/address-model-64/lib/*.* $(Agent.ToolsDirectory)/boost_libs
cp $(Agent.ToolsDirectory)/boost_unit_test_framework-vc140.1.60.0.0/lib/native/address-model-64/lib/*.* $(Agent.ToolsDirectory)/boost_libs
cp $(Agent.ToolsDirectory)/boost_filesystem-vc140.1.60.0.0/lib/native/address-model-64/lib/*.* $(Agent.ToolsDirectory)/boost_libs
cp $(Agent.ToolsDirectory)/boost_system-vc140.1.60.0.0/lib/native/address-model-64/lib/*.* $(Agent.ToolsDirectory)/boost_libs
cp $(Agent.ToolsDirectory)/boost_date_time-vc140.1.60.0.0/lib/native/address-model-64/lib/*.* $(Agent.ToolsDirectory)/boost_libs
cp $(Agent.ToolsDirectory)/boost_regex-vc140.1.60.0.0/lib/native/address-model-64/lib/*.* $(Agent.ToolsDirectory)/boost_libs

git clone https://github.com/tronkko/dirent.git
cp "dirent/include/dirent.h" "C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.16.27023/include"
cp "dirent/include/dirent.h" "C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.16.27023/include"
cp "dirent/include/dirent.h" "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.28.29333/include"
cp "dirent/include/dirent.h" "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.28.29333/include"
cp "dirent/include/dirent.h" "C:/Program Files (x86)/include"
cp "dirent/include/dirent.h" "C:/Program Files/include"
displayName: 'Fetch build dependencies'
Expand Down Expand Up @@ -79,9 +74,11 @@ steps:
-DLAPACK_LIBRARIES:FILEPATH=$(Agent.ToolsDirectory)\OpenBLAS.0.2.14.1\lib\native\lib\x64\libopenblas.dll.a `
-DARMADILLO_INCLUDE_DIR="..\..\armadillo-8.400.0\include" `
-DARMADILLO_LIBRARY="..\..\armadillo-8.400.0\Release\armadillo.lib" `
-DCEREAL_INCLUDE_DIR=$(Agent.ToolsDirectory)\unofficial-flayan-cereal.1.2.2\build\native\include `
-DBOOST_INCLUDEDIR=$(Agent.ToolsDirectory)\boost.1.60.0.0\lib\native\include `
-DBOOST_LIBRARYDIR=$(Agent.ToolsDirectory)\boost_libs `
-DBUILD_JULIA_BINDINGS=OFF `
-DBUILD_R_BINDINGS=OFF `
-DCMAKE_BUILD_TYPE=Release ..
displayName: 'Configure mlpack'

Expand Down Expand Up @@ -140,6 +137,7 @@ steps:
-DBOOST_LIBRARYDIR=$(Agent.ToolsDirectory)\boost_libs `
-DARMADILLO_INCLUDE_DIR="..\armadillo-8.400.0\include" `
-DARMADILLO_LIBRARY="..\armadillo-8.400.0\Release\armadillo.lib" `
-DCEREAL_INCLUDE_DIR=$(Agent.ToolsDirectory)\unofficial-flayan-cereal.1.2.2\build\native\include `
-DProtobuf_INCLUDE_DIR="..\protobuf\src\" `
-DPROTOBUF_LIBRARY="$(Agent.ToolsDirectory)\boost_libs\libprotobuf.lib" `
-DProtobuf_PROTOC_EXECUTABLE="..\protobuf\cmake\solution\Release\protoc.exe" `
Expand Down
56 changes: 56 additions & 0 deletions CMake/Findcereal.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#Findcereal.cmake
find_path(CEREAL_INCLUDE_DIR
NAMES cereal
PATHS "$ENV{ProgramFiles}/cereal/include"
)

if(CEREAL_INCLUDE_DIR)
# ------------------------------------------------------------------------
# Extract version information from <CEREAL>
# ------------------------------------------------------------------------
set(CEREAL_FOUND YES)
set(CEREAL_VERSION_MAJOR 0)
set(CEREAL_VERSION_MINOR 0)
set(CEREAL_VERSION_PATCH 0)

if(EXISTS "${CEREAL_INCLUDE_DIR}/cereal/version.hpp")

# Read and parse cereal version header file for version number
file(READ "${CEREAL_INCLUDE_DIR}/cereal/version.hpp"
_CEREAL_HEADER_CONTENTS)
string(REGEX REPLACE ".*#define CEREAL_VERSION_MAJOR ([0-9]+).*" "\\1"
CEREAL_VERSION_MAJOR "${_CEREAL_HEADER_CONTENTS}")
string(REGEX REPLACE ".*#define CEREAL_VERSION_MINOR ([0-9]+).*" "\\1"
CEREAL_VERSION_MINOR "${_CEREAL_HEADER_CONTENTS}")
string(REGEX REPLACE ".*#define CEREAL_VERSION_PATCH ([0-9]+).*" "\\1"
CEREAL_VERSION_PATCH "${_CEREAL_HEADER_CONTENTS}")

elseif(EXISTS "${CEREAL_INCLUDE_DIR}/cereal/details/polymorphic_impl_fwd.hpp")

set(CEREAL_VERSION_MAJOR 1)
set(CEREAL_VERSION_MINOR 2)
set(CEREAL_VERSION_PATCH 0)
elseif(EXISTS "${CEREAL_INCLUDE_DIR}/cereal/types/valarray.hpp")

set(CEREAL_VERSION_MAJOR 1)
set(CEREAL_VERSION_MINOR 1)
set(CEREAL_VERSION_PATCH 2)
elseif(EXISTS "${CEREAL_INCLUDE_DIR}/cereal/cereal.hpp")

set(CEREAL_VERSION_MAJOR 1)
set(CEREAL_VERSION_MINOR 1)
set(CEREAL_VERSION_PATCH 1)
else()

set(CEREAL_FOUND NO)
endif()
set(CEREAL_VERSION_STRING "${CEREAL_VERSION_MAJOR}.${CEREAL_VERSION_MINOR}.${CEREAL_VERSION_PATCH}")
endif ()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(cereal
REQUIRED_VARS CEREAL_INCLUDE_DIR
VERSION_VAR CEREAL_VERSION_STRING
)

mark_as_advanced(CEREAL_INCLUDE_DIR)
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ project(mlboard
# Set required C++ standard to C++11.
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CEREAL_VERSION "1.1.2")

# Include modules in the CMake directory.
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMake")
Expand Down Expand Up @@ -63,11 +64,9 @@ endif()
# Remove this when serialization is removed from mlpack.
set(Boost_ADDITIONAL_VERSIONS
"1.49.0" "1.50.0" "1.51.0" "1.52.0" "1.53.0" "1.54.0" "1.55.0")
find_package(Boost 1.49
COMPONENTS
serialization
REQUIRED
)
find_package(Boost 1.49)

find_package(cereal "${CEREAL_VERSION}" REQUIRED)

# In Visual Studio, automatic linking is performed, so we don't need to worry
# about it. Clear the list of libraries to link against and let Visual Studio
Expand Down Expand Up @@ -96,6 +95,7 @@ add_subdirectory(include/proto)
include_directories(${CMAKE_CURRENT_BINARY_DIR})

set(MLBOARD_INCLUDE_DIRS ${MLPACK_INCLUDE_DIR}
${CEREAL_INCLUDE_DIR}
${ARMADILLO_INCLUDE_DIR}
${PROTOBUF_INCLUDE_DIR}
)
Expand Down