diff options
Diffstat (limited to 'var/spack/repos/builtin/packages/sundials/package.py')
-rw-r--r-- | var/spack/repos/builtin/packages/sundials/package.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/sundials/package.py b/var/spack/repos/builtin/packages/sundials/package.py index 66f385f29f..b0ad1c1f42 100644 --- a/var/spack/repos/builtin/packages/sundials/package.py +++ b/var/spack/repos/builtin/packages/sundials/package.py @@ -68,10 +68,18 @@ class Sundials(Package): return 'ON' if varstr in self.spec else 'OFF' cmake_args = std_cmake_args[:] + + fortran_flag = self.compiler.pic_flag + if spec.satisfies('%clang platform=darwin'): + mpif77 = Executable(self.spec['mpi'].mpif77) + libgfortran = LibraryList(mpif77('--print-file-name', + 'libgfortran.a', output=str)) + fortran_flag += ' ' + libgfortran.ld_flags + cmake_args.extend([ '-DBUILD_SHARED_LIBS=ON', '-DCMAKE_C_FLAGS={0}'.format(self.compiler.pic_flag), - '-DCMAKE_Fortran_FLAGS={0}'.format(self.compiler.pic_flag), + '-DCMAKE_Fortran_FLAGS={0}'.format(fortran_flag), '-DEXAMPLES_ENABLE=ON', '-DEXAMPLES_INSTALL=ON', '-DFCMIX_ENABLE=ON', |