[Rd] could not open libRmath.so

Tib tibshirani at gmail.com
Thu Jun 2 23:52:44 CEST 2005

I got a very tricky problem when I tried to compile a C++ program
which links to libRmath.so. The program itself had no problem, I can
compile and run in my own linux machine where I compiled libRmath.so
file and copied it to system directory (/usr/local/lib).

Now I want to compile my program at another linux box where I don't
have root privilege. That machine only has binary version of R, so I
built R from source in my own directory:
And I also compiled libRmath.so, copied it to /Users/tib/R/bin/

Now I use this to compile my program
g++ engine.cpp -o engine -lm -lRmath -I/Users/tib/R/lib/R/include/
it did not report any error, however as I executed the program
it reported:
./engine: error while loading shared libraries: libRmath.so: cannot
open shared object file: No such file or directory

Why did it report this error but compile through? Is this because the
binary R installed system wide affected the compilation? Or did I miss



I am Tib, not Rob.

More information about the R-devel mailing list