Hello everyone,

I’m having trouble using the boost::math::legendre_p function, despite the fact that boost::math::cyl_bessel_k as in the C++ vignette works fine in my code. I’m replacing

double besselK(const double& v, const double& z, std::ostream* pstream__) {

return boost::math::cyl_bessel_k(v, z);

}

in the hpp file with

double legendreP(const int& v, const double& z, std::ostream* pstream__) {

return boost::math::legendre_p(v, z);

}

and adding

real legendreP(int n, real v)

in the functions block. A call to stan_model() with the appropriate include, results in the following error,

Error in dyn.load(libLFile) :

unable to load shared object ‘/var/folders/h_/mp3xxlhd1w3dq4vjwk1f8kcm0000gn/T//RtmpDZF35C/file4816dc396ec.so’:

dlopen(/var/folders/h_/mp3xxlhd1w3dq4vjwk1f8kcm0000gn/T//RtmpDZF35C/file4816dc396ec.so, 6): Symbol not found:/mp3xxlhd1w3dq4vjwk1f8kcm0000gn/T//RtmpDZF35C/file4816dc396ec.soZN5boost4math10legendre_pIdEENS0_5tools12promote_argsIT_fffffE4typeEiS4

Referenced from: /var/folders/h

Expected in: flat namespace

in /var/folders/h_/mp3xxlhd1w3dq4vjwk1f8kcm0000gn/T//RtmpDZF35C/file4816dc396ec.so

Any insights would be greatly appreciated!