spack: Bug in Compiler Wrappers

I believe I’ve discovered a bug in the Spack compiler wrappers that is preventing me from using the NAG Fortran compilers. Compilation succeeds outside of Spack, but fails when using Spack with the error message:

checking for linker for Fortran main program... configure: error: Could not determine a way to link a Fortran test program!

The config.log files show major discrepancies:

# Without Spack
configure:19565: checking if nagfor static flag -Bstatic works
NAG Fortran Compiler Release 6.0(Hibiya) Build 1037
Obsolescent: conftest.f, line 1: Fixed source form
[NAG Fortran Compiler normal termination, 1 warning]
configure:19593: result: yes
# With Spack
configure:19565: checking if /blues/gpfs/home/software/spack/lib/spack/env/nag/nagfor static flag -Bstatic works
configure:19593: result: no
# Without Spack
configure:30125: checking whether Fortran 77 compiler accepts option -O2
configure:30170: nagfor -o conftest -mismatch   conftest.f  > pac_test1.log 2>&1
configure:30170: $? = 0
configure:30201: nagfor -o conftest -O2 -mismatch   conftest.f  > pac_test2.log 2>&1
configure:30201: $? = 0
configure:30209: diff -b pac_test1.log pac_test2.log > pac_test.log
configure:30212: $? = 0
configure:30312: result: yes
# With Spack
configure:30125: checking whether Fortran 77 compiler accepts option -O2
configure:30170: /blues/gpfs/home/software/spack/lib/spack/env/nag/nagfor -o conftest
configure:30170: $? = 1
configure: failed program was:
|       program main
|
|       end
configure:30312: result: no

These results came from trying to compile MPICH 3.2 with GCC 5.3.0 C/C++ compilers and NAG 6.0 Fortran compilers. Note that I had to add FFLAGS=-mismatch to get the compilation working outside of Spack. I’ll submit a PR for this once we get the compiler wrappers working.

@alalazo, @eschnett: Would you be willing to take a look? You’re more familiar with the wrapper than I am. I’ll do what I can on my end. Config.log files are attached below.

config-without-spack.txt config-with-spack.txt

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Comments: 15 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Hello, this is NAG Compiler Support, could you try the following edit in nag.py please? It’s just a question of adding an extra comma after “-rpath,”.

themos@kalamata>git diff lib/spack/spack/compilers/nag.py
diff --git a/lib/spack/spack/compilers/nag.py b/lib/spack/spack/compilers/nag.py
index 7beb0ef..5ba235a 100644
--- a/lib/spack/spack/compilers/nag.py
+++ b/lib/spack/spack/compilers/nag.py
@@ -61,11 +61,11 @@ class Nag(Compiler):
     # options with '-Wl,-Wl,,'
     @property
     def f77_rpath_arg(self):
-        return '-Wl,-Wl,,-rpath,'
+        return '-Wl,-Wl,,-rpath,,'

     @property
     def fc_rpath_arg(self):
-        return '-Wl,-Wl,,-rpath,'
+        return '-Wl,-Wl,,-rpath,,'

     @classmethod
     def default_version(self, comp):

Here are the notes https://github.com/dealii/dealii/wiki/deal.II-in-Spack (section on mixing compilers for macOS).

I think they are also somewhere in the Spack docu…

14 окт. 2016 г., в 18:55, “Adam J. Stewart” notifications@github.com написал(а):

I think I’m going to take another stab at getting NAG working in Spack. @davydden I know you had to make a lot of changes to get Clang+GFortran working. Can you point me to those and any other notes/suggestions you have?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.