|
| 1 | +from spack import * |
| 2 | + |
| 3 | +# TODO: Add support for a C++11 enabled installation that filters out the |
| 4 | +# TODO: "C++11-Disabled" flag (but only if the spec compiler supports C++11). |
| 5 | + |
| 6 | +# TODO: Add support for parallel installation that uses MPI. |
| 7 | + |
| 8 | +# TODO: Create installation options for NetCDF that support larger page size |
| 9 | +# TODO: suggested by Exodus (see the repository "README" file). |
| 10 | + |
| 11 | +class Exodusii(Package): |
| 12 | + """Exodus II is a C++/Fortran library developed to store and retrieve data for |
| 13 | + finite element analyses. It's used for preprocessing (problem definition), |
| 14 | + postprocessing (results visualization), and data transfer between codes. |
| 15 | + An Exodus II data file is a random access, machine independent, binary |
| 16 | + file that is written and read via C, C++, or Fortran API routines.""" |
| 17 | + |
| 18 | + homepage = "https://github.com/gsjaardema/seacas" |
| 19 | + url = "https://github.com/gsjaardema/seacas/archive/master.zip" |
| 20 | + |
| 21 | + version('2016-02-08', git='https://github.com/gsjaardema/seacas.git', commit='dcf3529') |
| 22 | + |
| 23 | + # TODO: Make this a build dependency once build dependencies are supported |
| 24 | + # (see: https://github.com/LLNL/spack/pull/378). |
| 25 | + |
| 26 | + depends_on('hdf5~shared~mpi') |
| 27 | + depends_on('netcdf~mpi') |
| 28 | + |
| 29 | + patch('exodus-cmake.patch') |
| 30 | + |
| 31 | + def patch(self): |
| 32 | + ff = FileFilter('cmake-exodus') |
| 33 | + |
| 34 | + ff.filter('CMAKE_INSTALL_PREFIX:PATH=${ACCESS}', |
| 35 | + 'CMAKE_INSTALL_PREFIX:PATH=%s' % self.spec.prefix, string=True) |
| 36 | + ff.filter('NetCDF_DIR:PATH=${TPL}', |
| 37 | + 'NetCDF_DIR:PATH=%s' % self.spec['netcdf'].prefix, string=True) |
| 38 | + ff.filter('HDF5_ROOT:PATH=${TPL}', |
| 39 | + 'HDF5_ROOT:PATH=%s' % self.spec['hdf5'].prefix, string=True) |
| 40 | + |
| 41 | + def install(self, spec, prefix): |
| 42 | + mkdirp('build') |
| 43 | + cd('build') |
| 44 | + |
| 45 | + cmake_exodus = Executable('../cmake-exodus') |
| 46 | + cmake_exodus() |
| 47 | + |
| 48 | + make() |
| 49 | + make('install') |
0 commit comments