I found and fixed my problem. The problem, as I suspected, was that
the main/gsl/gsl_sf.cc file was being generated incorrectly. The fix
comes from a NetBSD port patch available at
http://cvsweb.se.netbsd.org/index.cgi/pkgsrc/math/octave-forge/
patches/patch-aa
The notes attached to the patch say:
"Use awk instead of csplit during the build. csplit was only
used in one place and it generated a build dependency on a package
which conflicts with many other pkgs."
The patch is:
--- main/gsl/replace_template.sh.orig 2004-05-04 15:49:42.000000000
+0000
+++ main/gsl/replace_template.sh 2005-03-18 20:26:03.000000000 +0000
@@ -1,8 +1,11 @@
#!/bin/sh
-csplit -f tmp_gsl $1 /DEFUN/ /GSL_FUNC_DOCSTRING/ /./ > /dev/null
+awk '/DEFUN/ {exit} {print}' $1 > tmp_gsl00
+awk '/DEFUN/ {state=1} /GSL_FUNC_DOCSTRING/ {if(state==1){exit}}
state==1{print}' $1 > tmp_gsl01
+awk '/DEFUN/ {state=1} /GSL_FUNC_DOCSTRING/ {if(state==1){print ;
exit}}' $1 > tmp_gsl02
+awk 'state==2{print} /DEFUN/ {state=1} /GSL_FUNC_DOCSTRING/
{if(state==1){state=2}}' $1 > tmp_gsl03
cat tmp_gsl01 | sed "s/GSL_OCTAVE_NAME/$octave_name/g"
cat docstring.txt | sed 's/\\/\\\\/g' | sed 's/$/\\n\\/g'
cat tmp_gsl03 | sed "s/GSL_OCTAVE_NAME/$octave_name/g" | sed
"s/GSL_FUNC_NAME/$funcname/g"
-rm -f tmp_gsl* docstring.txt
\ No newline at end of file
+rm -f tmp_gsl* docstring.txt
Applying it leads to a new main/gsl/replace_template.sh file:
#!/bin/sh
awk '/DEFUN/ {exit} {print}' $1 > tmp_gsl00
awk '/DEFUN/ {state=1} /GSL_FUNC_DOCSTRING/ {if(state==1){exit}}
state==1{print}' $1 > tmp_gsl01
awk '/DEFUN/ {state=1} /GSL_FUNC_DOCSTRING/ {if(state==1){print ;
exit}}' $1 > tmp_gsl02
awk 'state==2{print} /DEFUN/ {state=1} /GSL_FUNC_DOCSTRING/
{if(state==1){state=2}}' $1 > tmp_gsl03
cat tmp_gsl01 | sed "s/GSL_OCTAVE_NAME/$octave_name/g"
cat docstring.txt | sed 's/\\/\\\\/g' | sed 's/$/\\n\\/g'
cat tmp_gsl03 | sed "s/GSL_OCTAVE_NAME/$octave_name/g" | sed
"s/GSL_FUNC_NAME/$funcname/g"
rm -f tmp_gsl* docstring.txt
The build now runs cleanly the first time through, the gsl_sf.cc file
is much longer than it was before, and I can execute gsl functions
from octave:
octave:1> help zeta
zeta is the dynamically-linked function from the file
/opt/local/libexec/octave/2.1.71/site/oct/powerpc-apple-darwin8.1.0/
octave-forge/zeta.oct
function y = zeta (x)
These routines compute the Riemann zeta function \zeta(s) for
arbitrary s, s \ne 1.
The Riemann zeta function is defined by the infinite sum
\zeta(s) = \sum_{k=1}^\infty k^{-s}.
This function is from the GNU Scientific Library,
see http://www.gnu.org/software/gsl/ for documentation.
Additional help for built-in functions, operators, and variables
is available in the on-line version of the manual. Use the command
`help -i <topic>' to search the manual index.
Help and information about Octave is also available on the WWW
at http://www.octave.org and via the address@hidden
mailing list.
octave:2> zeta(2)
ans = 1.6449
Thanks for the help,
Glen