diff options
author | Ondřej Čertík <ondrej@certik.us> | 2017-10-26 13:50:18 -0600 |
---|---|---|
committer | Christoph Junghans <christoph.junghans@gmail.com> | 2017-10-26 13:50:18 -0600 |
commit | 0e464f86bbd62bb6bb6369841cb213be503aa55d (patch) | |
tree | 39d1d12cc7d3888e485cfaa817773e554b58424b /var | |
parent | 8e47b17a4d45adc712ef0c81b3f5de833bd9e5ca (diff) | |
download | spack-0e464f86bbd62bb6bb6369841cb213be503aa55d.tar.gz spack-0e464f86bbd62bb6bb6369841cb213be503aa55d.tar.bz2 spack-0e464f86bbd62bb6bb6369841cb213be503aa55d.tar.xz spack-0e464f86bbd62bb6bb6369841cb213be503aa55d.zip |
Exodus: skip the -G "Unix Makefiles" part (#5906)
* Exodus: skip the -G "Unix Makefiles" part
The problem is that spack passes -G "Unix Makefiles" into cmake, which normally
works. But in the Exodus package, it is being passed into a bash wrapper
script. In there, the $@ then loses the information about "Unix Makefiles"
being just one argument, and in effect passes -G Unix Makefiles into the cmake
(without quotes), and so cmake only sees -G Unix, and then fails. This is a
known problem with bash with no simple solutions. As a workaround, this patch
skips the first two arguments, i.e., -G and "Unix Makefiles". This makes it
work.
Fixes #5895.
* Port exodusii to cmake
The cmake options were taken from the cmake-exodus bash script and ported to
spack directly.
* Use variant forwarding to forward the 'mpi'
Now instead of
spack install exodusii~mpi^netcdf~mpi^hdf5~mpi
one can just use
spack install exodusii~mpi
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/exodusii/cmake-exodus.patch | 9 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/exodusii/package.py | 36 |
2 files changed, 16 insertions, 29 deletions
diff --git a/var/spack/repos/builtin/packages/exodusii/cmake-exodus.patch b/var/spack/repos/builtin/packages/exodusii/cmake-exodus.patch deleted file mode 100644 index 014381de88..0000000000 --- a/var/spack/repos/builtin/packages/exodusii/cmake-exodus.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff --git a/cmake-exodus b/cmake-exodus -index 67ccd34..9b749e3 100755 ---- a/cmake-exodus -+++ b/cmake-exodus -@@ -1,3 +1,4 @@ -+#!/bin/bash - EXTRA_ARGS=$@ - - ### The following assumes you are building in a subdirectory of ACCESS Root diff --git a/var/spack/repos/builtin/packages/exodusii/package.py b/var/spack/repos/builtin/packages/exodusii/package.py index 5078b63cec..3a99952db6 100644 --- a/var/spack/repos/builtin/packages/exodusii/package.py +++ b/var/spack/repos/builtin/packages/exodusii/package.py @@ -27,11 +27,8 @@ from spack import * # TODO: Add support for a C++11 enabled installation that filters out the # TODO: "C++11-Disabled" flag (but only if the spec compiler supports C++11). -# TODO: Use variant forwarding to forward the 'mpi' variant to the direct -# TODO: dependencies 'hdf5' and 'netcdf'. - -class Exodusii(Package): +class Exodusii(CMakePackage): """Exodus II is a C++/Fortran library developed to store and retrieve data for finite element analyses. It's used for preprocessing (problem definition), postprocessing (results visualization), and @@ -52,18 +49,25 @@ class Exodusii(Package): depends_on('mpi', when='+mpi') # https://github.com/gsjaardema/seacas/blob/master/NetCDF-Mapping.md - depends_on('netcdf maxdims=65536 maxvars=524288') - depends_on('hdf5+shared') + depends_on('netcdf+mpi maxdims=65536 maxvars=524288', when='+mpi') + depends_on('netcdf~mpi maxdims=65536 maxvars=524288', when='~mpi') + depends_on('hdf5+shared+mpi', when='+mpi') + depends_on('hdf5+shared~mpi', when='~mpi') - patch('cmake-exodus.patch') + def cmake_args(self): + spec = self.spec - def install(self, spec, prefix): cc_path = spec['mpi'].mpicc if '+mpi' in spec else self.compiler.cc cxx_path = spec['mpi'].mpicxx if '+mpi' in spec else self.compiler.cxx - config_args = std_cmake_args[:] - config_args.extend([ + options = [ # General Flags # + '-DSEACASProj_ENABLE_SEACASExodus=ON', + '-DSEACASProj_ENABLE_TESTS=ON', + '-DBUILD_SHARED_LIBS:BOOL=ON', + '-DTPL_ENABLE_Netcdf:BOOL=ON', + '-DHDF5_NO_SYSTEM_PATHS=ON', + '-DSEACASProj_SKIP_FORTRANCINTERFACE_VERIFY_TEST:BOOL=ON', '-DSEACASProj_ENABLE_CXX11:BOOL=OFF', '-DSEACASProj_ENABLE_Zoltan:BOOL=OFF', '-DHDF5_ROOT:PATH={0}'.format(spec['hdf5'].prefix), @@ -73,14 +77,6 @@ class Exodusii(Package): '-DTPL_ENABLE_MPI={0}'.format('ON' if '+mpi' in spec else 'OFF'), '-DCMAKE_C_COMPILER={0}'.format(cc_path), '-DCMAKE_CXX_COMPILER={0}'.format(cxx_path), - ]) - - build_directory = join_path(self.stage.source_path, 'spack-build') - source_directory = self.stage.source_path - - with working_dir(build_directory, create=True): - mcmake = Executable(join_path(source_directory, 'cmake-exodus')) - mcmake(*config_args) + ] - make() - make('install') + return options |