From 488e25ea346c8006ada6f0409b4db800129add9c Mon Sep 17 00:00:00 2001 From: Cameron Smith Date: Wed, 29 Jan 2020 19:29:07 -0500 Subject: [PATCH] pumi: sim version check, meshes via submodule, ctest (#14597) * pumi: sim version check, meshes via submodule, ctest * Apply suggestions from code review Co-Authored-By: Adam J. Stewart * pumi: update comment on master version string * pumi: description of simmodsuite_version_check variant * pumi: add white space to variant description Co-authored-by: Adam J. Stewart --- .../repos/builtin/packages/pumi/package.py | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/var/spack/repos/builtin/packages/pumi/package.py b/var/spack/repos/builtin/packages/pumi/package.py index 191d0a31b4..f26c80670e 100644 --- a/var/spack/repos/builtin/packages/pumi/package.py +++ b/var/spack/repos/builtin/packages/pumi/package.py @@ -24,10 +24,8 @@ class Pumi(CMakePackage): # We will use the scorec/core master branch as the 'nightly' version # of pumi in spack. The master branch is more stable than the # scorec/core develop branch and we perfer not to expose spack users - # to the added instability. The spack version string is 'develop' since - # it compares greater than a numbered version (e.g., 2.1.0). The spack - # version string 'master' compares less than a numbered version. - version('develop', branch='master') + # to the added instability. + version('master', submodules=True, branch='master') version('2.2.1', commit='cd826205db21b8439026db1f6af61a8ed4a18564') # tag 2.2.1 version('2.2.0', commit='8c7e6f13943893b2bc1ece15003e4869a0e9634f') # tag 2.2.0 version('2.1.0', commit='840fbf6ec49a63aeaa3945f11ddb224f6055ac9f') @@ -41,6 +39,9 @@ class Pumi(CMakePackage): description="Enable Simmetrix SimModSuite Support: 'base' enables " "the minimum set of functionality, 'kernels' adds CAD kernel " "support to 'base', and 'full' enables all functionality.") + variant('simmodsuite_version_check', default=True, + description="Enable check of Simmetrix SimModSuite version. " + "Disable the check for testing new versions.") depends_on('mpi') depends_on('cmake@3:', type='build') @@ -69,7 +70,10 @@ def cmake_args(self): '-DCMAKE_Fortran_COMPILER=%s' % spec['mpi'].mpifc, '-DPUMI_FORTRAN_INTERFACE=%s' % ('ON' if '+fortran' in spec else 'OFF'), - '-DMDS_ID_TYPE=%s' % ('long' if '+int64' in spec else 'int') + '-DMDS_ID_TYPE=%s' % ('long' if '+int64' in spec else 'int'), + '-DSKIP_SIMMETRIX_VERSION_CHECK=%s' % + ('ON' if '~simmodsuite_version_check' in spec else 'OFF'), + '-DMESHES=%s' % join_path(self.stage.source_path, 'pumi_meshes') ] if self.spec.satisfies('simmodsuite=base'): args.append('-DENABLE_SIMMETRIX=ON') @@ -82,3 +86,11 @@ def cmake_args(self): mpi_id = spec['mpi'].name + spec['mpi'].version.string args.append('-DSIM_MPI=' + mpi_id) return args + + @run_after('build') + @on_package_attributes(run_tests=True) + def check(self): + """Run ctest after building project.""" + + with working_dir(self.build_directory): + ctest(parallel=False)