The sample code provided to fit the curve with the Gnu science library does not start.

I am trying to use GSL for the least square, but I can't even do an example correctly. It compiles, but when the program starts, it gives an error

dyld: lazy symbol binding failed: Symbol not found: _cblas_dnrm2

Referenced from: /usr/local/lib/libgsl.0.dylib

Expected in: dynamic lookup

I believe I narrowed the problem down to a line

gsl_multifit_fdfsolver_set (s, &f, &x.vector);

but I do not know why.

I run it on OSX with GSL 1.15 (although I am really unhappy with the wrong version, 1.9). I will compile it in the terminal using:gcc unchanged_example.c -o examplefitter -lgsl -lm

EDIT: solution found here . adding ' -lgslcblas' at compilation sorted

+3
source share
2 answers

You need to find a shared library that contains _cblas_dnrm2and link it to your application.

+1

, , ...

gcc -Wall -O3 -g -lgslcblas -lgsl -std=c11 -pedantic-errors
+2

All Articles