c*******1 发帖数: 342 | 1 Does anyone have an idea how to do it?
I know how to just Call C++ in R , but don't know what to do with gsl
Thanks a lot |
D******n 发帖数: 2836 | 2 u should go to C++ board to ask...
I had the similar problem, when i move my excutable to another machine, it d
oesnt work. I guess there is a way to link gsl to ur executable statically(p
ermanently) dont know how to express.
【在 c*******1 的大作中提到】 : Does anyone have an idea how to do it? : I know how to just Call C++ in R , but don't know what to do with gsl : Thanks a lot
|
c*******1 发帖数: 342 | 3 but you gsl working in R on your own machine? |
D******n 发帖数: 2836 | 4 i mean my c code, my c code calls gsl and after i compiled it , it worked, b
ut if i move the executable to another machine , it didnt work,
i just pointed out it is probably not the R problem, it is the library linki
ng problem
【在 c*******1 的大作中提到】 : but you gsl working in R on your own machine?
|
b*****n 发帖数: 685 | 5 这个很明显啊,换机子的话,一般寻址方式变了,要重新编译。
b
linki
【在 D******n 的大作中提到】 : i mean my c code, my c code calls gsl and after i compiled it , it worked, b : ut if i move the executable to another machine , it didnt work, : i just pointed out it is probably not the R problem, it is the library linki : ng problem
|
D******n 发帖数: 2836 | 6 所以应该有办法把库包进去。
【在 b*****n 的大作中提到】 : 这个很明显啊,换机子的话,一般寻址方式变了,要重新编译。 : : b : linki
|
b*****n 发帖数: 685 | 7 再编译一次,把库link进去不就完了。
【在 D******n 的大作中提到】 : 所以应该有办法把库包进去。
|
D******n 发帖数: 2836 | 8 麻烦,另外一台机子就是没内裤
【在 b*****n 的大作中提到】 : 再编译一次,把库link进去不就完了。
|
c*******1 发帖数: 342 | 9 我知道怎么弄了
$PKG_LIBS="-lgsl -lgslcblas -L/Dir_of_gsl_libraries";
然后再用 R CMD SHLIB yourcode.cpp |
b*****n 发帖数: 685 | 10 牛蛙,我还没用过GSL,以后试试,有问题还望不吝赐教啊。
【在 c*******1 的大作中提到】 : 我知道怎么弄了 : $PKG_LIBS="-lgsl -lgslcblas -L/Dir_of_gsl_libraries"; : 然后再用 R CMD SHLIB yourcode.cpp
|