在Linux上安装RQuantLib [英] Installing RQuantLib on Linux

查看:202
本文介绍了在Linux上安装RQuantLib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们一直在尝试在Redhat Linux机器上安装RQuantLib.经过一个月(令人尴尬的长时间!)的反复试验,我们成功地编译了最新版本的boost和quantlib.我根本不是Linux专家,因此我在运行install.packages("RQuantLib")时调试编译标志时遇到了一些麻烦. Rcpp已安装并正常运行.

We have been trying to install RQuantLib on a redhat linux machine. After a month (embarassingly long time!) of trial and error, we have succesfully compiled the latest version of boost and also quantlib. I am not a linux expert at all, so I am having a little trouble debugging the compile flags when I run install.packages("RQuantLib"). Rcpp is installed and working perfectly as well.

以下错误消息详细说明了该问题.我很困惑,因为我认为它想要的文件(libQuantLib.so.0)存在于/usr/local/lib中.抱歉,这很可能是一个愚蠢的问题,但是我认为我们非常接近可以在Linux上的R中访问Quantlib.

The error message below details the issue. I am confused because the file I think it should want (libQuantLib.so.0) exists in /usr/local/lib. Sorry that this is most likely a stupid question, but I think we are very close to having access to quantlib in R on linux.

错误消息如下:

g++ -I/apps/R/R-3.0.0/include -DNDEBUG  -I/usr/local/include -I"/apps/R/R-3.0.0/library/Rcpp/include"  -g -O2  -I/usr/local/include -I/usr/loca
l/include/boost  -I. -fpic  -g -O2  -c zero.cpp -o zero.o

g++ -shared -L/usr/local/lib64 -o RQuantLib.so asian.o barrier_binary.o bermudan.o bonds.o calendars.o curves.o daycounter.o discount.o hullwhi
te.o implieds.o utils.o vanilla.o zero.o -L/apps/R/R-3.0.0/library/Rcpp/lib -lRcpp -Wl,-rpath,/apps/R/R-3.0.0/library/Rcpp/lib -L/usr/local/lib
-L/usr/local/lib -lQuantLib

installing to /apps/R/R-3.0.0/library/RQuantLib/libs
** R
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded

Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/apps/R/R-3.0.0/library/RQuantLib/libs/RQuantLib.so':
  libQuantLib.so.0: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed

推荐答案

可能只是动态加载程序尚未意识到您已添加QuantLib. 尝试添加行

It might just be that the dynamic loader hasn't realized yet that you've added QuantLib. Try adding the line

/usr/local/lib

/etc/ld.so.conf(如果尚未存在),然后运行

to /etc/ld.so.conf (if it's not already there) and then run

sudo ldconfig

在系统上,如果您想了解自己在做什么,应该同时有ld.soldconfig的手册页,这总是一个好主意.切勿执行互联网上陌生人给出的命令,尤其是在sudo模式下:)

On your system there should be man pages for both ld.so and ldconfig if you want to understand what you're doing, which is always a good proposition. Never execute commands given by strangers on the internet, especially in sudo mode :)

完成上述操作后,您应该可以加载libQuantLib.

After you do the above, you should be able to load libQuantLib.

这篇关于在Linux上安装RQuantLib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆