Repository: spack/spack

Issue:
openmc: needs an update
Our `openmc` package points to https://github.com/ANL-CESAR/openmc, which is " 5 commits ahead, 5035 commits behind mit-crpg:develop." 

So I guess, `openmc` needs an update or needs to be purged.

Also looking at the size, I am not sure if `openmc` is a proxy app anymore.

/cc @paulromano @shikhar413


Discussion:
Can you submit a PR?
The proper repository to use is mit-crpg/openmc, not the ANL-CESAR fork. OpenMC is not a proxy app.
> Can you submit a PR?

I tried, but the build system has changed!
Everybody at Spack uses different packages, and I doubt that request to
"make this Spack package work with a new version" is going to get much
traction.  Usually, package updates are best done by the person who needs
them.

You mean... the build system for `openmc` has changed, so the Spack package
would have to be radically different?  Can you submit a PR that works for
the latest version of `openmc` for the correct repo?  We can help make it
compatible with past versions (that have a different build system) if need
be.  Can you describe what the new build system is?  If they're moving
toward something standard (like CMake), then updating might not be so hard.

Another thing you might do us look at the `maintainers` field in the
package; or use git blame to figure out who wrote this package the first
time.  And then go to that person, ask them about new versions.  They might
be planning or interested in participating in a Spack package update.

It is CMake now, but I couldn't get it to pick up Spack's HDF5. 

@pkondamudi wrote the original package!

We found that the current version in spack triggers an internal compiler in gfortran-7.1, details here: https://travis-ci.org/proxyapps/proxy-ci/jobs/373526711.





I would be happy to submit a PR updating it, but probably won't be able to get to it for a while. @junghans OpenMC will look for HDF5 using the `HDF5_ROOT` environment variable if set, so that's one thing you might want to try.
Yeah, I tried `HDF5_ROOT`, but it was still picking up the non-Spack HDF5. I will put what I have in a PR and let it rot there.
> We found that the current version in spack triggers an internal compiler
> in gfortran-7.1, details here: https://travis-ci.org/
> proxyapps/proxy-ci/jobs/373526711.
>

I would add a constraint to the package of %gcc@:6.9999 or whatever...


Resolving patch:
diff --git a/var/spack/repos/builtin/packages/openmc/package.py b/var/spack/repos/builtin/packages/openmc/package.py
--- a/var/spack/repos/builtin/packages/openmc/package.py
+++ b/var/spack/repos/builtin/packages/openmc/package.py
@@ -26,66 +26,23 @@
 from spack import *
 
 
-class Openmc(MakefilePackage):
+class Openmc(CMakePackage):
     """The OpenMC project aims to provide a fully-featured Monte Carlo particle
        transport code based on modern methods. It is a constructive solid
        geometry, continuous-energy transport code that uses ACE format cross
        sections. The project started under the Computational Reactor Physics
        Group at MIT."""
 
-    homepage = "https://github.com/ANL-CESAR/"
-    git      = "https://github.com/ANL-CESAR/openmc.git"
-
-    tags = ['ecp', 'ecp-apps']
+    homepage = "http://openmc.readthedocs.io/"
+    url = "https://github.com/openmc-dev/openmc/tarball/v0.10.0"
+    git = "https://github.com/openmc-dev/openmc.git"
 
+    version('0.10.0', 'abb57bd1b226eb96909dafeec31369b0')
     version('develop')
 
-    build_directory = 'src'
-
-    parallel = False
-
-    @property
-    def build_targets(self):
-
-        targets = []
-
-        if self.compiler.name == 'gcc':
-            targets.append('COMPILER=gnu')
-            targets.append('MACHINE=UNKNOWN')
-        if self.compiler.name == 'intel':
-            targets.append('COMPILER=intel')
-        if self.compiler.name == 'pgi':
-            targets.append('COMPILER=pgi')
-        if self.compiler.name == 'xl':
-            targets.append('COMPILER=ibm')
-        if self.compiler.name == 'cce':
-            targets.append('COMPILER=cray')
-
-        return targets
+    depends_on("hdf5+hl")
 
-    def install(self, spec, prefix):
-        with working_dir('src'):
-            pth_st_cmp = join_path(prefix.bin, 'statepoint_cmp')
-            pth_st_histogram = join_path(prefix.bin, 'statepoint_histogram')
-            pth_st_meshpoint = join_path(prefix.bin, 'statepoint_meshpoint')
-            pth_openmc = join_path(prefix, 'share/man/man1/openmc.1')
-            pth_copyright = join_path(prefix, 'share/doc/openmc/copyright')
-            mkdir(prefix.bin)
-            mkdirp(pth_st_cmp)
-            mkdirp(pth_st_histogram)
-            mkdirp(pth_st_meshpoint)
-            mkdirp(pth_openmc)
-            mkdirp(pth_copyright)
+    def cmake_args(self):
+        options = ['-DHDF5_ROOT:PATH=%s' % self.spec['hdf5'].prefix]
 
-            install('openmc', prefix.bin)
-            install('utils/statepoint_cmp.py', pth_st_cmp)
-            install('utils/statepoint_histogram.py',
-                    pth_st_histogram)
-            install('utils/statepoint_meshplot.py',
-                    pth_st_meshpoint)
-        install('man/man1/openmc.1', pth_openmc)
-        install('LICENSE', pth_copyright)
-        install_tree('docs/', prefix.docs)
-        install_tree('examples/', prefix.examples)
-        install_tree('data/', prefix.data)
-        install_tree('tests/', prefix.tests)
+        return options


Test patch: