spack/var/spack/repos/builtin/packages/suite-sparse/graphblas_libm_dep.patch
Kelly (KT) Thompson 4869b7312a 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`.
2018-04-19 08:59:55 -05:00

11 lines
370 B
Diff

--- 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} )