From c26845520f5716e5f94c8e52dfd744466c5b5506 Mon Sep 17 00:00:00 2001 From: adegomme <13270544+adegomme@users.noreply.github.com> Date: Thu, 4 Jul 2019 16:24:05 +0200 Subject: [PATCH] Add windows to travis (#327) travis: compile on windows (and drop appveyor) --- .travis.yml | 21 +++++++++++++++----- src/bindings/java/org/simgrid/NativeLib.java | 4 ++-- tools/cmake/Java.cmake | 2 +- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4368a85e18..f0f882b45c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,11 +48,21 @@ addons: # - ls -lR $TRAVIS_BUILD_DIR/LuaInstall script: - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cmake -Denable_model-checking=OFF -Denable_documentation=OFF -Denable_coverage=ON -Denable_java=ON -Denable_lua=OFF -Denable_compile_optimizations=ON -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=OFF -Denable_compile_warnings=ON .; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cmake -Denable_model-checking=ON -Denable_documentation=OFF -Denable_coverage=ON -Denable_java=ON -Denable_lua=OFF -Denable_compile_optimizations=ON -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_compile_warnings=ON . || (echo XXX CMakeOutput.log; cat /home/travis/build/simgrid/simgrid/CMakeFiles/CMakeOutput.log; echo XXX CMakeError.log;cat /home/travis/build/simgrid/simgrid/CMakeFiles/CMakeError.log; exit 1) ; fi - # run make and ctest in the sonar wrapper on master/linux; run it directly in PR or OSX - # - if [[ -e Makefile ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "${TRAVIS_PULL_REQUEST}" == "false" ]]; then ./tools/internal/travis-sonarqube.sh make -j2 VERBOSE=1; else make -j2 VERBOSE=1 && ctest -j2 --output-on-failure ; fi - - make -j2 VERBOSE=1 all tests && ctest -j2 --output-on-failure + - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then + mv "C:/Program Files/Git/usr/bin/sh.exe" "sh-ignored.exe"; + choco install boost-msvc-12 python jdk8; + export CC=gcc; + export CXX=g++; + export PATH='C:\Python37':'C:\local\boost_1_58_0':$PATH; + export BOOST_LIBRARYDIR='C:/local/boost_1_58_0/lib64-msvc-12.0'; + export BOOST_INCLUDEDIR='C:/local/boost_1_58_0/include'; + export JAVA_HOME='C:/Program Files/Java/jdk1.8.0_211'; + cmake -G "MinGW Makefiles" -Denable_lua=OFF -Denable_documentation=OFF -Denable_java=ON -Denable_smpi=OFF -Denable_mallocators=OFF -Denable_lto=OFF .; + mingw32-make.exe VERBOSE=1 java-all; + ctest --output-on-failure -R java; + fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cmake -Denable_model-checking=OFF -Denable_documentation=OFF -Denable_coverage=ON -Denable_java=ON -Denable_lua=OFF -Denable_compile_optimizations=ON -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=OFF -Denable_compile_warnings=ON . && make -j2 VERBOSE=1 all tests && ctest -j2 --output-on-failure; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then (cmake -Denable_model-checking=ON -Denable_documentation=OFF -Denable_coverage=ON -Denable_java=ON -Denable_lua=OFF -Denable_compile_optimizations=ON -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_compile_warnings=ON . || (echo XXX CMakeOutput.log; cat /home/travis/build/simgrid/simgrid/CMakeFiles/CMakeOutput.log; echo XXX CMakeError.log;cat /home/travis/build/simgrid/simgrid/CMakeFiles/CMakeError.log; exit 1)) && make -j2 VERBOSE=1 all tests && ctest -j2 --output-on-failure ; fi notifications: recipients: - martin.quinson@ens-rennes.fr @@ -69,3 +79,4 @@ notifications: os: - linux - osx + - windows diff --git a/src/bindings/java/org/simgrid/NativeLib.java b/src/bindings/java/org/simgrid/NativeLib.java index d452dfec15..b67462ee11 100644 --- a/src/bindings/java/org/simgrid/NativeLib.java +++ b/src/bindings/java/org/simgrid/NativeLib.java @@ -163,9 +163,9 @@ public final class NativeLib { public void run() { try { for (File f : dir.listFiles()) - if (! f.delete() && !f.getAbsolutePath().contains("appveyor")) // Be silent on AppVeyor to not break the tests. Ugly trick :) + if (! f.delete() && !f.getAbsolutePath().contains("travis")) // Be silent on AppVeyor to not break the tests. Ugly trick :) System.out.println("Unable to clean temporary file "+f.getAbsolutePath()+" during shutdown."); - if (! dir.delete() && !dir.getAbsolutePath().contains("appveyor") ) + if (! dir.delete() && !dir.getAbsolutePath().contains("travis") ) System.out.println("Unable to clean temporary file "+dir.getAbsolutePath()+" during shutdown."); } catch(Exception e) { System.out.println("Error while cleaning temporary file "+dir.getAbsolutePath()+" during shutdown: "+e.getCause()); diff --git a/tools/cmake/Java.cmake b/tools/cmake/Java.cmake index c462643d1b..a254ff167f 100644 --- a/tools/cmake/Java.cmake +++ b/tools/cmake/Java.cmake @@ -137,7 +137,7 @@ if(WIN32) # So let's be brutal and copy it in any case (even on non-windows builds) from the location where appveyor provides it. # The copy is only expected to work on the appveyor builder, but that's all we need right now # since our users are directed to download that file as nightly build. - COMMAND ${CMAKE_COMMAND} -E copy_if_different C:/mingw-w64/x86_64-7.2.0-posix-seh-rt_v5-rev1/mingw64/bin/libwinpthread-1.dll ${JAVA_NATIVE_PATH}/libwinpthread-1.dll || true + COMMAND ${CMAKE_COMMAND} -E copy_if_different C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin/libwinpthread-1.dll ${JAVA_NATIVE_PATH}/libwinpthread-1.dll || true ) endif() -- 2.20.1