diff --git a/var/spack/repos/builtin/packages/papi/package.py b/var/spack/repos/builtin/packages/papi/package.py index e8401e6944..35dd4f9ba2 100644 --- a/var/spack/repos/builtin/packages/papi/package.py +++ b/var/spack/repos/builtin/packages/papi/package.py @@ -2,12 +2,10 @@ # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack import * import glob import os import sys -from llnl.util.filesystem import fix_darwin_install_name +import llnl.util.filesystem as fs class Papi(AutotoolsPackage): @@ -68,6 +66,12 @@ def configure_args(self): options.append('--with-components={0}'.format(' '.join(variants))) return options + @run_before('configure') + def fortran_check(self): + if not self.compiler.fc: + msg = 'PAPI requires a Fortran compiler to build' + raise RuntimeError(msg) + @run_before('configure') def component_configure(self): configure_script = Executable('./configure') @@ -92,4 +96,4 @@ def fix_darwin_install(self): if sys.platform == 'darwin': os.rename(join_path(self.prefix.lib, 'libpapi.so'), join_path(self.prefix.lib, 'libpapi.dylib')) - fix_darwin_install_name(self.prefix.lib) + fs.fix_darwin_install_name(self.prefix.lib)