summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog24
-rw-r--r--debian/compat1
-rw-r--r--debian/control109
-rw-r--r--debian/copyright37
-rwxr-xr-xdebian/liblbfgsb-dev.install6
-rw-r--r--debian/liblbfgsb-doc.install1
-rw-r--r--debian/liblbfgsb-examples.docs2
-rw-r--r--debian/liblbfgsb-examples.install6
-rwxr-xr-xdebian/liblbfgsb0.install5
-rw-r--r--debian/patches/replace-linpack-with-lapack.patch76
-rw-r--r--debian/patches/series2
-rw-r--r--debian/patches/silence.patch33
-rwxr-xr-xdebian/rules47
-rw-r--r--debian/source/format1
-rw-r--r--debian/watch5
15 files changed, 355 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..6774875
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,24 @@
+lbfgsb (3.0+dfsg.3-1) unstable; urgency=medium
+
+ * Remove repack script and have uscan read Files-Excluded from
+ debian/copyright instead.
+
+ -- Gard Spreemann <gspreemann@gmail.com> Mon, 19 Sep 2016 18:30:54 +0200
+
+lbfgsb (3.0+dfsg.2-1) unstable; urgency=medium
+
+ * Remove unused blas.f and linpack.f during repack.
+ * -examples package with example programs (compiled and source) and
+ output from upstream.
+ * -doc package split off from main lib package.
+ * Multi-arch support for the library packages.
+ * Explicitly set compile flags.
+ * Enable hardening.
+
+ -- Gard Spreemann <gspreemann@gmail.com> Fri, 20 May 2016 18:04:05 +0200
+
+lbfgsb (3.0+dfsg.1-1) unstable; urgency=medium
+
+ * Initial packaging. Closes: #811069
+
+ -- Gard Spreemann <gspreemann@gmail.com> Wed, 11 May 2016 12:12:59 +0200
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..26278a0
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,109 @@
+Source: lbfgsb
+Maintainer: Gard Spreemann <gspreemann@gmail.com>
+Section: math
+Priority: optional
+Standards-Version: 3.9.8
+Build-Depends: debhelper (>= 9), gfortran, libblas-dev, liblapack-dev, dh-exec
+Homepage: http://users.iems.northwestern.edu/~nocedal/lbfgsb.html
+
+Package: liblbfgsb0
+Section: libs
+Architecture: any
+Multi-Arch: same
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Limited-memory quasi-Newton bound-constrained optimization
+ Fortran library implementing limited-memory quasi-Newton
+ bound-constrained optimization as described in [1,2,3].
+ .
+ This package contains the library itself.
+ .
+ [1] R. H. Byrd, P. Lu and J. Nocedal. A Limited Memory Algorithm for
+ Bound Constrained Optimization, (1995), SIAM Journal on Scientific
+ and Statistical Computing , 16, 5, pp. 1190-1208.
+ .
+ [2] C. Zhu, R. H. Byrd and J. Nocedal. L-BFGS-B: Algorithm 778:
+ L-BFGS-B, FORTRAN routines for large scale bound constrained
+ optimization (1997), ACM Transactions on Mathematical Software, Vol
+ 23, Num. 4, pp. 550 - 560.
+ .
+ [3] J.L. Morales and J. Nocedal. L-BFGS-B: Remark on Algorithm 778:
+ L-BFGS-B, FORTRAN routines for large scale bound constrained
+ optimization (2011), to appear in ACM Transactions on Mathematical
+ Software.
+
+Package: liblbfgsb-dev
+Section: libdevel
+Architecture: any
+Multi-Arch: same
+Depends: ${misc:Depends}, liblbfgsb0 (= ${binary:Version})
+Suggests: liblbfgsb-doc, liblbfgsb-examples
+Description: Limited-memory quasi-Newton bound-constrained optimization (static library)
+ Fortran library implementing limited-memory quasi-Newton
+ bound-constrained optimization as described in [1,2,3].
+ .
+ This package contains the static library.
+ .
+ [1] R. H. Byrd, P. Lu and J. Nocedal. A Limited Memory Algorithm for
+ Bound Constrained Optimization, (1995), SIAM Journal on Scientific
+ and Statistical Computing , 16, 5, pp. 1190-1208.
+ .
+ [2] C. Zhu, R. H. Byrd and J. Nocedal. L-BFGS-B: Algorithm 778:
+ L-BFGS-B, FORTRAN routines for large scale bound constrained
+ optimization (1997), ACM Transactions on Mathematical Software, Vol
+ 23, Num. 4, pp. 550 - 560.
+ .
+ [3] J.L. Morales and J. Nocedal. L-BFGS-B: Remark on Algorithm 778:
+ L-BFGS-B, FORTRAN routines for large scale bound constrained
+ optimization (2011), to appear in ACM Transactions on Mathematical
+ Software.
+
+Package: liblbfgsb-doc
+Section: doc
+Architecture: all
+Multi-Arch: foreign
+Depends: ${misc:Depends}
+Description: Limited-memory quasi-Newton bound-constrained optimization (documentation)
+ Fortran library implementing limited-memory quasi-Newton
+ bound-constrained optimization as described in [1,2,3].
+ .
+ This package contains the documentation describing the library and
+ algorithm.
+ .
+ [1] R. H. Byrd, P. Lu and J. Nocedal. A Limited Memory Algorithm for
+ Bound Constrained Optimization, (1995), SIAM Journal on Scientific
+ and Statistical Computing , 16, 5, pp. 1190-1208.
+ .
+ [2] C. Zhu, R. H. Byrd and J. Nocedal. L-BFGS-B: Algorithm 778:
+ L-BFGS-B, FORTRAN routines for large scale bound constrained
+ optimization (1997), ACM Transactions on Mathematical Software, Vol
+ 23, Num. 4, pp. 550 - 560.
+ .
+ [3] J.L. Morales and J. Nocedal. L-BFGS-B: Remark on Algorithm 778:
+ L-BFGS-B, FORTRAN routines for large scale bound constrained
+ optimization (2011), to appear in ACM Transactions on Mathematical
+ Software.
+
+Package: liblbfgsb-examples
+Section: libs
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Limited-memory quasi-Newton bound-constrained optimization (examples)
+ Fortran library implementing limited-memory quasi-Newton
+ bound-constrained optimization as described in [1,2,3].
+ .
+ This package contains some example programs, their source code and
+ example output as provided by upstream.
+ .
+ [1] R. H. Byrd, P. Lu and J. Nocedal. A Limited Memory Algorithm for
+ Bound Constrained Optimization, (1995), SIAM Journal on Scientific
+ and Statistical Computing , 16, 5, pp. 1190-1208.
+ .
+ [2] C. Zhu, R. H. Byrd and J. Nocedal. L-BFGS-B: Algorithm 778:
+ L-BFGS-B, FORTRAN routines for large scale bound constrained
+ optimization (1997), ACM Transactions on Mathematical Software, Vol
+ 23, Num. 4, pp. 550 - 560.
+ .
+ [3] J.L. Morales and J. Nocedal. L-BFGS-B: Remark on Algorithm 778:
+ L-BFGS-B, FORTRAN routines for large scale bound constrained
+ optimization (2011), to appear in ACM Transactions on Mathematical
+ Software. \ No newline at end of file
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..d50c8a8
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,37 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: L-BFGS-B
+Files-Excluded: x.* ._* OUTPUTS/._* ../._Lbfgsb.3.0 linpack.f blas.f
+Source: http://users.iems.northwestern.edu/~nocedal/lbfgsb.html
+ The pristine upstream source contains prebuilt binaries and various metadata
+ files, as well as unused copied of LINPACK and BLAS. These are removed.
+
+Files: *
+Copyright: Ciyou Zhu, Richard Byrd, Jorge Nocedal, Jose Luis Morales
+License: BSD-3-clause
+
+Files: debian/*
+Copyright: 2013-2016 Gard Spreemann <gspreemann@gmail.com>
+License: BSD-3-clause
+
+License: BSD-3-clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the <organization> nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/debian/liblbfgsb-dev.install b/debian/liblbfgsb-dev.install
new file mode 100755
index 0000000..15ec573
--- /dev/null
+++ b/debian/liblbfgsb-dev.install
@@ -0,0 +1,6 @@
+#!/usr/bin/dh-exec
+# We need a dynamic .install file for Multi-Arch.
+# See https://wiki.debian.org/Multiarch/Implementation
+
+build/liblbfgsb.so usr/lib/${DEB_HOST_MULTIARCH}/
+build/liblbfgsb.a usr/lib/${DEB_HOST_MULTIARCH}/
diff --git a/debian/liblbfgsb-doc.install b/debian/liblbfgsb-doc.install
new file mode 100644
index 0000000..e2e27be
--- /dev/null
+++ b/debian/liblbfgsb-doc.install
@@ -0,0 +1 @@
+*.pdf usr/share/doc/liblfgsb/ \ No newline at end of file
diff --git a/debian/liblbfgsb-examples.docs b/debian/liblbfgsb-examples.docs
new file mode 100644
index 0000000..ff77c49
--- /dev/null
+++ b/debian/liblbfgsb-examples.docs
@@ -0,0 +1,2 @@
+driver*.f*
+OUTPUTS/output_* \ No newline at end of file
diff --git a/debian/liblbfgsb-examples.install b/debian/liblbfgsb-examples.install
new file mode 100644
index 0000000..b2e3043
--- /dev/null
+++ b/debian/liblbfgsb-examples.install
@@ -0,0 +1,6 @@
+build/lbfgsb-examples_driver1_77 usr/bin/
+build/lbfgsb-examples_driver1_90 usr/bin/
+build/lbfgsb-examples_driver2_77 usr/bin/
+build/lbfgsb-examples_driver2_90 usr/bin/
+build/lbfgsb-examples_driver3_77 usr/bin/
+build/lbfgsb-examples_driver3_90 usr/bin/ \ No newline at end of file
diff --git a/debian/liblbfgsb0.install b/debian/liblbfgsb0.install
new file mode 100755
index 0000000..68cdc0a
--- /dev/null
+++ b/debian/liblbfgsb0.install
@@ -0,0 +1,5 @@
+#!/usr/bin/dh-exec
+# We need a dynamic .install file for Multi-Arch.
+# See https://wiki.debian.org/Multiarch/Implementation
+
+build/liblbfgsb.so.0 usr/lib/${DEB_HOST_MULTIARCH}/
diff --git a/debian/patches/replace-linpack-with-lapack.patch b/debian/patches/replace-linpack-with-lapack.patch
new file mode 100644
index 0000000..83e3261
--- /dev/null
+++ b/debian/patches/replace-linpack-with-lapack.patch
@@ -0,0 +1,76 @@
+The library code originally uses LINPACK (from an embedded
+copy). Since LINPACK has largely been superseded by LAPACK, this patch
+replaces calls to the former with equivalent calls to the
+latter. Specifically, dpofa is replaced by dpotrf, and dtrsl is
+replaced by dtrtrs.
+--- a/lbfgsb.f
++++ b/lbfgsb.f
+@@ -1185,7 +1185,7 @@
+ p(i2) = v(i2) + sum
+ 20 continue
+ c Solve the triangular system
+- call dtrsl(wt,m,col,p(col+1),11,info)
++ call dtrtrs('U', 'T', 'N', col, 1, wt, m, p(col+1), col, info)
+ if (info .ne. 0) return
+
+ c solve D^(1/2)p1=v1.
+@@ -1197,7 +1197,7 @@
+ c [ 0 J' ] [ p2 ] [ p2 ].
+
+ c solve J^Tp2=p2.
+- call dtrsl(wt,m,col,p(col+1),01,info)
++ call dtrtrs('U', 'N', 'N', col, 1, wt, m, p(col+1), col, info)
+ if (info .ne. 0) return
+
+ c compute p1=-D^(-1/2)(p1-D^(-1/2)L'p2)
+@@ -2135,7 +2135,7 @@
+
+ c first Cholesky factor (1,1) block of wn to get LL'
+ c with L' stored in the upper triangle of wn.
+- call dpofa(wn,m2,col,info)
++ call dpotrf('U', col, wn, m2, info)
+ if (info .ne. 0) then
+ info = -1
+ return
+@@ -2143,7 +2143,7 @@
+ c then form L^-1(-L_a'+R_z') in the (1,2) block.
+ col2 = 2*col
+ do 71 js = col+1 ,col2
+- call dtrsl(wn,m2,col,wn(1,js),11,info)
++ call dtrtrs('U', 'T', 'N', col, 1, wn, m2, wn(1,js), col, info)
+ 71 continue
+
+ c Form S'AA'S*theta + (L^-1(-L_a'+R_z'))'L^-1(-L_a'+R_z') in the
+@@ -2158,7 +2158,7 @@
+
+ c Cholesky factorization of (2,2) block of wn.
+
+- call dpofa(wn(col+1,col+1),m2,col,info)
++ call dpotrf('U', col, wn(col+1,col+1), m2, info)
+ if (info .ne. 0) then
+ info = -2
+ return
+@@ -2227,7 +2227,7 @@
+ c Cholesky factorize T to J*J' with
+ c J' stored in the upper triangle of wt.
+
+- call dpofa(wt,m,col,info)
++ call dpotrf('U', col, wt, m, info)
+ if (info .ne. 0) then
+ info = -3
+ endif
+@@ -3208,12 +3208,12 @@
+
+ m2 = 2*m
+ col2 = 2*col
+- call dtrsl(wn,m2,col2,wv,11,info)
++ call dtrtrs('U', 'T', 'N', col2, 1, wn, m2, wv, col2, info)
+ if (info .ne. 0) return
+ do 25 i = 1, col
+ wv(i) = -wv(i)
+ 25 continue
+- call dtrsl(wn,m2,col2,wv,01,info)
++ call dtrtrs('U', 'N', 'N', col2, 1, wn, m2, wv, col2, info)
+ if (info .ne. 0) return
+
+ c Compute d = (1/theta)d + (1/theta**2)Z'W wv.
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..6d5db6c
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+replace-linpack-with-lapack.patch
+silence.patch
diff --git a/debian/patches/silence.patch b/debian/patches/silence.patch
new file mode 100644
index 0000000..828b96c
--- /dev/null
+++ b/debian/patches/silence.patch
@@ -0,0 +1,33 @@
+The library's documentation indicates that it will only write out
+messages when the iprint flag is greater than zero. There are two
+places where writing still happens unconditionally, which this patch
+fixes.
+
+A similar patch was also applied by the SciPy project (see their issue
+3238).
+--- a/lbfgsb.f
++++ b/lbfgsb.f
+@@ -2550,7 +2550,9 @@
+ if (gd .ge. zero) then
+ c the directional derivative >=0.
+ c Line search is impossible.
+- write(6,*)' ascent direction in projection gd = ', gd
++ if (iprint .ge. 0) then
++ write(6,*)' ascent direction in projection gd = ', gd
++ endif
+ info = -4
+ return
+ endif
+@@ -3279,8 +3281,10 @@
+ 55 continue
+ if ( dd_p .gt.zero ) then
+ call dcopy( n, xp, 1, x, 1 )
+- write(6,*) ' Positive dir derivative in projection '
+- write(6,*) ' Using the backtracking step '
++ if (iprint .ge. 0) then
++ write(6,*) ' Positive dir derivative in projection '
++ write(6,*) ' Using the backtracking step '
++ endif
+ else
+ go to 911
+ endif
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..043b897
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,47 @@
+#!/usr/bin/make -f
+
+SONAME=liblbfgsb.so.0
+
+# Enable hardening, but remove pie flag since we're building a shared
+# object. See also
+# https://lists.debian.org/debian-devel/2013/01/msg00225.html.
+MAINTOPTS = hardening=+all,-pie
+FCFLAGS:=$(shell DEB_BUILD_MAINT_OPTIONS=$(MAINTOPTS) dpkg-buildflags --get FCFLAGS)
+LDFLAGS:=$(shell DEB_BUILD_MAINT_OPTIONS=$(MAINTOPTS) dpkg-buildflags --get LDFLAGS)
+
+MAINTOPTS_EX = hardening=+all
+FCFLAGS_EX:=$(shell DEB_BUILD_MAINT_OPTIONS=$(MAINTOPTS_EX) dpkg-buildflags --get FCFLAGS)
+LDFLAGS_EX:=$(shell DEB_BUILD_MAINT_OPTIONS=$(MAINTOPTS_EX) dpkg-buildflags --get LDFLAGS)
+
+%:
+ dh $@
+
+override_dh_auto_build:
+ mkdir -p build
+ gfortran $(FCFLAGS) -fPIC -o build/lbfgsb.o -c lbfgsb.f
+ gfortran $(FCFLAGS) -fPIC -o build/timer.o -c timer.f
+ gfortran $(FCFLAGS) -shared $(LDFLAGS) -Wl,-soname,$(SONAME) \
+ -o build/$(SONAME) build/lbfgsb.o build/timer.o \
+ -lblas -llapack
+ ar cr build/liblbfgsb.a build/lbfgsb.o build/timer.o
+ ln -s $(SONAME) build/liblbfgsb.so
+
+ gfortran $(FCFLAGS_EX) $(LDFLAGS_EX) \
+ -o build/lbfgsb-examples_driver1_77 driver1.f -llbfgsb -Lbuild
+ gfortran $(FCFLAGS_EX) $(LDFLAGS_EX) \
+ -o build/lbfgsb-examples_driver1_90 driver1.f90 -llbfgsb -Lbuild
+ gfortran $(FCFLAGS_EX) $(LDFLAGS_EX) \
+ -o build/lbfgsb-examples_driver2_77 driver2.f -llbfgsb -Lbuild
+ gfortran $(FCFLAGS_EX) $(LDFLAGS_EX) \
+ -o build/lbfgsb-examples_driver2_90 driver2.f90 -llbfgsb -Lbuild
+ gfortran $(FCFLAGS_EX) $(LDFLAGS_EX) \
+ -o build/lbfgsb-examples_driver3_77 driver3.f -llbfgsb -Lbuild
+ gfortran $(FCFLAGS_EX) $(LDFLAGS_EX) \
+ -o build/lbfgsb-examples_driver3_90 driver3.f90 -llbfgsb -Lbuild
+
+override_dh_auto_clean:
+ rm -rf build
+ dh_auto_clean
+
+override_dh_compress:
+ dh_compress -X.pdf -X.f -X.f90 -Xoutput_
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..db539dc
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,5 @@
+version=3
+
+opts="dversionmangle=s/\+dfsg\.\d+$//,filenamemangle=s/\S+\/v?(\S+)\.tar\.gz/lbfgsb-$1\.tar\.gz/" \
+ http://users.iems.northwestern.edu/~nocedal/lbfgsb.html \
+ Software/Lbfgsb\.(.+)\.tar\.(?:bz2|gz|xz) \ No newline at end of file