Browse Source

Use scripts from https://github.com/google/fruit

tempestpy_adaptions
Matthias Volk 8 years ago
parent
commit
bb5a363689
  1. 86
      .travis.yml
  2. 52
      travis/install_osx.sh
  3. 106
      travis/postsubmit-helper.sh
  4. 45
      travis/postsubmit.sh

86
.travis.yml

@ -1,30 +1,72 @@
sudo: required
#
# This file was inspired from https://github.com/google/fruit
#
branches:
only:
- master
dist: trusty
language: cpp language: cpp
matrix: matrix:
fast_finish: true
include: include:
# - compiler: gcc
# env: COMPILER=gcc-6 UBUNTU=17.04 TEST=DebugValgrind
# install: export OS=linux; export COMPILER='gcc-6'; export UBUNTU='17.04'; extras/scripts/travis_ci_install_linux.sh
# os: linux
# script: export OS=linux; export COMPILER='gcc-6'; export UBUNTU='17.04'; extras/scripts/postsubmit.sh
# DebugValgrind
# - compiler: gcc
# env: COMPILER=gcc-6 UBUNTU=17.04 TEST=DebugPlain
# install: export OS=linux; export COMPILER='gcc-6'; export UBUNTU='17.04'; extras/scripts/travis_ci_install_linux.sh
# os: linux
# script: export OS=linux; export COMPILER='gcc-6'; export UBUNTU='17.04'; extras/scripts/postsubmit.sh
# DebugPlain
# - compiler: gcc
# env: COMPILER=gcc-6 UBUNTU=17.04 TEST=ReleasePlain
# install: export OS=linux; export COMPILER='gcc-6'; export UBUNTU='17.04'; extras/scripts/travis_ci_install_linux.sh
# os: linux
# script: export OS=linux; export COMPILER='gcc-6'; export UBUNTU='17.04'; extras/scripts/postsubmit.sh
# ReleasePlain
# - compiler: clang
# env: COMPILER=clang-4.0 STL=libstdc++ UBUNTU=17.04 TEST=DebugPlain
# install: export OS=linux; export COMPILER='clang-4.0'; export STL='libstdc++';
# export UBUNTU='17.04'; extras/scripts/travis_ci_install_linux.sh
# os: linux
# script: export OS=linux; export COMPILER='clang-4.0'; export STL='libstdc++';
# export UBUNTU='17.04'; extras/scripts/postsubmit.sh DebugPlain
# - compiler: clang
# env: COMPILER=clang-4.0 STL=libstdc++ UBUNTU=17.04 TEST=ReleasePlain
# install: export OS=linux; export COMPILER='clang-4.0'; export STL='libstdc++';
# export UBUNTU='17.04'; extras/scripts/travis_ci_install_linux.sh
# os: linux
# script: export OS=linux; export COMPILER='clang-4.0'; export STL='libstdc++';
# export UBUNTU='17.04'; extras/scripts/postsubmit.sh ReleasePlain
# - compiler: gcc
# env: COMPILER=gcc-6 TEST=DebugPlain
# install: export OS=osx; export COMPILER='gcc-6'; export INSTALL_VALGRIND=1; extras/scripts/travis_ci_install_osx.sh
# os: osx
# osx_image: xcode8
# script: export OS=osx; export COMPILER='gcc-6'; export INSTALL_VALGRIND=1; extras/scripts/postsubmit.sh
# DebugPlain
- compiler: clang - compiler: clang
env: COMPILER=clang-4.0 STL=libc++ TEST=DebugPlain
install: export OS=osx; export COMPILER='clang-4.0'; export STL='libc++';
travis/install_osx.sh
os: osx os: osx
osx_image: xcode8 osx_image: xcode8
script: export OS=osx; export COMPILER='clang-4.0'; export STL='libc++';
travis/postsubmit.sh DebugPlain
# - compiler: clang
# env: COMPILER=clang-default STL=libc++ TEST=DebugPlain
# install: export OS=osx; export COMPILER='clang-default'; export STL='libc++';
# extras/scripts/travis_ci_install_osx.sh
# os: osx
# osx_image: xcode8.2
# script: export OS=osx; export COMPILER='clang-default'; export STL='libc++'; extras/scripts/postsubmit.sh
# DebugPlain
before_install:
- brew update
- brew install gmp --c++11
- brew install cln
- brew install ginac
- brew install doxygen
- brew install boost --c++11
- brew tap homebrew/science
- brew install homebrew/science/glpk
- brew install homebrew/science/hwloc
script:
- mkdir build
- cd build
- cmake ..
- make
# Linux
#- sudo apt-get update -qq
#- sudo apt-get install -qq git cmake libboost-all-dev libcln-dev libgmp-dev libginac-dev automake doxygen libglpk-dev libhwloc-dev
services:
- docker
sudo: required

52
travis/install_osx.sh

@ -0,0 +1,52 @@
#!/bin/bash -x
# Script installing dependencies
# Inspired by https://github.com/google/fruit
set -e
# Helper for installing packages via homebrew
install_brew_package() {
if brew list -1 | grep -q "^$1\$"; then
# Package is installed, upgrade if needed
brew outdated "$1" || brew upgrade "$@"
else
# Package not installed yet, install.
# If there are conflicts, try overwriting the files (these are in /usr/local anyway so it should be ok).
brew install "$@" || brew link --overwrite gcc49
fi
}
# Update packages
brew update
# For md5sum
install_brew_package md5sha1sum
# For `timeout'
install_brew_package coreutils
which cmake &>/dev/null || install_brew_package cmake
# Install compiler
case "${COMPILER}" in
gcc-4.8) install_brew_package gcc@4.8 ;;
gcc-4.9) install_brew_package gcc@4.9 ;;
gcc-5) install_brew_package gcc@5 ;;
gcc-6) install_brew_package gcc@6 ;;
clang-default) ;;
clang-3.7) install_brew_package llvm@3.7 --with-clang --with-libcxx;;
clang-3.8) install_brew_package llvm@3.8 --with-clang --with-libcxx;;
clang-3.9) install_brew_package llvm@3.9 --with-clang --with-libcxx;;
clang-4.0) install_brew_package llvm --with-clang --with-libcxx;;
*) echo "Compiler not supported: ${COMPILER}. See travis_ci_install_osx.sh"; exit 1 ;;
esac
# Install dependencies
install_brew_package gmp --c++11
install_brew_package cln
install_brew_package ginac
install_brew_package doxygen
install_brew_package boost --c++11
brew tap homebrew/science
install_brew_package homebrew/science/glpk
install_brew_package homebrew/science/hwloc

106
travis/postsubmit-helper.sh

@ -0,0 +1,106 @@
#!/bin/bash -x
# Inspired by https://github.com/google/fruit
set -e
# This only exists in OS X, but it doesn't cause issues in Linux (the dir doesn't exist, so it's
# ignored).
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
case $COMPILER in
gcc-4.8)
export CC=gcc-4.8
export CXX=g++-4.8
;;
gcc-4.9)
export CC=gcc-4.9
export CXX=g++-4.9
;;
gcc-5)
export CC=gcc-5
export CXX=g++-5
;;
gcc-6)
export CC=gcc-6
export CXX=g++-6
;;
clang-3.5)
export CC=clang-3.5
export CXX=clang++-3.5
;;
clang-3.6)
export CC=clang-3.6
export CXX=clang++-3.6
;;
clang-3.7)
export CC=clang-3.7
export CXX=clang++-3.7
;;
clang-3.8)
export CC=clang-3.8
export CXX=clang++-3.8
;;
clang-3.9)
export CC=clang-3.9
export CXX=clang++-3.9
;;
clang-4.0)
case "$OS" in
linux)
export CC=clang-4.0
export CXX=clang++-4.0
;;
osx)
export CC=/usr/local/opt/llvm/bin/clang-4.0
export CXX=/usr/local/opt/llvm/bin/clang++
;;
*) echo "Error: unexpected OS: $OS"; exit 1 ;;
esac
;;
clang-default)
export CC=clang
export CXX=clang++
;;
*)
echo "Unrecognized value of COMPILER: $COMPILER"
exit 1
esac
run_make() {
make -j$N_JOBS
}
# Build
echo CXX version: $($CXX --version)
echo C++ Standard library location: $(echo '#include <vector>' | $CXX -x c++ -E - | grep 'vector\"' | awk '{print $3}' | sed 's@/vector@@;s@\"@@g' | head -n 1)
echo Normalized C++ Standard library location: $(readlink -f $(echo '#include <vector>' | $CXX -x c++ -E - | grep 'vector\"' | awk '{print $3}' | sed 's@/vector@@;s@\"@@g' | head -n 1))
case "$1" in
DebugPlain) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="$STLARG") ;;
ReleasePlain) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="$STLARG") ;;
*) echo "Error: you need to specify one of the supported postsubmit modes (see postsubmit.sh)."; exit 1 ;;
esac
rm -rf build
mkdir build
cd build
cmake .. "${CMAKE_ARGS[@]}"
echo
echo "Content of CMakeFiles/CMakeError.log:"
if [ -f "CMakeFiles/CMakeError.log" ]
then
cat CMakeFiles/CMakeError.log
fi
echo
run_make

45
travis/postsubmit.sh

@ -0,0 +1,45 @@
#!/bin/bash
# Inspired by https://github.com/google/fruit
set -e
: ${N_JOBS:=2}
if [ "$STL" != "" ]
then
STLARG="-stdlib=$STL"
fi
case $OS in
linux)
echo "Linux currently unsupported"
exit 2
# docker rm -f fruit &>/dev/null || true
# docker run -d -it --name fruit --privileged polettimarco/fruit-basesystem:ubuntu-$UBUNTU
# docker exec fruit mkdir fruit
# docker cp . fruit:/fruit
#
# docker exec fruit bash -c "
# export COMPILER=$COMPILER;
# export N_JOBS=$N_JOBS;
# export STLARG=$STLARG;
# export ASAN_OPTIONS=$ASAN_OPTIONS;
# export OS=$OS;
# cd fruit; extras/scripts/postsubmit-helper.sh $1"
# exit $?
;;
osx)
export COMPILER
export N_JOBS
export STLARG
export ASAN_OPTIONS
export OS
extras/scripts/postsubmit-helper.sh "$@"
exit $?
;;
*)
echo "Unsupported OS: $OS"
exit 1
esac
Loading…
Cancel
Save