help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: octave-forge: gsl oct files don't execute


From: Marius Schamschula
Subject: Re: octave-forge: gsl oct files don't execute
Date: Sat, 28 May 2005 05:46:25 -0500

Glen,

Many thanks for pointing this out. I've rebuilt my octave-forge packages withe this patch, rather than my old work-around.

On May 27, 2005, at 1:27 PM, Glen Henshaw wrote:

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

Marius
--
Marius Schamschula                               Webmaster

        The Huntsville Macintosh Users Group
                    www.hmug.org

webmaster at hmug dot org    marius at schamschula dot com



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]