From e53a98cb4ff440002e59d23e38f42aea0b0a3297 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Thu, 9 Apr 2020 15:33:24 +0200 Subject: [PATCH] papi: check existence of a fortran compiler (#15968) fixes #5029 --- var/spack/repos/builtin/packages/papi/package.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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)