开发者

Example code given for curve fitting with Gnu Scientific Library wont run.

I am trying to use GSL for least square fitting, but I can't even make the example run properly. It compiles, but when running the program it gives the 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 have narrowed down the problem to the line

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

but I have not the slightest clue why.

I am running it on OSX with GSL 1.15 (though I innitially insalled the wrong version, 1.9). I compile it in the terminal usi开发者_如何学运维ng: gcc unchanged_example.c -o examplefitter -lgsl -lm

EDIT: solution was found here. adding '-lgslcblas' when compiling sorted it out


For anyone coming across this you need to link against two libraries...

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


You need to find the shared library that contains _cblas_dnrm2 and link it into your application.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜