Skip to content

Commit

Permalink
Adding a CAD build to travis.
Browse files Browse the repository at this point in the history
  • Loading branch information
pshriwise committed Sep 21, 2018
1 parent 89381b8 commit aa5983a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
33 changes: 31 additions & 2 deletions tools/ci/travis-install.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import shutil
import subprocess

MOAB_VERSION= '5.0'

def which(program):
def is_exe(fpath):
Expand All @@ -20,7 +21,7 @@ def is_exe(fpath):
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')
Expand Down Expand Up @@ -48,22 +49,50 @@ 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))
subprocess.check_call(cmake_cmd)
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()
omp = (os.environ.get('OMP') == 'y')
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__':
Expand Down

0 comments on commit aa5983a

Please sign in to comment.