From c218ee50e9fe4f2069f443b6001b49679ee12604 Mon Sep 17 00:00:00 2001 From: m-shunji <76516098+m-shunji@users.noreply.github.com> Date: Fri, 8 Mar 2024 15:03:18 +0900 Subject: [PATCH] libint: add link option for fujitsu compiler (#42233) Co-authored-by: inada-yoshie --- .../repos/builtin/packages/libint/package.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/var/spack/repos/builtin/packages/libint/package.py b/var/spack/repos/builtin/packages/libint/package.py index 889e98776e0..2dd4cd97a86 100644 --- a/var/spack/repos/builtin/packages/libint/package.py +++ b/var/spack/repos/builtin/packages/libint/package.py @@ -117,6 +117,9 @@ def setup_build_environment(self, env): env.set("CFLAGS", self.optflags) env.set("CXXFLAGS", self.optflags) + if self.spec.satisfies("%fj"): + env.set("LDFLAGS", "--linkfortran") + # Change AR to xiar if we compile with Intel and we # find the executable if "%intel" in self.spec and which("xiar"): @@ -238,11 +241,18 @@ def check(self): def install(self, spec, prefix): with working_dir(os.path.join(self.build_directory, "generated")): make("install") + if "+fortran" in self.spec: + mkdirp(prefix.include) + install(join_path("fortran", "*.mod"), prefix.include) def patch(self): # Use Fortran compiler to link the Fortran example, not the C++ # compiler if "+fortran" in self.spec: - filter_file( - "$(CXX) $(CXXFLAGS)", "$(FC) $(FCFLAGS)", "export/fortran/Makefile", string=True - ) + if not self.spec.satisfies("%fj"): + filter_file( + "$(CXX) $(CXXFLAGS)", + "$(FC) $(FCFLAGS)", + "export/fortran/Makefile", + string=True, + )