[sundials] 17/76: fixed Bug #646457 + add octave support
Andreas Tille
tille at debian.org
Sun Feb 5 18:44:51 UTC 2017
This is an automated email from the git hooks/post-receive script.
tille pushed a commit to branch master
in repository sundials.
commit 85e61e18e8380f044796254bebc262cd5f623ce0
Author: Christophe Trophime <christophe.trophime at lncmi.cnrs.fr>
Date: Wed Nov 16 14:09:23 2011 +0000
fixed Bug #646457 + add octave support
---
debian/README.Debian | 23 ++++
debian/changelog | 5 +-
debian/control | 19 +++-
debian/octave-sundials.install | 2 +
debian/patches/fix-format-error.patch | 65 ++++++++++++
debian/patches/gcc4.6.patch | 13 ---
debian/patches/octave-sundialstb.patch | 185 +++++++++++++++++++++++++++++++++
debian/patches/series | 3 +-
debian/rules | 27 +++++
9 files changed, 325 insertions(+), 17 deletions(-)
diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644
index 0000000..0033dc2
--- /dev/null
+++ b/debian/README.Debian
@@ -0,0 +1,23 @@
+sundials for Debian
+----------------
+
+Configuring Octave's startup
+
+
+"""
+Matlab will execute a file named 'startup.m' in the directory it was called from on the command line. Octave does not. It will, however, execute a file named '.octaverc' which can be edited to execute existing files
+
+if ( exist ('startup.m', 'file') )
+ source ('startup.m') # load startup.m like matlab
+endif
+"""
+
+According to the above doc create or add the folliwng lines to your .octaverc to activate sundials bindings for octave:
+
+ % SUNDIALS Toolbox startup M-file, if it exists.
+ if ( exist('startup_STB.m','file') )
+ source ('startup_STB.m') # load startup.m like matlab
+ end
+
+
+ -- Christophe Trophime <christophe.trophime at lncmi.cnrs.fr> Mon, 24 Oct 2011 15:01:41 +0200
diff --git a/debian/changelog b/debian/changelog
index ef686c8..da4040c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,9 @@
sundials (2.4.0-4) unstable; urgency=low
- * debian/patches: add gcc4.6.patch (Closes: #646457)
+ * add octave support
+
+ [Peter Green]
+ * debian/patches: add fix-format-error.patch (Closes: #646457)
-- Christophe Trophime <christophe.trophime at lncmi.cnrs.fr> Mon, 24 Oct 2011 15:01:41 +0200
diff --git a/debian/control b/debian/control
index 1e221af..23d0edc 100644
--- a/debian/control
+++ b/debian/control
@@ -2,9 +2,11 @@ Source: sundials
Priority: optional
Section: libs
Maintainer: Debian Science Team <debian-science-maintainers at lists.alioth.debian.org>
-Uploaders: Christophe Trophime <christophe.trophime at grenoble.cnrs.fr>,
+Uploaders: Christophe Trophime <christophe.trophime at lncmi.cnrs.fr>,
Sylvestre Ledru <sylvestre at debian.org>
-Build-Depends: debhelper (>= 7), autotools-dev, cdbs, quilt, gfortran, libblas-dev | libblas-3gf.so, liblapack-dev | liblapack-3gf.so
+Build-Depends: debhelper (>= 7), autotools-dev, cdbs, quilt, gfortran,
+ libblas-dev | libblas-3gf.so, liblapack-dev | liblapack-3gf.so,
+ octave-pkg-dev (>= 0.7.0)
Standards-Version: 3.9.2
Homepage: http://www.llnl.gov/CASC/sundials/
Vcs-Svn: svn://svn.debian.org/svn/debian-science/packages/sundials/trunk/
@@ -105,3 +107,16 @@ Description: SUNDIALS development files
# .
# This package contains SUNDIALS documentation.
+Package: octave-sundials
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}, ${octave:Depends}
+Recommends: libsundials-serial-dev
+Description: SUNDIALS for octave
+ The family of solvers referred to as SUNDIALS (SUit of Nonlinear and
+ DIfferential/ALgebraic equation Solvers) consists of solvers CVODE
+ (for ODE systems), CVODES (ODE with sensitivity analysis capabilities),
+ IDA (for differential-algebraic systems), and KINSOL (for nonlinear
+ algebraic systems).
+ .
+ This package contains SUNDIALS plugins for octave.
+
diff --git a/debian/octave-sundials.install b/debian/octave-sundials.install
new file mode 100644
index 0000000..cb00361
--- /dev/null
+++ b/debian/octave-sundials.install
@@ -0,0 +1,2 @@
+usr/share/octave/packages
+usr/lib/octave/packages
diff --git a/debian/patches/fix-format-error.patch b/debian/patches/fix-format-error.patch
new file mode 100644
index 0000000..313e326
--- /dev/null
+++ b/debian/patches/fix-format-error.patch
@@ -0,0 +1,65 @@
+Index: sundials-2.4.0/src/cvode/cvode.c
+===================================================================
+--- sundials-2.4.0.orig/src/cvode/cvode.c 2009-05-10 00:22:28.000000000 +0000
++++ sundials-2.4.0/src/cvode/cvode.c 2011-11-12 13:23:18.000000000 +0000
+@@ -4128,7 +4128,7 @@
+
+ #ifndef NO_FPRINTF_OUTPUT
+ fprintf(stderr, "\n[%s ERROR] %s\n ", module, fname);
+- fprintf(stderr, msgfmt);
++ vfprintf(stderr, msgfmt, ap);
+ fprintf(stderr, "\n\n");
+ #endif
+
+Index: sundials-2.4.0/src/cvodes/cvodes.c
+===================================================================
+--- sundials-2.4.0.orig/src/cvodes/cvodes.c 2009-05-10 00:22:35.000000000 +0000
++++ sundials-2.4.0/src/cvodes/cvodes.c 2011-11-12 13:26:19.000000000 +0000
+@@ -8942,7 +8942,7 @@
+
+ #ifndef NO_FPRINTF_OUTPUT
+ fprintf(stderr, "\n[%s ERROR] %s\n ", module, fname);
+- fprintf(stderr, msg);
++ fprintf(stderr, "%s",msg);
+ fprintf(stderr, "\n\n");
+ #endif
+
+Index: sundials-2.4.0/src/ida/ida.c
+===================================================================
+--- sundials-2.4.0.orig/src/ida/ida.c 2009-05-10 00:22:51.000000000 +0000
++++ sundials-2.4.0/src/ida/ida.c 2011-11-12 13:28:56.000000000 +0000
+@@ -3248,7 +3248,7 @@
+
+ #ifndef NO_FPRINTF_OUTPUT
+ fprintf(stderr, "\n[%s ERROR] %s\n ", module, fname);
+- fprintf(stderr, msgfmt);
++ vfprintf(stderr, msgfmt,ap);
+ fprintf(stderr, "\n\n");
+ #endif
+
+Index: sundials-2.4.0/src/idas/idas.c
+===================================================================
+--- sundials-2.4.0.orig/src/idas/idas.c 2009-05-10 00:22:58.000000000 +0000
++++ sundials-2.4.0/src/idas/idas.c 2011-11-12 13:30:16.000000000 +0000
+@@ -7170,7 +7170,7 @@
+
+ #ifndef NO_FPRINTF_OUTPUT
+ fprintf(stderr, "\n[%s ERROR] %s\n ", module, fname);
+- fprintf(stderr, msgfmt);
++ vfprintf(stderr, msgfmt,ap);
+ fprintf(stderr, "\n\n");
+ #endif
+
+Index: sundials-2.4.0/src/kinsol/kinsol.c
+===================================================================
+--- sundials-2.4.0.orig/src/kinsol/kinsol.c 2009-05-10 00:23:08.000000000 +0000
++++ sundials-2.4.0/src/kinsol/kinsol.c 2011-11-12 13:31:25.000000000 +0000
+@@ -1864,7 +1864,7 @@
+
+ #ifndef NO_FPRINTF_OUTPUT
+ fprintf(stderr, "\n[%s ERROR] %s\n ", module, fname);
+- fprintf(stderr, msgfmt);
++ vfprintf(stderr, msgfmt,ap);
+ fprintf(stderr, "\n\n");
+ #endif
+
diff --git a/debian/patches/gcc4.6.patch b/debian/patches/gcc4.6.patch
deleted file mode 100644
index b668e48..0000000
--- a/debian/patches/gcc4.6.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: sundials-2.4.0/src/cvode/cvode.c
-===================================================================
---- sundials-2.4.0.orig/src/cvode/cvode.c 2011-10-24 16:06:47.520615754 +0200
-+++ sundials-2.4.0/src/cvode/cvode.c 2011-10-24 16:07:35.272617736 +0200
-@@ -4128,7 +4128,7 @@
-
- #ifndef NO_FPRINTF_OUTPUT
- fprintf(stderr, "\n[%s ERROR] %s\n ", module, fname);
-- fprintf(stderr, msgfmt);
-+ fprintf(stderr, "%s", msgfmt);
- fprintf(stderr, "\n\n");
- #endif
-
diff --git a/debian/patches/octave-sundialstb.patch b/debian/patches/octave-sundialstb.patch
new file mode 100644
index 0000000..920d242
--- /dev/null
+++ b/debian/patches/octave-sundialstb.patch
@@ -0,0 +1,185 @@
+Index: sundials-2.4.0/sundialsTB/install_STB.m
+===================================================================
+--- sundials-2.4.0.orig/sundialsTB/install_STB.m 2011-11-16 14:42:09.000000000 +0100
++++ sundials-2.4.0/sundialsTB/install_STB.m 2011-11-16 14:46:25.000000000 +0100
+@@ -9,7 +9,7 @@
+ % MEX compiler command
+ % --------------------
+
+-mexcompiler = 'mex -v';
++mexcompiler = 'mkoctfile --mex -v';
+
+ % Location of sundialsTB and top of sundials source tree
+ % ------------------------------------------------------
+@@ -46,41 +46,11 @@
+ % Figure out what modules exist and which ones will be built
+ % ----------------------------------------------------------
+
+-fprintf('\n\nSelect modules to be built\n');
++fprintf('\n\nBuild Modules for CVODES, IDAS, KINSOL\n');
+
+-q = fullfile(sun,'src','cvodes');
+-if exist(q, 'dir')
+- answ = input(' Compile CVODES interface? (y/n) ','s');
+- if answ == 'y'
+- cvm_ok = true;
+- else
+- cvm_ok = false;
+- end
+-end
+-
+-if exist(q, 'dir')
+- answ = input(' Compile IDAS interface? (y/n) ','s');
+- if answ == 'y'
+- idm_ok = true;
+- else
+- idm_ok = false;
+- end
+-end
+-
+-q = fullfile(sun,'src','kinsol');
+-if exist(q, 'dir')
+- answ = input(' Compile KINSOL interface? (y/n) ','s');
+- if answ == 'y'
+- kim_ok = true;
+- else
+- kim_ok = false;
+- end
+-end
+-
+-if ~cvm_ok && ~idm_ok && ~kim_ok
+- fprintf('\nOK. All done.\n');
+- return
+-end
++cvm_ok = true;
++idm_ok = true;
++kim_ok = true;
+
+ % Create sundials_config.h
+ % ------------------------
+@@ -117,17 +87,15 @@
+ % ------------------
+
+ fprintf('\n\nMEX files were successfully created.\n');
+-answ = input(' Install toolbox? (y/n) ','s');
+-if answ ~= 'y'
+- fprintf('\n\nOK. All done.\n');
+- return
+-end
++fprintf('\n\nInstall toolbox.\n');
++answ = 'y'
+
+ while true
+ fprintf('\n\nSpecify the location where you wish to install the toolbox.\n');
+ fprintf('The toolbox will be installed in a subdirectory "sundialsTB".\n');
+ fprintf('Enter return to cancel the installation.\n');
+- where = input(' Installation directory: ','s');
++ %where = input(' Installation directory: ','s');
++ where = './octave';
+ if isempty(where)
+ go = 0;
+ break;
+@@ -149,7 +117,8 @@
+ go = 1;
+ if exist(stbi,'dir')
+ fprintf('\n\nDirectory %s exists!\n',stbi);
+- answ = input(' Replace? (y/n) ','s');
++ %answ = input(' Replace? (y/n) ','s');
++ answ = 'y';
+ if answ == 'y'
+ rmdir(stbi,'s');
+ go = 1;
+@@ -210,11 +179,14 @@
+ fprintf('add a call to %s\n',fullfile(stbi,'startup_STB.m'));
+ fprintf('\nEnjoy!\n\n');
+
++exit
++endfunction
++
+ %---------------------------------------------------------------------------------
+ % Check if mex works and if the user accepts the current mexopts
+ %---------------------------------------------------------------------------------
+
+-function mex_ok = check_mex(mexcompiler)
++function mex_ok = check_mex (mexcompiler)
+
+ % Create a dummy file
+ fid = fopen('foo.c', 'w');
+@@ -232,7 +204,8 @@
+ delete(sprintf('foo.%s', mexext))
+
+ fprintf('\n\nMEX files will be compiled and built using the above options\n');
+-answ = input(' Proceed? (y/n) ','s');
++%answ = input(' Proceed? (y/n) ','s');
++answ = 'y';
+ if answ == 'y'
+ mex_ok = true;
+ else
+@@ -240,7 +213,7 @@
+ mex_ok = false;
+ end
+
+-return
++endfunction
+
+ %---------------------------------------------------------------------------------
+ % compilation of cvm MEX file
+@@ -352,6 +325,8 @@
+
+ cd(stb)
+
++endfunction
++
+ %---------------------------------------------------------------------------------
+ % compilation of idm MEX file
+ %---------------------------------------------------------------------------------
+@@ -461,6 +436,7 @@
+
+ cd(stb)
+
++endfunction
+
+ %---------------------------------------------------------------------------------
+ % compilation of KINSOL MEX file
+@@ -569,6 +545,8 @@
+
+ cd(stb)
+
++endfunction
++
+ %---------------------------------------------------------------------------------
+ % Installation of common sundialsTB files
+ %---------------------------------------------------------------------------------
+@@ -633,6 +611,7 @@
+ break;
+ end
+ end
++endfunction
+
+ %---------------------------------------------------------------------------------
+ % Installation of CVODES files
+@@ -795,6 +774,8 @@
+ disp(msg);
+ end
+
++endfunction
++
+ %---------------------------------------------------------------------------------
+ % Installation of IDAS files
+ %---------------------------------------------------------------------------------
+@@ -949,7 +930,7 @@
+ disp(msg);
+ end
+
+-
++endfunction
+
+ %---------------------------------------------------------------------------------
+ % Installation of KINSOL files
+@@ -1023,3 +1004,6 @@
+ end
+
+
++endfunction
++
++install_STB;
diff --git a/debian/patches/series b/debian/patches/series
index e2ae5e4..0603753 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
makefile.patch
sh4.patch
-gcc4.6.patch
+fix-format-error.patch
+octave-sundialstb.patch
diff --git a/debian/rules b/debian/rules
index 34afd59..68eca06 100755
--- a/debian/rules
+++ b/debian/rules
@@ -31,6 +31,12 @@ DEB_COMPRESS_EXCLUDE = .c .out .f
USCAN_DESTDIR := $(CURDIR)/../tarballs
DEB_STRIPPED_UPSTREAM_VERSION = $(shell echo $(DEB_UPSTREAM_VERSION) | sed -n -e 's/\.dfsg.*$$//p')
+# The directories below are versioned. We only support the packages for the
+# stable version of Octave
+octver = 3.2
+mpath = /usr/share/octave/packages/$(octver)
+bpath = /usr/lib/octave/packages/$(octver)
+
# The following hack is necessary because the upstream makefiles do
# not install $libdir and $includedir or $mandir
common-install-prehook-impl::
@@ -41,6 +47,23 @@ common-install-prehook-impl::
build/libsundials-serial::
$(SHELL) debian/check.sh
+build/octave-sundials::
+ mkdir -p sundialsTB/octave
+ cd sundialsTB && octave -fV install_STB.m
+ strip sundialsTB/octave/sundialsTB/cvodes/cvm/cvm.mex
+ strip sundialsTB/octave/sundialsTB/idas/idm/idm.mex
+ strip sundialsTB/octave/sundialsTB/kinsol/kim/kim.mex
+
+install/octave-sundials::
+ mkdir -p debian/tmp/$(mpath)
+ mkdir -p debian/tmp/$(bpath)/sundialsTB/cvodes/cvm/
+ mv sundialsTB/octave/sundialsTB/cvodes/cvm/cvm.mex debian/tmp/$(bpath)/sundialsTB/cvodes/cvm
+ mkdir -p debian/tmp/$(bpath)/sundialsTB/idas/idm/
+ mv sundialsTB/octave/sundialsTB/idas/idm/idm.mex debian/tmp/$(bpath)/sundialsTB/idas/idm
+ mkdir -p debian/tmp/$(bpath)/sundialsTB/kinsol/kim
+ mv sundialsTB/octave/sundialsTB/kinsol/kim/kim.mex debian/tmp/$(bpath)/sundialsTB/kinsol/kim
+ mv sundialsTB/octave/* debian/tmp/$(mpath)
+ rm debian/tmp/$(mpath)/sundialsTB/LICENSE
binary-install/libsundials-serial-dev::
find $(deblib) \( -name \*.la \) -exec rm -rf {} +
@@ -54,6 +77,10 @@ clean::
find examples \
-type f -a \( -name \*.o -o -name \*.out \) \
-a -exec rm -f \{\} \;
+ find sundialsTB \
+ -type f -a \( -name \*.o -o -name \*.mex \) \
+ -a -exec rm -f \{\} \;
+ rm -rf sundialsTB/octave
get-orig-source:
mkdir -p $(USCAN_DESTDIR)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sundials.git
More information about the debian-science-commits
mailing list