Commit 63e446a6 authored by Laurent Belcour's avatar Laurent Belcour

[CI] Update the AppVeyor and Travis script to incorporate both scons and cmake builds.

parent 12d5ab6e
os:
- Visual Studio 2015
- Visual Studio 2017
build:
verbosity: detailed
environment:
matrix:
- builder: cmake
- builder: scons
init:
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
install:
- SET "PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
- python --version
......@@ -12,10 +20,17 @@ install:
- pip install -U wheel
- pip install scons==2.4.1
- cinst nsis.portable
- hg clone https://bitbucket.org/eigen/eigen external\eigen3
- cd external\eigen3
- mkdir build & cd build
- cmake .. -DCMAKE_INSTALL_PREFIX="..\..\build" -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles"
- nmake install
- cd ..\..\..\
- dir
before_build:
# BOOST Python require x86 compilation
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
#- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
#- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
# Build script
......@@ -30,23 +45,33 @@ build_script:
#- dir C:\Python27\libs
#- dir C:\Libraries\boost_1_63_0
#- dir C:\Libraries\boost_1_63_0\lib64-msvc-14.0
- scons --cfg=./configs/scons/config-windows-appveyor.py
- appveyor PushArtifact config.log
- if "%builder%" == "scons" (
scons --cfg=./configs/scons/config-windows-appveyor.py &
appveyor PushArtifact config.log
)
# Install CERES
- cd external
- git clone https://ceres-solver.googlesource.com/ceres-solver
- cd ceres-solver
- mkdir build-ceres
- cd build-ceres
- cmake .. -DBUILD_SHARED_LIBS=ON -DMINIGLOG=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_INSTALL_PREFIX="..\..\build" -DEIGEN_INCLUDE_DIR="..\..\build\include" -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles"
- nmake install
- cd ..\..\..
# - cd external
# - git clone https://ceres-solver.googlesource.com/ceres-solver
# - cd ceres-solver
# - mkdir build-ceres
# - cd build-ceres
# - cmake .. -DBUILD_SHARED_LIBS=ON -DMINIGLOG=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_INSTALL_PREFIX="..\..\build" -DEIGEN_INCLUDE_DIR="..\..\build\include" -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles"
# - nmake install
# - cd ..\..\..
# - dir
# Rebuild with CERES and Python
- scons --cfg=./configs/scons/config-windows-appveyor.py
#- scons --cfg=./configs/scons/config-windows-appveyor.py python
- appveyor PushArtifact config.log
- if "%builder%" == "scons" (
scons --cfg=./configs/scons/config-windows-appveyor.py &
appveyor PushArtifact config.log
) else (
mkdir build &
cd build &
cmake .. -DEIGEN3_INCLUDE_DIR="external/build/include/eigen3" -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles" &
nmake &
cd ..
)
# Generate product
- makensis sources\scripts\installer.nsi
......@@ -57,11 +82,22 @@ build_script:
#
test_script:
- ./setpath.bat
- scons --cfg=./configs/scons/config-windows-appveyor.py tests
#- scons --cfg=./configs/scons/config-windows-appveyor.py python tests
- if "%builder%" == "scons" (
scons --cfg=./configs/scons/config-windows-appveyor.py tests
) else
cd build &
nmake test &
cd ..
)
artifacts:
- path: sources\scripts\ALTA.exe
name: ALTA
- path: config.log
name: Log
on_failure:
- ls
- if "%builder%" == "cmake" (
more Testing\Temporary\LastText.log
)
language: cpp
matrix:
include:
- os: linux
dist: trusty
sudo: required
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
- cmake
- libboost-python-dev
- os: osx
before_install:
- brew update
- brew install scons
env:
- builder=scons
- builder=cmake
os:
- linux
- osx
dist: trusty
sudo: required
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
- cmake
- libboost-python-dev
- libeigen3-dev
before_install:
- OMP_NUM_THREADS=2
- eval "${MATRIX_EVAL}"
#- sudo apt-get update -qq -y
#- sudo apt-get install -qq -y libopenexr-dev cmake libboost-python-dev libnlopt-dev coinor-libipopt-dev liblapack-dev libblas-dev libgfortran-4.8-dev
- echo "${builder}"
- if [ ${TRAVIS_OS_NAME} = 'osx' ]; then
brew update;
brew install scons eigen;
fi
script:
- git submodule init
- git submodule update
- scons
- scons tests
#- scons tests python -i
- if [ ${builder} = 'scons' ]; then
scons;
scons tests;
else
mkdir build;
cd build;
cmake ..;
make -i;
make test;
fi
after_failure:
- cat config.log
- if [ ${builder} = 'scons' ]; then
cat config.log;
else
cat Testing/Temporary/LastTest.log
fi
......@@ -27,3 +27,4 @@ export ALTA_PLUGIN_PATH="$builddir/plugins"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$builddir/plugins:$external"
export PATH="$PATH:$builddir/softs:$scripts"
export PYTHONPATH="$PYTHONPATH:$builddir/python"
export JUPYTER_PATH="$JUPYTER_PATH:$builddir/python"
......@@ -48,10 +48,11 @@ static ptr<data> get_data(const std::string& plugin_name, size_t size,
*/
inline void register_data(py::module& m) {
py::class_<data, ptr<data>>(m, "data")
.def("size", &data::size)
.def("get", &data::get)
.def("set", &data::set)
.def("save", &data::save)
.def("size", &data::size)
.def("get", &data::get)
.def("set", &data::set)
.def("value", &data::value)
.def("save", &data::save)
.def("parametrization", &data::parametrization);
m.def("get_data", get_data);
m.def("get_data", get_data_with_args);
......
......@@ -63,7 +63,7 @@ inline void register_vec(py::module& m) {
}))
.def("__add__", &vec_add)
.def("__sub__", &vec_sub)
.def("__len__", &vec::size)
// .def("__len__", &vec::size)
.def("__getitem__", [](const vec &s, unsigned int i) {
if (i >= s.size()) throw py::index_error();
return s[i];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment