the Fink project is an effort to port
popular Unix programs to Mac OS X
Info2: <<
Package: optim%type_pkg[-atlas]-oct%type_pkg[oct]
Version: 1.0.17
Type: oct (3.2.4 3.4.3 3.6.0 3.6.1), forge (optim), -atlas (boolean), gcc (4.6)
Revision: 4
Architecture: <<
(%type_raw[-atlas] != -atlas) powerpc,
(%type_raw[-atlas] != -atlas) i386
<<
Maintainer: Alexander Hansen
# unfortunately, Homepage won't do types
Homepage: http://octave.sourceforge.net/optim/index.html
Description: Nonlinear optimization toolkit for Octave
DescDetail: <<
Non-linear Optimization toolkit.
This package provides the following additional functions:
Minimization:
minimize
nelder_mead_min
d2_min
nrm
fmin
line_min
fmins
adsmax
mdsmax
nmsmax
bfgsmin
samin
battery
fminsearch
cg_min
de_min
Data fitting
expfit
wpolyfit
leasqr
nonlin_residmin
nonlin_curvefit
LinearRegression
Zero finding
vfzero
Compatibility
fminunc_compat
optimset_compat
linprog
Numerical derivatives
dfdp
dcdp
dfpdp
dfxpdp
cdiff
deriv
numgradient
numhessian
Pivoting
cpiv_bard
gjp
Tests
test_min_1
test_min_2
test_min_3
test_min_4
test_d2_min_1
test_d2_min_2
test_d2_min_3
test_nelder_mead_min_1
test_nelder_mead_min_2
poly_2_ex
test_minimize_1
optim_problems
Examples
bfgsmin_example
rosenbrock
samin_example
<<
License: GPL2+/GFDL
# All octave-forge packages have to have the following BuildDepends:
# octave%type_pkg[oct]-dev | octave%type_pkg[oct]-atlas-dev,
# fftw3,
# ( %type_pkg[oct] = 305 ) hdf5.7-oldapi,
# ( %type_pkg[oct] != 305 ) hdf5.7
#
# Packages which serve only Octave-3.0.5 or only Octave > 3.0.5 need
# not use the conditional, of course.
BuildDepends: <<
(%type_raw[-atlas] = -atlas) atlas,
(%type_raw[-atlas] = -atlas) liboctave%type_pkg[oct]-atlas-dev,
(%type_raw[-atlas] != -atlas) liboctave%type_pkg[oct]-veclib-dev,
( %type_pkg[oct] << 360 ) liboctave%type_pkg[oct]-gcc%type_pkg[gcc]-dev,
fftw3,
hdf5.7,
fink (>=0.32)
<<
RuntimeDepends: <<
miscellaneous-oct%type_pkg[oct] (>= 1.0.11-1),
struct-oct%type_pkg[oct] (>= 1.0.9-1)
<<
Depends: <<
(%type_raw[-atlas] = -atlas) atlas-shlibs,
(%type_raw[-atlas] = -atlas) octave%type_pkg[oct]-interpreter-atlas,
(%type_raw[-atlas] != -atlas) octave%type_pkg[oct]-interpreter-veclib,
( %type_pkg[oct] << 360 ) gcc%type_pkg[gcc]-shlibs
<<
Conflicts: octave-forge
Replaces: octave-forge-%type_raw[forge] (<< 1.0.4-999)
Source-MD5: 2c0fec7cab490df5095b21a9c8e64bd1
#### Insert required changes here ####
PatchFile: optim-oct.patch
PatchFile-MD5: e45618d83c085c4692c5b320bfab8bc7
######################################
# Do not change anything from this point down, unless absolutely necessary,
# since the foo-oct%type_pkg[oct] packages are designed to be built/installed
# in the same way.
Source: mirror:sourceforge:octave/%type_raw[forge]-%v.tar.gz
NoSetCPPFLAGS: true
NoSetLDFLAGS: true
SetLIBRARY_PATH: /usr/X11R6/lib:%p/lib
UseMaxBuildJobs: false
BuildAsNobody: false
CompileScript: <<
#!/bin/sh -ev
if [ $UID -ne 0 ]
then
echo "%n cannot be built with --build-as-nobody"
exit 1
fi
export OCTAVE=%p/bin/octave-%type_raw[oct]
# repack tarball, since octave-3.4.3 appears not to want to install
# from directories
if [ %type_pkg[oct] -ge 343 ]
then
cd ..
tar -cf %type_raw[forge]-%v.tar %type_raw[forge]-%v
cd %b
pkgsrc=%type_raw[forge]-%v.tar
else pkgsrc=%type_raw[forge]-%v
fi
%p/share/octave/%type_raw[oct]/scripts/octave-forge-compile.sh $pkgsrc
<<
InstallScript: <<
#!/bin/sh -ev
%p/share/octave/%type_raw[oct]/scripts/octave-forge-install.sh %type_raw[forge]-%v %i %b
mkdir -p %i/share/octave/%type_raw[oct]/%type_raw[forge]-%v
# copy template scripts
cp %p/share/octave/%type_raw[oct]/scripts/octave-forge-prerm %p/share/octave/%type_raw[oct]/scripts/octave-forge-postinst %i/share/octave/%type_raw[oct]/%type_raw[forge]-%v
cd %i/share/octave/%type_raw[oct]/%type_raw[forge]-%v
sed -i -e 's/@PKGNAME@/%type_raw[forge]-%v/' octave-forge-postinst
sed -i -e 's/@PKGNAME@/%type_raw[forge]/' octave-forge-prerm
chmod a+x octave-forge*
<<
PostInstScript: <<
if [ -s %p/var/octave/%type_raw[oct]/octave_packages ] && [ -f %p/var/octave/%type_raw[oct]/octave_packages ]
then
%p/share/octave/%type_raw[oct]/%type_raw[forge]-%v/octave-forge-postinst
else
mv %p/share/octave/%type_raw[oct]/packages/%type_raw[forge]-%v/octave_packages %p/var/octave/%type_raw[oct]/octave_packages
fi
<<
PreRmScript: %p/share/octave/%type_raw[oct]/%type_raw[forge]-%v/octave-forge-prerm
DescPackaging: <<
This package:
The PatchFile is required for Octave-3.6.0+, which doesn't export LAPACK symbols.
It's harmless for older Octaves.
This has been added to the upstream development source, and presumably will go
away at the next version.
Common for all octave-forge packages.
We read in postinst and prerm template scripts installed by octaveN and modify
them to use the name of this package because Octave's package manager can't
cope with non-literal arguments.
The Type: forge (pkgname) is used to minimize what needs to be changed when
using this .info file as a template.
<<
<<
diff -Nurd optim-1.0.17/src/Makefile optim-1.0.17.patched/src/Makefile
--- optim-1.0.17/src/Makefile 2011-07-04 09:02:03.000000000 -0400
+++ optim-1.0.17.patched/src/Makefile 2012-01-19 15:18:29.000000000 -0500
@@ -1,11 +1,12 @@
ifndef MKOCTFILE
MKOCTFILE := mkoctfile
endif
+LAPACK_LIBS := $(shell mkoctfile -p LAPACK_LIBS)
all: __bfgsmin.oct numgradient.oct numhessian.oct samin.oct __disna_optim__.oct
%.oct: %.cc
- $(MKOCTFILE) -s $<
+ $(MKOCTFILE) -s $< ${LAPACK_LIBS}
clean:
-rm *.o core octave-core *.oct *~