Skip to content

Commit

Permalink
[fix] fix-#452 compilation issue on appveyor
Browse files Browse the repository at this point in the history
Add appveyor exmaple script with cmake
  • Loading branch information
benEnsta committed Apr 3, 2020
1 parent fd820d1 commit 5dfc9e0
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 25 deletions.
72 changes: 48 additions & 24 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,59 @@
version: build{build}
image: Visual Studio 2015
clone_folder: C:\projects\ibex-lib
test: off
configuration:
- Release

platform:
- x64

environment:
matrix:
- TEST_INTERVAL_LIB: "gaol"
- TEST_INTERVAL_LIB: "filib"
- CMAKE_PLATFORM: "Visual Studio 14 2015"
CPACK_PATH: 'C:\\Program Files (x86)\\CMake\\bin'
platform: x86
CPPUNIT_INCLUDE_DIR: C:\tools\vcpkg\installed\x86-windows\include
CPPUNIT_LIBRARY: C:\tools\vcpkg\installed\x86-windows\lib\cppunit_dll.lib
- CMAKE_PLATFORM: "Visual Studio 14 2015 Win64"
CPACK_PATH: 'C:\\Program Files (x86)\\CMake\\bin'
platform: x64
CPPUNIT_INCLUDE_DIR: C:\tools\vcpkg\installed\x64-windows\include
CPPUNIT_LIBRARY: C:\tools\vcpkg\installed\x64-windows\lib\cppunit_dll.lib

init:
- cmd: vcpkg cache
cache:
- C:\tools\vcpkg\installed\
install:
- cmd: echo %Platform%
- cmd: set MINGW-W64_BASE=C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0
- cmd: set PATH=%MINGW-W64_BASE%\mingw32\bin;C:\msys64\usr\bin;%PATH%
- cmd: uname -a
- cmd: pacman --noconfirm -S mingw32/mingw-w64-i686-cppunit
- cmd: set CPATH=%CPATH%;C:\msys64\mingw32\include
- cmd: set LIBRARY_PATH=%LIBRARY_PATH%;C:\msys64\mingw32\lib
- cmd: set PREFIX=%HOMEDRIVE%%HOMEPATH%
- vcpkg install cppunit:"%platform%"-windows
- choco install winflexbison

build_script:
- cmd: python -x %cd%\waf configure --interval-lib=%TEST_INTERVAL_LIB% --prefix=%PREFIX% --with-debug --with-ampl
- cmd: python -x %cd%\waf build install clean
- echo Running cmake...
- cd c:\projects\ibex-lib
- mkdir build
- cd build
- cmake -G "%CMAKE_PLATFORM%" -DCMAKE_BUILD_TYPE=Release -DINTERVAL_LIB=filib -DCPPUNIT_INCLUDE_DIR="%CPPUNIT_INCLUDE_DIR%" -DCPPUNIT_LIBRARY="%CPPUNIT_LIBRARY%" ../
- set MSBuildLogger="C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- set MSBuildOptions=/v:m /p:Configuration=%Configuration% /logger:%MSBuildLogger%
- msbuild %MSBuildOptions% PACKAGE.vcxproj
- set PATH=%CPACK_PATH%;%PATH% # conflit with choco pack alias. need to put cpack.exe first
- CPack.exe -G ZIP

test_script:
- cmd: set PKG_CONFIG_PATH=%PREFIX%\share\pkgconfig
# We need to add the path to libcppunit in PATH
- cmd: set PATH=%PATH%;C:\msys64\mingw32\bin
- cmd: python -x %cd%\waf utest
artifacts:
- path: build\ibex*.exe
name: ibex-lib
- path: build\ibex*.zip
name: ibex-lib-zip

on_failure:
- cmd: cat %cd%\__build__\config.log
- cmd: cat %cd%\__build__\utest_config.log
- cmd: cat %cd%\__build__\utest_run.log
# deploy:
# release: ibex-lib-v$(appveyor_build_version)
# description: 'ibexlib'
# provider: GitHub
# auth_token:
# secure: *******************************************

# artifact: ibex-lib,ibex-lib-zip
# draft: true
# prerelease: false
# on:
# branch: develop_test_appveyor # release from master branch only
# appveyor_repo_tag: false # deploy on tag push only
2 changes: 1 addition & 1 deletion src/combinatorial/ibex_QInter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ IntervalVector qinter(const Array<IntervalVector>& _boxes, int q) {
* Variables x[ind[i]] take successively the lower bounds of these intervals,
* either in the increasing or decreasing order.
* Hence, the index variable ind[i] varies within [0,size[i]-1]. */
int size[n];
std::vector<int> size(n);

for (int i=0; i<n; i++) {
x[i] = new double[2*p]; // by default, there are 2*p distinct bounds
Expand Down

0 comments on commit 5dfc9e0

Please sign in to comment.