address@hidden:~/simulation nice$ gcc -Wall -W -Werror -g -o code code.c -I/usr/local/include -L/usr/local/lib -lgsl -lgslcblas -lm address@hidden:~/simulation nice$ ./code Segmentation fault address@hidden:~/simulation nice$ gdb GNU gdb 6.8-debian Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i486-linux-gnu". (gdb) file co co: No such file or directory. (gdb) file co code code.c command_file.doc (gdb) file code Reading symbols from /home/kanaan/simulation nice/code...done. (gdb) run Starting program: /home/kanaan/simulation nice/code Program received signal SIGSEGV, Segmentation fault. 0xb7e54b0d in gsl_integration_qag (f=0xbfe94b60, a=0, b=100, epsabs=0, epsrel=9.9999999999999995e-08, limit=50, key=6, workspace=0x80721f8, result=0xbfe94b70, abserr=0xbfe94b68) at initialise.c:31 31 initialise.c: No such file or directory. in initialise.c (gdb) bt #0 0xb7e54b0d in gsl_integration_qag (f=0xbfe94b60, a=0, b=100, epsabs=0, epsrel=9.9999999999999995e-08, limit=50, key=6, workspace=0x80721f8, result=0xbfe94b70, abserr=0xbfe94b68) at initialise.c:31 #1 0x08049276 in p_simfunc (z=69.695184840895408, SFR_index=1) at code.c:147 #2 0x08049359 in main () at code.c:175 (gdb) b Breakpoint 1 at 0xb7e54b0d: file initialise.c, line 31. (gdb) up #1 0x08049276 in p_simfunc (z=69.695184840895408, SFR_index=1) at code.c:147 147 gsl_integration_qag (&F, zmin, zmax, 0, 1e-7, 50, 6,w, &int_p_unor, &err); (gdb) up #2 0x08049359 in main () at code.c:175 175 if (z_test > p_simfunc(z_rand, SFR_index)) (gdb) up Initial frame selected; you cannot go up. (gdb) ************************************************************************************** NOTE : the file HEADER are installed in usr/local/include the libraries are installed in usr/local /lib (see below) address@hidden:/usr/local/lib$ ls libgsl.a libgslcblas.so libgsl.la libgsl.so.0.12.0 libgslcblas.la libgslcblas.so.0.0.0 libgsl.so.0 ***************************************************************************************** the piece of code where the compiler is stuck : --------------------------------------------- /*define the func to be integrated*/ double inv_H(double z, void *params_ptr) { double params = *(double*)params_ptr; /*printf("H_inv test passed succesfully: %g\n", params*pow(Hfunc(z), -1.0)); */ double inv_H = params*pow(Hfunc(z), -1.0); return inv_H; } /*define Dl*/ double Dlfunc(double z) { double Dl; double int_invH, err; /*declare the ouptput of the integration and its error*/ double params = 1.0; gsl_integration_workspace* w=gsl_integration_workspace_alloc(10000); F.function = &inv_H; F.params = ¶ms; gsl_integration_qag (&F, zmin, z, 0, 1e-7, 50, 6, w, &int_invH, &err); Dl=c*(1+z)*int_invH ; gsl_integration_workspace_free (w);/*clean workspace for the second call of Dlfunc*/ return Dl; }