changeset 4462:8b731cde3aaa

sundials-ida: build against the SuiteSparse KLU library * src/sundials-ida.mk: Depend on suitesparse, add cmake options to enable linking with KLU. * src/sundials-ida-1.patch: New file. * dist-files.mk (SRC_FILES_1): Include it in the list.
author Mike Miller <mtmiller@octave.org>
date Fri, 01 Sep 2017 18:04:27 -0700
parents cc4433ef0b89
children 0234109dc9f4
files dist-files.mk src/sundials-ida-1.patch src/sundials-ida.mk
diffstat 3 files changed, 26 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/dist-files.mk	Thu Aug 31 15:53:33 2017 -0700
+++ b/dist-files.mk	Fri Sep 01 18:04:27 2017 -0700
@@ -653,6 +653,7 @@
   stable-octave.mk \
   suitesparse-1.patch \
   suitesparse.mk \
+  sundials-ida-1.patch \
   sundials-ida.mk \
   t4k_common.mk \
   taglib-1-static.patch \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/sundials-ida-1.patch	Fri Sep 01 18:04:27 2017 -0700
@@ -0,0 +1,20 @@
+Add missing dependency on KLU when building IDA shared library.
+
+Based on a patch in the Debian sundials package by Dima Kogan.
+
+https://anonscm.debian.org/cgit/debian-science/packages/sundials.git/tree/debian/patches/0001-Added-missing-linkages-
+
+diff --git a/src/ida/CMakeLists.txt b/src/ida/CMakeLists.txt
+--- a/src/ida/CMakeLists.txt
++++ b/src/ida/CMakeLists.txt
+@@ -135,6 +135,10 @@ IF(BUILD_SHARED_LIBS)
+   ADD_LIBRARY(sundials_ida_shared SHARED
+     ${ida_SOURCES}  ${ida_BL_SOURCES} ${shared_SOURCES})
+ 
++  IF(KLU_FOUND)
++    TARGET_LINK_LIBRARIES(sundials_ida_shared -lklu)
++  ENDIF(KLU_FOUND)
++
+   # Set the library name and make sure it is not deleted
+   SET_TARGET_PROPERTIES(sundials_ida_shared
+     PROPERTIES OUTPUT_NAME sundials_ida CLEAN_DIRECT_OUTPUT 1)
--- a/src/sundials-ida.mk	Thu Aug 31 15:53:33 2017 -0700
+++ b/src/sundials-ida.mk	Fri Sep 01 18:04:27 2017 -0700
@@ -8,7 +8,7 @@
 $(PKG)_SUBDIR   := ida-$($(PKG)_VERSION)
 $(PKG)_FILE     := ida-$($(PKG)_VERSION).tar.gz
 $(PKG)_URL      := https://computation.llnl.gov/projects/sundials/download/$($(PKG)_FILE)
-$(PKG)_DEPS     := lapack libgomp
+$(PKG)_DEPS     := lapack libgomp suitesparse
 
 define $(PKG)_UPDATE
     echo 'Warning: Updates are temporarily disabled for package $(PKG).' >&2;
@@ -19,6 +19,10 @@
     mkdir '$(1).build'
     cd '$(1).build' && cmake \
         -DEXAMPLES_ENABLE=OFF \
+        -DKLU_ENABLE=ON \
+        -DKLU_INCLUDE_DIR=$(HOST_INCDIR)/suitesparse \
+        -DKLU_LIBRARY_DIR=$(HOST_LIBDIR) \
+        -DSUITESPARSECONFIG_LIBRARY=$(HOST_LIBDIR)/libsuitesparseconfig.dll.a \
         -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \
         '$(1)'
     $(MAKE) -C '$(1).build' -j '$(JOBS)' install DESTDIR='$(3)' VERBOSE=1