summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorTom Payerle <payerle@umd.edu>2019-01-30 22:18:10 -0500
committerPeter Scheibel <scheibel1@llnl.gov>2019-01-30 21:18:10 -0600
commitc42528fac2ae3620729b75c196662f97d665f88e (patch)
tree0abf62a9c0b87b2e656ae92c729a70d62b8e380c /var
parent2aad75d98f1c334993122d0419d1c263df4d03ae (diff)
downloadspack-c42528fac2ae3620729b75c196662f97d665f88e.tar.gz
spack-c42528fac2ae3620729b75c196662f97d665f88e.tar.bz2
spack-c42528fac2ae3620729b75c196662f97d665f88e.tar.xz
spack-c42528fac2ae3620729b75c196662f97d665f88e.zip
fftw: fix include error for 2.x versions (#10039)
Fixes #7372 Added patch method which renames config.h in the fftw subdir of the source tree. fftw 2.1.5 appears to ship with a copy of this file with all defines commented out. This gets read by the #include directives instead of the version in the build directory with the correct defines. As a result, many C preprocessor macros left undefined, including F77_FUNC_ which causes the bulk of fttwf77.c to be skipped due to an #ifdef, so fftw_reverse_int_array et al not included in library. Fixes #7372 Also fixed some inconsistencies with the handling of quad and long_double in specs between the configure method and the build, check, and install methods.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/fftw/package.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/var/spack/repos/builtin/packages/fftw/package.py b/var/spack/repos/builtin/packages/fftw/package.py
index 45a481153e..709ad64af4 100644
--- a/var/spack/repos/builtin/packages/fftw/package.py
+++ b/var/spack/repos/builtin/packages/fftw/package.py
@@ -6,6 +6,8 @@
from spack import *
import llnl.util.lang
+# os is used for rename, etc in patch()
+import os
class Fftw(AutotoolsPackage):
@@ -107,6 +109,13 @@ class Fftw(AutotoolsPackage):
return find_libraries(libraries, root=self.prefix, recursive=True)
+ def patch(self):
+ # If fftw/config.h exists in the source tree, it will take precedence
+ # over the copy in build dir. As only the latter has proper config
+ # for our build, this is a problem. See e.g. issue #7372 on github
+ if os.path.isfile('fftw/config.h'):
+ os.rename('fftw/config.h', 'fftw/config.h.SPACK_RENAMED')
+
def autoreconf(self, spec, prefix):
if '+pfft_patches' in spec:
autoreconf = which('autoreconf')
@@ -169,10 +178,10 @@ class Fftw(AutotoolsPackage):
if '+float' in spec:
with working_dir('float'):
make()
- if '+long_double' in spec:
+ if spec.satisfies('@3:+long_double'):
with working_dir('long-double'):
make()
- if '+quad' in spec:
+ if spec.satisfies('@3:+quad'):
with working_dir('quad'):
make()
@@ -184,10 +193,10 @@ class Fftw(AutotoolsPackage):
if '+float' in spec:
with working_dir('float'):
make("check")
- if '+long_double' in spec:
+ if spec.satisfies('@3:+long_double'):
with working_dir('long-double'):
make("check")
- if '+quad' in spec:
+ if spec.satisfies('@3:+quad'):
with working_dir('quad'):
make("check")
@@ -198,9 +207,9 @@ class Fftw(AutotoolsPackage):
if '+float' in spec:
with working_dir('float'):
make("install")
- if '+long_double' in spec:
+ if spec.satisfies('@3:+long_double'):
with working_dir('long-double'):
make("install")
- if '+quad' in spec:
+ if spec.satisfies('@3:+quad'):
with working_dir('quad'):
make("install")