I'm trying to write a nimble model using custom distributions. I get the following error :
[Note] This may take a minute.
[Note] Use 'showCompilerOutput = TRUE' to see C++ compilation details.
Error: Failed to create the shared library. Run 'printErrors()' to see the compilation errors.
In addition: Warning messages:
1: variable 'T' has not been created yet.
2: variable 'T' has not been created yet.
using C++ compiler: ‘g++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0’
P_1_code_MID_1_nfCode.cpp: In function ‘double rcFun_R_GlobalEnv5(double, double, double, NimArr<2, double>&, int)’:
P_1_code_MID_1_nfCode.cpp:318:49: error: ‘T’ was not declared in this scope
318 | logProb = dnorm(Interm_27, ARG1_x_, Interm_28, T);
P_1_code_MID_1_nfCode.cpp:323:50: error: ‘T’ was not declared in this scope
323 | logProb = dnorm(curve_mean, ARG1_x_, Interm_29, T);
make: *** [/usr/lib/R/etc/Makeconf:200: P_1_code_MID_1_nfCode.o] Error 1
I have attached the code here. I've tried removing and re-installing the package, both from CRAN and GitHub directly. Any ideas would be greatly appreciated. The custom distribution and the related function for sampling from it are performing outside nimble as expected.