summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorKelly (KT) Thompson <KineticTheory@users.noreply.github.com>2018-04-19 07:59:55 -0600
committerAdam J. Stewart <ajstewart426@gmail.com>2018-04-19 08:59:55 -0500
commit4869b7312a000421074ad43233aa1264a2fb8ca4 (patch)
tree5b6ba4dfb51cfa6580d37fff8e3b1f4a1176eb92 /var
parent6d1097f99be31e7764e649d6ae67bb9391e0b001 (diff)
downloadspack-4869b7312a000421074ad43233aa1264a2fb8ca4.tar.gz
spack-4869b7312a000421074ad43233aa1264a2fb8ca4.tar.bz2
spack-4869b7312a000421074ad43233aa1264a2fb8ca4.tar.xz
spack-4869b7312a000421074ad43233aa1264a2fb8ca4.zip
Suite-sparse: provide patch to fix builts with clang@6.0.0. (#7811)
+ I am unable to build suite-sparse@5.2.0 with clang@6.0.0. The build fails with the error: ``` 2397 [ 99%] Linking C executable wildtype_demo 2398 make[4]: Leaving directory `/tmp/kellyt/spack-stage/spack-stage-w0XYhK/SuiteSparse/GraphBLAS/build' >> 2399 libgraphblas.so.2.0.1: undefined reference to `__fpclassify' >> 2400 clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation) >> 2401 make[4]: *** [wildtype_demo] Error 1 ``` + This error appears because libgraphblas.so requires `-lm`, but that link dependency is not explicitly listed in GraphBLAS\CMakeLists.txt. + A patch file is provided to add this dependency. The patch is only applied when the compiler is `%clang`.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/suite-sparse/graphblas_libm_dep.patch10
-rw-r--r--var/spack/repos/builtin/packages/suite-sparse/package.py4
2 files changed, 14 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/suite-sparse/graphblas_libm_dep.patch b/var/spack/repos/builtin/packages/suite-sparse/graphblas_libm_dep.patch
new file mode 100644
index 0000000000..441b0eff87
--- /dev/null
+++ b/var/spack/repos/builtin/packages/suite-sparse/graphblas_libm_dep.patch
@@ -0,0 +1,10 @@
+--- a/GraphBLAS/CMakeLists.txt
++++ b/GraphBLAS/CMakeLists.txt
+@@ -87,6 +87,7 @@
+ C_STANDARD_REQUIRED 11
+ PUBLIC_HEADER "Include/GraphBLAS.h" )
+ set_property ( TARGET graphblas PROPERTY C_STANDARD 11 )
++target_link_libraries ( graphblas m )
+
+ # create the static graphblas library. Requires ANSI C11
+ add_library ( graphblas_static STATIC ${GRAPHBLAS_SOURCES} )
diff --git a/var/spack/repos/builtin/packages/suite-sparse/package.py b/var/spack/repos/builtin/packages/suite-sparse/package.py
index 7d89be0326..6b22e76f0e 100644
--- a/var/spack/repos/builtin/packages/suite-sparse/package.py
+++ b/var/spack/repos/builtin/packages/suite-sparse/package.py
@@ -60,6 +60,10 @@ class SuiteSparse(Package):
# This patch removes unsupported flags for pgi compiler
patch('pgi.patch', when='%pgi')
+ # This patch adds '-lm' when linking libgraphblas and when using clang.
+ # Fixes 'libgraphblas.so.2.0.1: undefined reference to `__fpclassify''
+ patch('graphblas_libm_dep.patch', when='@5.2.0:%clang')
+
def install(self, spec, prefix):
# The build system of SuiteSparse is quite old-fashioned.
# It's basically a plain Makefile which include an header