I am having an extraordinary problem with my current Code::Blocks (GNU GCC compiler) setup. The compiler seems to selectively run some GSL functions, but seems for some reason to have great problems when commanded to execute other GSL functions.
For example, I have lifted the following code from the following destination: https://www.gnu.org/software/gsl/manual/html_node/Example-programs-for-matrices.html
I assume that because the code is derived from the official GNU website, that the code is correct:
#include <math.h>
#include <stdio.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_blas.h>
int
main (void)
{
size_t i,j;
gsl_matrix *m = gsl_matrix_alloc (10, 10);
for (i = 0; i < 10; i++)
for (j = 0; j < 10; j++)
gsl_matrix_set (m, i, j, sin (i) + cos (j));
for (j = 0; j < 10; j++)
{
gsl_vector_view column = gsl_matrix_column (m, j);
double d;
d = gsl_blas_dnrm2 (&column.vector);
printf ("matrix column %d, norm = %g\n", j, d);
}
gsl_matrix_free (m);
return 0;
}
From debugging, I have learned that the source of the error is the following line:
d = gsl_blas_dnrm2 (&column.vector);
The compiler crashes at this point and prints the following error message:
Process returned -1073741819 <0xC0000005>
I have spent a lot of time trying to discover the source of the bug but have sadly not had much success. I am generally not sure why there is a crash at all. The debugger prints no warnings or error messages.