Open richfitz opened 4 years ago
I think we are aware and don't really have a solution yet (we were also not sure if this case was really affecting anyone and whether it was worth doing something about it).
See also #10 and the related PR #11, as part of which the documentation has been updated to reflect this problem with MacOS (this should go into an upcoming new release of rTRNG, which is pending some valgrind
investigations but hopefully not too far away).
@riccardoporreca might want to add something?
Thanks for the response - I can confirm that on my mac rTRNG::check_rTRNG_linking()
fails in the new version. If this is fixable we would try and use your package, otherwise we'll have to look at bundling trng too (or using something else), but your package looked very convenient!
@richfitz, I plan to go back to this in July to invetigate alternative ways of making a shared / dynamic library with TRNG available for linking in other R projects on macOS, where the library built as part of a standard R package installation cannot be linked against.
If you have a specific R project where you want to start using the TRNG library in C++ code, for the time being you can easily set it up as an R package with inst/include/trng
, src/trng
and src/Makevars
same as in rTRNG. Any custom C++ code under src
using TRNG will then work, similar to src/rdist.cpp
. This is actually how we started using TRNG in an R project before deciding to make the rTRNG package.
I am trying to use rTRNG within a package and hitting an issue with the linking. Following #8 (which is probably the same underlying issue) have have created a basic skeleton following your instructions, which is here: https://github.com/richfitz/pkgUsingTRNG (unchanged from the result of running the demo script).
This appears to build, but does not load for me on macOS with the error:
(this is on R 3.6.1 on macOS 10.14.6 using the CRAN version of rTRNG)
In contrast this works fine on ubuntu (tested via docker using rocker/r-ver:4.0.0):
I have not yet tested this on windows.
Do you have any ideas as to why this might not work? Has this been found to work on macOS previously?