[Help-gsl] Error message during compile - Versions 1.8 & 1.7

2006-07-18 Thread Martin Stennett
I have gone through the installation process for both v1.8 and v1.7 as 
laid out in the file INSTALL that came with each distribution. I used 
the option --prefix=/home/P05/stennetm/gsl as I could not write to the 
default directory.
I then tried to compile a C++ program which makes use of the evolving 
solver in almost exactly the same way as is done in the example in the 
manual. I used the command 'g++ -L/home/P05/stennetm/gsl/lib -lgsl 
-lgslcblas -lm  -I/home/P05/stennetm/gsl/include three.cc' and got the 
following errors:


/tmp/ccngDDtB.o(.text+0x11e): In function `main':
: undefined reference to `gsl_odeiv_step_rk8pd'
/tmp/ccngDDtB.o(.text+0x13b): In function `main':
: undefined reference to `gsl_odeiv_step_alloc'
/tmp/ccngDDtB.o(.text+0x15e): In function `main':
: undefined reference to `gsl_odeiv_control_y_new'
/tmp/ccngDDtB.o(.text+0x17b): In function `main':
: undefined reference to `gsl_odeiv_evolve_alloc'
/tmp/ccngDDtB.o(.text+0x45d): In function `main':
: undefined reference to `gsl_odeiv_evolve_apply'
collect2: ld returned 1 exit status

I then tried enclosing the headers in extern "C" {} braces and disabling 
the shared libraries, none of which made any difference. I'm running 
Fedora Core 3 with g++ version 3.4.4. Is there anything I should be 
doing to get this to work?


The full code for the C++ program is available on request as are any 
more details that might be required.



___
Help-gsl mailing list
Help-gsl@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gsl


[Help-gsl] Error handling

2006-07-18 Thread Raphael Mack
Hello,

I've problems understanding the error handling stuff of gsl.
What I want to execute code like the following:

double x = 9e307;
int result;
gsl_matrix A, B;
A = gsl_matrix_alloc(1, 2);
B = gsl_matrix_alloc(1, 2);

gsl_matrix_set(A, 0, 0, x);
gsl_matrix_set(A, 0, 1, 1);
gsl_matrix_memcpy(B, A);

result = gsl_matrix_add(A, B);

The last line will overflow for element (0, 0) so I'd like to see the
value of A = [Inf, 3] and I expected result == GSL_EOVRFLW.

I wonder how I can compile my app and setup gsl to get this behavior,
because I already played with gsl_ieee_set_mode, but then I get an OS
signal which I don't like.

Thanks in advance for any hint.

Raphael



___
Help-gsl mailing list
Help-gsl@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gsl


Re: [Help-gsl] GSL_RANGE_CHECK

2006-07-18 Thread Brian Gough
At Mon, 17 Jul 2006 21:52:05 +0200,
Raphael Mack wrote:
> I'm writing a wrapper for the Eiffel language for the gsl lib. Since
> Eiffel provides contracts, we can be sure that all calls to gsl have
> valid indexes and runtime checking for the range may be dropped. I tired
> to do this by compiling with -UGSL_RANGE_CHECK, but matrix access are
> checked. Looking into the source showed, that in gsl/gsl_check_range.h a
> global variable gsl_check_range is defined, which is tested on every
> vector and matrix access. This is even initialized to 1 by default.
> 
> Is there a way to get high performance and compile completely without
> range checking? Or is the way to go just to set gsl_check_range to 0?

Set gsl_check_range to zero to disable range checking in the static
functions.

Note that there are inline versions of these functions and these are
controlled by the preprocessor definitions GSL_RANGE_CHECK and
HAVE_INLINE.

By default GSL builds using the inline versions internally so calls to
the static functions should be rare.

-- 
best regards,

Brian Gough

Network Theory Ltd,
Publishing the GSL Manual - http://www.network-theory.co.uk/gsl/manual/



___
Help-gsl mailing list
Help-gsl@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gsl


Re: [Help-gsl] Error handling

2006-07-18 Thread Brian Gough
At Tue, 18 Jul 2006 15:17:40 +0200,
Raphael Mack wrote:
> The last line will overflow for element (0, 0) so I'd like to see the
> value of A = [Inf, 3] and I expected result == GSL_EOVRFLW.
> 
> I wonder how I can compile my app and setup gsl to get this behavior,
> because I already played with gsl_ieee_set_mode, but then I get an OS
> signal which I don't like.

We don't handle IEEE overflow, it's left to the user to detect it.

You can use the standard C function fetestexcept() to check whether
any IEEE exceptions were raised during a function call and then reset
them if necessary.

-- 
Brian Gough

Network Theory Ltd,
Publishing the GSL Manual - http://www.network-theory.co.uk/gsl/manual/


___
Help-gsl mailing list
Help-gsl@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gsl


Re: [Help-gsl] Error message during compile - Versions 1.8 & 1.7

2006-07-18 Thread Brian Gough
At Tue, 18 Jul 2006 09:59:04 +0100,
Martin Stennett wrote:
> I then tried to compile a C++ program which makes use of the evolving 
> solver in almost exactly the same way as is done in the example in the 
> manual. I used the command 'g++ -L/home/P05/stennetm/gsl/lib -lgsl 
> -lgslcblas -lm  -I/home/P05/stennetm/gsl/include three.cc' and got the 
> following errors:
> 
> /tmp/ccngDDtB.o(.text+0x11e): In function `main':
> : undefined reference to `gsl_odeiv_step_rk8pd'

A couple of things to try:
http://www.network-theory.co.uk/docs/gccintro/gccintro_18.html
http://www.network-theory.co.uk/docs/gccintro/gccintro_90.html

The header files are wrapped in extern "C" automatically so that's covered.

-- 
Brian Gough

Network Theory Ltd,
Publishing the GSL Manual - http://www.network-theory.co.uk/gsl/manual/



___
Help-gsl mailing list
Help-gsl@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gsl


[Help-gsl] fitting example

2006-07-18 Thread Petr Ent
hi,
i have next (hopefully last :-) ) question about non-linear fitting example. 
function 

int expb_f (const gsl_vector * x, void *data,  gsl_vector * f)
"this function should store the vector result f(x,params) in f for argument x 
and arbitrary parameters params"

i understand it that you should compute the value of your function to be fitted 
with current results (x vector) and store it to vector f. but in this example, 
you do that + substract "real value" (y_i) from it and divide it by deviation 
(sigma_i).

gsl_vector_set (f, i, (Yi - y[i])/sigma[i]);

why do you do that? and what if you dont know deviation of data to be fitted?

thanks for answering
Petr Ent



___
Help-gsl mailing list
Help-gsl@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gsl