nimble error Failed to create the shared library

13 views
Skip to first unread message

raffaele liguori

unread,
Jul 9, 2024, 7:06:58 AM (13 days ago) Jul 9
to nimble-users
Hi everyone,
I try to use compileNimble function, after installed required R and Rtools, with Windows and with an AMD processor and i have this error:
Errore: Failed to create the shared library. g++ -std=gnu++17 -I"C:/PROGRA~1/R/R-43~1.2/include" -DNDEBUG -DR_NO_REMAP -I"C:\Users\raffl\AppData\Local\R\win-library\4.3\nimble\include" -I"" -DEIGEN_MPL2_ONLY=1 -Wno-misleading-indentation -Wno-ignored-attributes -Wno-deprecated-declarations -std=c++11 -I"c:/rtools43/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c dynamicRegistrations_07_09_00_07_53.cpp -o dynamicRegistrations_07_09_00_07_53.o using C++ compiler: 'g++ (GCC) 11.4.0' In file included from C:\Users\raffl\AppData\Local\R\win-library\4.3\nimble\include/cppad/core/forward/forward.hpp:18, from C:\Users\raffl\AppData\Local\R\win-library\4.3\nimble\include/cppad/core/fun_eval.hpp:16, from C:\Users\raffl\AppData\Local\R\win-library\4.3\nimble\include/cppad/core/ad_fun.hpp:873, from C:\Users\raffl\AppData\Local\R\win-library\4.3\nimble\include/cppad/cppad.hpp:63, from C:\Users\raffl\AppData\Local\R\win-library\4.3\nimble\include/nimble/Utils.h:32, from C:\Users\raffl\AppData\Local\R\win-library\4.3\nimble\include/nimble/RcppUtils.h:31, from C:\Users\raffl\AppData\Local\R\win-library\4.3\nimble\include/nimble/dynamicRegistrations.h:27, from dynamicRegistrations_07_09_00_07_53.cpp:1: C:\Users\raffl\AppData\Local\R\win-library\4.3\nimble\include/cppad/core/check_for_nan.hpp: In function 'void CppAD::put_check_for_nan(const CppAD::vector<Type>&, std::string&)': C:\Users\raffl\AppData\Local\R\win-library\4.3\nimble\include/cppad/core/check_for_nan.hpp:190:14: error: there are no arguments to 'mkstemp' that depend on a template parameter, so a declaration of 'mkstemp' must be available [-fpermissive] 190 | int fd = mkstemp(pattern); | ^~~~~~~ C:\Users\raffl\AppData\Local\R\win-library\4.3\nimble\include/cppad/core/check_for_nan.hpp:190:14: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) make: *** [C:/PROGRA~1/R/R-43~1.2/etc/x64/Makeconf:272: dynamicRegistrations_07_09_00_07_53.o] Error

Then i try to install from source but the package is not installed.
Can anyone help me?
Thank you in advance.

Perry de Valpine

unread,
Jul 9, 2024, 11:29:16 AM (13 days ago) Jul 9
to raffaele liguori, nimble-users
Hi Raffaele,

Thanks for the message.

This looks like a system configuration issue, and it is hard for us to diagnose those. I notice that the R version referenced in the paths of your output is 4.3 (over a year old) and the gcc (g++) version is 11.4.0. I am not an expert on versions of gcc but on my Windows setup used for some package testing, the gcc version (from "system('g++ --version')") is 13.2.0. Sometimes when people get stuck like this, they find success in reinstalling freshly and in order, R, Rtools (making sure to get the version that matches your version of R), and nimble. Have you tried that?

Another less likely possibility is if you have a Makevars file that is being used instead of the one(s) nimble tries to put in place. (Makevars provides C++ compiler flags, for example.)

FWIW, the offending C++ code is in the CppAD package, which is included with nimble. So it is not code we wrote but we do need to ensure it works. I believe there have been changes in recent R versions in default C++ standard, so I can't rule out that on some system this could give an unforeseen problem, but given that your output appears to show an older version of R, I am guessing that is the place to start.

Please let us know if any of this helps. The nimble core team has a variety of travel these days so we may be slow to respond. Other users on this list have sometimes saved the day on configuration issues, so please chime in!

HTH
Perry


--
You received this message because you are subscribed to the Google Groups "nimble-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nimble-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nimble-users/8365c7f2-29b0-4922-bc3a-ec0d3c1a0cd4n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages