Repository: spack/spack

Issue:
exodusii fails with Intel 16.0.2
```
$ spack install -j16 --restage exodusii%intel@16.0.2
...
==> Created stage in /home/certik/repos/spack/var/spack/stage/exodusii-2016-08-09-m65kh5fc4mbbxb2ggwanpta274jsojeo
==> Applied patch cmake-exodus.patch
==> Building exodusii [Package]
==> Executing phase: 'install'
==> Error: ProcessError: Command exited with status 1:
    '/home/certik/repos/spack/var/spack/stage/exodusii-2016-08-09-m65kh5fc4mbbxb2ggwanpta274jsojeo/seacas/cmake-exodus' '-G' 'Unix Makefiles' '-DCMAKE_INSTALL_PREFIX:PATH=/home/certik/repos/spack/opt/spack/linux-ubuntu16.04-x86_64/intel-16.0.2/exodusii-2016-08-09-m65kh5fc4mbbxb2ggwanpta274jsojeo' '-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo' '-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON' '-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=FALSE' '-DCMAKE_INSTALL_RPATH:STRING=/home/certik/repos/spack/opt/spack/linux-ubuntu16.04-x86_64/intel-16.0.2/exodusii-2016-08-09-m65kh5fc4mbbxb2ggwanpta274jsojeo/lib:/home/certik/repos/spack/opt/spack/linux-ubuntu16.04-x86_64/intel-16.0.2/exodusii-2016-08-09-m65kh5fc4mbbxb2ggwanpta274jsojeo/lib64:/home/certik/repos/spack/opt/spack/linux-ubuntu16.04-x86_64/intel-16.0.2/hdf5-1.10.1-sulr3hdpu6dzsup24ix52hpr6pdeirsg/lib:/home/certik/repos/spack/opt/spack/linux-ubuntu16.04-x86_64/intel-16.0.2/numactl-2.0.11-4jhbsj5sgacy65yezvtqzk2cwe67273b/lib:/home/certik/repos/spack/opt/spack/linux-ubuntu16.04-x86_64/intel-16.0.2/openmpi-2.1.1-ywm4hkx6cyjqfxxwnsggbc3qaoi5ijax/lib:/home/certik/repos/spack/opt/spack/linux-ubuntu16.04-x86_64/intel-16.0.2/hwloc-1.11.7-2ymnl3e3czf6hemzel7xwogxttxkkstl/lib:/home/certik/repos/spack/opt/spack/linux-ubuntu16.04-x86_64/intel-16.0.2/libpciaccess-0.13.5-yf2577f2imu7jdf25doy6krwvov6wydi/lib:/home/certik/repos/spack/opt/spack/linux-ubuntu16.04-x86_64/intel-16.0.2/libxml2-2.9.4-j26m2sopxpelbb2vhdtbfdb7gdhczbl2/lib:/home/certik/repos/spack/opt/spack/linux-ubuntu16.04-x86_64/intel-16.0.2/xz-5.2.3-3k7sp3y2joy5gqakygyh26ma7fq4xw3t/lib:/home/certik/repos/spack/opt/spack/linux-ubuntu16.04-x86_64/intel-16.0.2/zlib-1.2.11-whz3v7mejgeegpoiblv4vgkgv7dtaiqg/lib:/home/certik/repos/spack/opt/spack/linux-ubuntu16.04-x86_64/intel-16.0.2/netcdf-4.4.1.1-yzoz4ah7fqm2l22tftqxxobv2jlmnyy2/lib' '-DCMAKE_PREFIX_PATH:STRING=/home/certik/repos/spack/opt/spack/linux-ubuntu16.04-x86_64/intel-16.0.2/cmake-3.9.4-4e7en6f27k3m4jiu7chakc72y4h4gvdn;/home/certik/repos/spack/opt/spack/linux-ubuntu16.04-x86_64/intel-16.0.2/openmpi-2.1.1-ywm4hkx6cyjqfxxwnsggbc3qaoi5ijax;/home/certik/repos/spack/opt/spack/linux-ubuntu16.04-x86_64/intel-16.0.2/netcdf-4.4.1.1-yzoz4ah7fqm2l22tftqxxobv2jlmnyy2;/home/certik/repos/spack/opt/spack/linux-ubuntu16.04-x86_64/intel-16.0.2/hdf5-1.10.1-sulr3hdpu6dzsup24ix52hpr6pdeirsg' '-DSEACASProj_ENABLE_CXX11:BOOL=OFF' '-DSEACASProj_ENABLE_Zoltan:BOOL=OFF' '-DHDF5_ROOT:PATH=/home/certik/repos/spack/opt/spack/linux-ubuntu16.04-x86_64/intel-16.0.2/hdf5-1.10.1-sulr3hdpu6dzsup24ix52hpr6pdeirsg' '-DNetCDF_DIR:PATH=/home/certik/repos/spack/opt/spack/linux-ubuntu16.04-x86_64/intel-16.0.2/netcdf-4.4.1.1-yzoz4ah7fqm2l22tftqxxobv2jlmnyy2' '-DTPL_ENABLE_MPI=ON' '-DCMAKE_C_COMPILER=/home/certik/repos/spack/opt/spack/linux-ubuntu16.04-x86_64/intel-16.0.2/openmpi-2.1.1-ywm4hkx6cyjqfxxwnsggbc3qaoi5ijax/bin/mpicc' '-DCMAKE_CXX_COMPILER=/home/certik/repos/spack/opt/spack/linux-ubuntu16.04-x86_64/intel-16.0.2/openmpi-2.1.1-ywm4hkx6cyjqfxxwnsggbc3qaoi5ijax/bin/mpic++'

1 error found in build log:
     [ ... ]
  >> 3     CMake Error: Could not create named generator Unix
     4     
     5     Generators
     6       Unix Makefiles               = Generates standard UNIX makefiles.
     7       Ninja                        = Generates build.ninja files.
     8       Watcom WMake                 = Generates Watcom WMake makefiles.
     9       CodeBlocks - Ninja           = Generates CodeBlocks project files.

See build log for details:
  /home/certik/repos/spack/var/spack/stage/exodusii-2016-08-09-m65kh5fc4mbbxb2ggwanpta274jsojeo/seacas/spack-build.out
```


Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/exodusii/package.py b/var/spack/repos/builtin/packages/exodusii/package.py
--- a/var/spack/repos/builtin/packages/exodusii/package.py
+++ b/var/spack/repos/builtin/packages/exodusii/package.py
@@ -27,11 +27,8 @@
 # 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 @@ def install(self, spec, prefix):
             '-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


Test patch: