summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2022-04-21 15:14:21 -0400
committerGitHub <noreply@github.com>2022-04-21 13:14:21 -0600
commit3a70df9f64d4d09343beb1ab39c7cf00bafeb9d4 (patch)
tree0764fb09bb363997b2ce63dafeba254269fdc722 /var
parent616a8eebcd8bb02be512185ec8a19525d1cbe866 (diff)
downloadspack-3a70df9f64d4d09343beb1ab39c7cf00bafeb9d4.tar.gz
spack-3a70df9f64d4d09343beb1ab39c7cf00bafeb9d4.tar.bz2
spack-3a70df9f64d4d09343beb1ab39c7cf00bafeb9d4.tar.xz
spack-3a70df9f64d4d09343beb1ab39c7cf00bafeb9d4.zip
fftw: Link explicitly against `-lmpi` (#29279)
* fftw: Link explicitly against `-lmpi` Closes https://github.com/spack/spack/issues/29224. * Generalize MPI flags Co-authored-by: Dom Heinzeller <dom.heinzeller@icloud.com> * Add platform guard Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> Co-authored-by: Dom Heinzeller <dom.heinzeller@icloud.com>
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/fftw/package.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/fftw/package.py b/var/spack/repos/builtin/packages/fftw/package.py
index 4a99e7ba4f..58ce1a3244 100644
--- a/var/spack/repos/builtin/packages/fftw/package.py
+++ b/var/spack/repos/builtin/packages/fftw/package.py
@@ -96,6 +96,14 @@ class FftwBase(AutotoolsPackage):
'CXXFLAGS', self.spec['llvm-openmp'].headers.include_flags)
env.append_flags(
'LDFLAGS', self.spec['llvm-openmp'].libs.ld_flags)
+ # FFTW first configures libtool without MPI, and later uses it with
+ # MPI. libtool then calls wrong linker to create shared libraries
+ # (it calls `$CC` instead of `$MPICC`), and MPI symbols
+ # remain undefined because `-lmpi` is not passed to the linker.
+ # https://github.com/FFTW/fftw3/issues/274
+ # https://github.com/spack/spack/issues/29224
+ if self.spec.satisfies('+mpi') and self.spec.satisfies('platform=darwin'):
+ env.append_flags('LIBS', self.spec['mpi'].libs.ld_flags)
def configure(self, spec, prefix):
# Base options