Hello All,
For my simulation i need a RNG(Random Number Generator) which is not included in neuron (Levy Distribution). I wrote a mod file with the c code that will invoke the method gsl_ran_levy. the function gsl_ran_levy is part of the GSL Library located under usr/local/gsl.
After building the mod file with nrnivmodl, when i run nrniv i get the following error:
loading membrane mechanisms from x86_64/.libs/libnrnmech.so
dlopen failed -
x86_64/.libs/libnrnmech.so: undefined symbol: gsl_rng_default
I think i need to change the configuration that it will be referenced to the gsl library but i dont know how to do it under neuron
Can someone please help
The mod file:
levy.mod
NEURON {SUFFIX nothing}
VERBATIM
#include <stdio.h>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>
/* all the c code needed for gsl_ran_levy here */
static gsl_rng* r;
static gsl_rng_type * T;
static double levy_wrapper(double c, double alpha) {
if (!r) {
T = gsl_rng_default;
r = gsl_rng_alloc (T);
}
return gsl_ran_levy(r, c, alpha);
}
ENDVERBATIM
FUNCTION levy(c, a) {
VERBATIM
_llevy = levy_wrapper(_lc,_la);
ENDVERBATIM
}
Adding C code in a model file
nrnivmodl needs to link against the gsl library. Use the nrnivmodl option -loadflags. Perhaps
will work or perhaps you also need a -Lpath_to_gsl_library
Code: Select all
nrnivmodl -loadflags -lgsl