DrTimothyAldenDavis / SuiteSparse

The official SuiteSparse library: a suite of sparse matrix algorithms authored or co-authored by Tim Davis, Texas A&M University.
https://people.engr.tamu.edu/davis/suitesparse.html
Other
1.17k stars 262 forks source link

broken makefile when specifying additional LDFLAGS #6

Closed stefanozampini closed 2 years ago

stefanozampini commented 4 years ago

The following patch fixes the issue

diff --git a/SuiteSparse_config/SuiteSparse_config.mk b/SuiteSparse_config/SuiteSparse_config.mk
index 0a091882..c400ea5b 100644
--- a/SuiteSparse_config/SuiteSparse_config.mk
+++ b/SuiteSparse_config/SuiteSparse_config.mk
@@ -153,7 +153,7 @@ SUITESPARSE_VERSION = 5.6.0
     # It places its shared *.so libraries in SuiteSparse/lib.
     # Linux also requires the -lrt library (see below)
     LDLIBS ?= -lm
-    LDFLAGS += -L$(INSTALL_LIB)
+    override LDFLAGS += -L$(INSTALL_LIB)

     # NOTE: Use of the Intel MKL BLAS is strongly recommended.  The OpenBLAS can
     # result in severe performance degradation, in CHOLMOD in particular.
topin89 commented 4 years ago

Also, UMFPACK/Demo/Makefile doesn't seem to use LDFLAGS at all, this should fix it.

diff --git a/UMFPACK/Demo/Makefile b/UMFPACK/Demo/Makefile
index c575fa81..0598fb87 100644
--- a/UMFPACK/Demo/Makefile
+++ b/UMFPACK/Demo/Makefile
@@ -27,7 +27,7 @@ endif
 C = $(CC) $(CF) $(UMFPACK_CONFIG) $(CONFIG_PARTITION) \
     -I../../include

-LIBS = $(LDLIBS) -L../../lib -lumfpack -lamd -lsuitesparseconfig \
+LIBS = $(LDFLAGS) $(LDLIBS) -L../../lib -lumfpack -lamd -lsuitesparseconfig \
    $(LIB_WITH_CHOLMOD) $(LAPACK) $(BLAS)

 libs: metis