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: os:
- Visual Studio 2015 - Visual Studio 2017
build: build:
verbosity: detailed verbosity: detailed
environment:
matrix:
- builder: cmake
- builder: scons
init:
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
install: install:
- SET "PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - SET "PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
- python --version - python --version
...@@ -12,10 +20,17 @@ install: ...@@ -12,10 +20,17 @@ install:
- pip install -U wheel - pip install -U wheel
- pip install scons==2.4.1 - pip install scons==2.4.1
- cinst nsis.portable - 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: before_build:
# BOOST Python require x86 compilation # 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 #- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
# Build script # Build script
...@@ -30,23 +45,33 @@ build_script: ...@@ -30,23 +45,33 @@ build_script:
#- dir C:\Python27\libs #- dir C:\Python27\libs
#- dir C:\Libraries\boost_1_63_0 #- dir C:\Libraries\boost_1_63_0
#- dir C:\Libraries\boost_1_63_0\lib64-msvc-14.0 #- dir C:\Libraries\boost_1_63_0\lib64-msvc-14.0
- scons --cfg=./configs/scons/config-windows-appveyor.py - if "%builder%" == "scons" (
- appveyor PushArtifact config.log scons --cfg=./configs/scons/config-windows-appveyor.py &
appveyor PushArtifact config.log
)
# Install CERES # Install CERES
- cd external # - cd external
- git clone https://ceres-solver.googlesource.com/ceres-solver # - git clone https://ceres-solver.googlesource.com/ceres-solver
- cd ceres-solver # - cd ceres-solver
- mkdir build-ceres # - mkdir build-ceres
- cd 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" # - 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 # - nmake install
- cd ..\..\.. # - cd ..\..\..
# - dir
# Rebuild with CERES and Python # Rebuild with CERES and Python
- scons --cfg=./configs/scons/config-windows-appveyor.py - if "%builder%" == "scons" (
#- scons --cfg=./configs/scons/config-windows-appveyor.py python scons --cfg=./configs/scons/config-windows-appveyor.py &
- appveyor PushArtifact config.log 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 # Generate product
- makensis sources\scripts\installer.nsi - makensis sources\scripts\installer.nsi
...@@ -57,11 +82,22 @@ build_script: ...@@ -57,11 +82,22 @@ build_script:
# #
test_script: test_script:
- ./setpath.bat - ./setpath.bat
- scons --cfg=./configs/scons/config-windows-appveyor.py tests - if "%builder%" == "scons" (
#- scons --cfg=./configs/scons/config-windows-appveyor.py python tests scons --cfg=./configs/scons/config-windows-appveyor.py tests
) else
cd build &
nmake test &
cd ..
)
artifacts: artifacts:
- path: sources\scripts\ALTA.exe - path: sources\scripts\ALTA.exe
name: ALTA name: ALTA
- path: config.log - path: config.log
name: Log name: Log
on_failure:
- ls
- if "%builder%" == "cmake" (
more Testing\Temporary\LastText.log
)
language: cpp language: cpp
matrix: env:
include: - builder=scons
- os: linux - builder=cmake
dist: trusty os:
sudo: required - linux
addons: - osx
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
- cmake
- libboost-python-dev
- os: osx
before_install:
- brew update
- brew install scons
dist: trusty
sudo: required
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
- cmake
- libboost-python-dev
- libeigen3-dev
before_install: before_install:
- OMP_NUM_THREADS=2 - OMP_NUM_THREADS=2
- eval "${MATRIX_EVAL}" - eval "${MATRIX_EVAL}"
#- sudo apt-get update -qq -y - echo "${builder}"
#- 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 - if [ ${TRAVIS_OS_NAME} = 'osx' ]; then
brew update;
brew install scons eigen;
fi
script: script:
- git submodule init - git submodule init
- git submodule update - git submodule update
- scons - if [ ${builder} = 'scons' ]; then
- scons tests scons;
#- scons tests python -i scons tests;
else
mkdir build;
cd build;
cmake ..;
make -i;
make test;
fi
after_failure: 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" ...@@ -27,3 +27,4 @@ export ALTA_PLUGIN_PATH="$builddir/plugins"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$builddir/plugins:$external" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$builddir/plugins:$external"
export PATH="$PATH:$builddir/softs:$scripts" export PATH="$PATH:$builddir/softs:$scripts"
export PYTHONPATH="$PYTHONPATH:$builddir/python" 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, ...@@ -48,10 +48,11 @@ static ptr<data> get_data(const std::string& plugin_name, size_t size,
*/ */
inline void register_data(py::module& m) { inline void register_data(py::module& m) {
py::class_<data, ptr<data>>(m, "data") py::class_<data, ptr<data>>(m, "data")
.def("size", &data::size) .def("size", &data::size)
.def("get", &data::get) .def("get", &data::get)
.def("set", &data::set) .def("set", &data::set)
.def("save", &data::save) .def("value", &data::value)
.def("save", &data::save)
.def("parametrization", &data::parametrization); .def("parametrization", &data::parametrization);
m.def("get_data", get_data); m.def("get_data", get_data);
m.def("get_data", get_data_with_args); m.def("get_data", get_data_with_args);
......
...@@ -63,7 +63,7 @@ inline void register_vec(py::module& m) { ...@@ -63,7 +63,7 @@ inline void register_vec(py::module& m) {
})) }))
.def("__add__", &vec_add) .def("__add__", &vec_add)
.def("__sub__", &vec_sub) .def("__sub__", &vec_sub)
.def("__len__", &vec::size) // .def("__len__", &vec::size)
.def("__getitem__", [](const vec &s, unsigned int i) { .def("__getitem__", [](const vec &s, unsigned int i) {
if (i >= s.size()) throw py::index_error(); if (i >= s.size()) throw py::index_error();
return s[i]; 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