Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
172 lines (164 sloc) 5.02 KB
## ---------------------------------------------------------------------
##
## Copyright (C) 2017 by the molsturm authors
##
## This file is part of molsturm.
##
## molsturm is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published
## by the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## molsturm is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with molsturm. If not, see <http://www.gnu.org/licenses/>.
##
## ---------------------------------------------------------------------
language: cpp
sudo: required
dist: trusty
branches:
except:
- dev
- /^dev-.*$/
- /^dev_.*$/
env:
global:
# Use two threads in parallel
- CORES=2
#
# Use a known-to-work rapidcheck seed
- RC_PARAMS="seed=16920708173099178154 verbose_progress=1 noshrink=1"
#
# The regex for tests to run (disable running tests by TESTS=0)
- TESTS=1 TESTS_REGEX="molsturm"
# Cache the directory cache_libint, such that libint does not need
# to be rebuild each time.
cache:
directories:
$HOME/cache_libint
before_cache:
- cd ${TRAVIS_BUILD_DIR}
- .travis/update_cached_libint.sh
addons:
apt:
sources: &def_sources
- ubuntu-toolchain-r-test # libstdc++-4.9-dev (gcc 4.8's libstdc++ is buggy)
- llvm-toolchain-trusty-5.0 # clang-5.0
packages: &def_packages
- python3-pip
- ninja-build
#
# Packages for lazyten
- libarmadillo-dev
- libboost-dev
- liblapack-dev
- libblas-dev
#
# Packages for libint
- libeigen3-dev
#
# Packages for python interface
- swig
- python3-numpy
- python3-scipy
- python3-h5py
- python3-yaml
matrix:
include:
# System clang with disabled c++14 support with libstdc++-4.9
- addons:
apt:
sources: *def_sources
packages:
- *def_packages
- libstdc++-4.9-dev
install:
- export EXTRA_OPTS="-DDRB_MAXIMUM_CXX_STANDARD=11"
compiler: clang
env: CC_COMP="clang" CXX_COMP="clang++"
#
# TODO Here we used to test with libc++1 by installing libc++-dev,
# but this does not go well with libint any more
# Clang 5.0 with disabled c++17 support
- addons:
apt:
sources: *def_sources
packages:
- *def_packages
- &clang_newest [ clang-5.0, llvm-5.0, clang-tidy-5.0 ]
- libstdc++-5-dev
install:
- export EXTRA_OPTS="-DDRB_MAXIMUM_CXX_STANDARD=14"
compiler: clang
env: CC_COMP="clang-5.0" CXX_COMP="clang++-5.0"
#
# gcc-5
- addons:
apt:
sources: *def_sources
packages:
- *def_packages
- g++-5
compiler: gcc
env: CC_COMP="gcc-5" CXX_COMP="g++-5"
#
# gcc-7 (with tests and c++17)
- addons:
apt:
sources: *def_sources
packages:
- *def_packages
- g++-7
compiler: gcc
env: CC_COMP="gcc-7" CXX_COMP="g++-7"
#
# Clang-tidy 5.0
- addons:
apt:
sources: *def_sources
packages:
- *def_packages
- *clang_newest
install:
- export BUILD_TARGET="clang-tidy-molsturm"
- export TESTS=0
compiler: clang
env: CC_COMP="clang-5.0" CXX_COMP="clang++-5.0" BUILD_TARGET="clang-tidy-molsturm"
allow_failures:
- env: CC_COMP="clang-5.0" CXX_COMP="clang++-5.0" BUILD_TARGET="clang-tidy-molsturm"
script:
- cmake --version
- ninja --version
#
# Use libint from cache if it available
- if [ -e "$HOME/cache_libint/lib/libint2.a" ]; then
LIBINT_OPTS="-DGINT_LIBINT_USE_SYSTEM=ON
-DLIBINT_INCLUDE_DIR=$HOME/cache_libint/include
-DLIBINT_LIBRARY=$HOME/cache_libint/lib/libint2.a"
GEN_OPTS="-GNinja"
;else
LIBINT_OPTS="-DGINT_LIBINT_MAX_AM=3 -DDEP_BUILD_libint_NJOBS=2
-DGINT_LIBINT_MAX_MULTIPOLE=2"
;fi
#
# Configure and build.
- mkdir ${TRAVIS_BUILD_DIR}/build && cd ${TRAVIS_BUILD_DIR}/build
- cmake -DCMAKE_CXX_COMPILER=${CXX_COMP} -DCMAKE_C_COMPILER=${CC_COMP}
-DCMAKE_BUILD_TYPE=DebugRelease
-DAUTOCHECKOUT_MISSING_REPOS=ON
-DENABLE_EXAMPLES=OFF -DMOLSTURM_ENABLE_EXAMPLES=ON
-DENABLE_TESTS=OFF -DMOLSTURM_ENABLE_TESTS=ON
-DRC_ENABLE_TESTS=OFF
-DGINT_ENABLE_STATIC_INTEGRALS=ON
-DGINT_ENABLE_LIBCINT=ON
-DGINT_ENABLE_LIBINT=ON ${LIBINT_OPTS}
${EXTRA_OPTS} ${GEN_OPTS} ..
- travis_wait 30 cmake --build . --target ${BUILD_TARGET:-all} -- -j ${CORES}
- if [ "${TESTS}" != "0" ]; then
ctest -j ${CORES} --output-on-failure -R "${TESTS_REGEX}"
;else true; fi