loading D into R in OSX. Dynamic libraries problem

Michael lachmann at eva.mpg.de
Sat Jun 26 11:07:28 PDT 2010


== Quote from Jacob Carlborg (doob at me.com)'s article
> First, have you built Tango as a dynamic library, using "bob" with the
> "-d" flag? Oh I see now that you use an older version of Tango. Download
> the latest version from trunk and use "bob" with the "-d" flag to build
> Tango as a dynamic library. Then you should be able to build dynamic
> libraries. BTW the "-fPIC" flag is not necessary on Mac, it's on by default.

Thank you! That worked! Just to explain what I did.
 svn co http://svn.dsource.org/projects/tango/trunk
 cd trunk/
 ./build/script/bob.rb -vu  -d .

That created libtango.dylib, and linking with that library was successful.
R CMD SHLIB /usr/local/lib/libtango.dylib   test.o

and in R:
> dyn.load("test.so")
> .C("Dfunc")
got to D

Thanks!


More information about the Digitalmars-d mailing list