From aa5983ad0b024ab6dba8690e6967a9590f38ebbb Mon Sep 17 00:00:00 2001 From: shriwise Date: Fri, 6 Jul 2018 11:01:35 -0500 Subject: [PATCH] Adding a CAD build to travis. --- .travis.yml | 5 +++++ tools/ci/travis-install.py | 33 +++++++++++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index aacf9fa72..bebdc3a2d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,8 +35,13 @@ env: - OMP=y MPI=n PHDF5=n - OMP=n MPI=y PHDF5=n - OMP=n MPI=y PHDF5=y + - OMP=n MPI=y PHDF5=y CAD=y notifications: webhooks: https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN +before_install: + - sudo add-apt-repository ppa:nschloe/hdf5-backports -y + - sudo apt-get update -q + - sudo apt-get install libhdf5-serial-dev libhdf5-mpich-dev -y install: - ./tools/ci/travis-install.sh before_script: diff --git a/tools/ci/travis-install.py b/tools/ci/travis-install.py index 15e4d576b..7985a3600 100644 --- a/tools/ci/travis-install.py +++ b/tools/ci/travis-install.py @@ -2,6 +2,7 @@ import os import shutil import subprocess +MOAB_VERSION= '5.0' def which(program): def is_exe(fpath): @@ -20,7 +21,7 @@ def which(program): return None -def install(omp=False, mpi=False, phdf5=False): +def install(omp=False, mpi=False, phdf5=False, cad=False): # Create build directory and change to it shutil.rmtree('build', ignore_errors=True) os.mkdir('build') @@ -48,6 +49,9 @@ def install(omp=False, mpi=False, phdf5=False): else: cmake_cmd.append('-DHDF5_PREFER_PARALLEL=OFF') + if cad: + build_dagmc() + # Build and install cmake_cmd.append('..') print(' '.join(cmake_cmd)) @@ -55,6 +59,29 @@ def install(omp=False, mpi=False, phdf5=False): subprocess.check_call(['make', '-j']) subprocess.check_call(['sudo', 'make', 'install']) +def build_dagmc(): + + current_dir = os.getcwd() + home_dir = os.environ['HOME'] + + os.chdir(home_dir) + os.mkdir('MOAB') + os.chdir('MOAB') + + clone_cmd = ['git', 'clone', '-b', 'Version'+MOAB_VERSION, 'https://bitbucket.org/fathomteam/moab'] + subprocess.check_call(clone_cmd) + + os.mkdir('build') + os.chdir('build') + + cmake_cmd = ['cmake', '../moab', '-DENABLE_HDF5=ON', '-DENABLE_TOOLS=ON', '-DCMAKE_INSTALL_PREFIX='+home_dir] + subprocess.check_call(cmake_cmd) + + subprocess.check_call(['make', '-j']) + + subprocess.check_call(['make', 'test']) + + subprocess.check_call(['make', 'test']) def main(): # Convert Travis matrix environment variables into arguments for install() @@ -62,8 +89,10 @@ def main(): mpi = (os.environ.get('MPI') == 'y') phdf5 = (os.environ.get('PHDF5') == 'y') + cad = (os.environ.get('CAD') == 'y') + # Build and install - install(omp, mpi, phdf5) + install(omp, mpi, phdf5, cad) if __name__ == '__main__':