RQuantlib和Mac OS X 10.8.2 [英] RQuantlib and Mac OS X 10.8.2

查看:121
本文介绍了RQuantlib和Mac OS X 10.8.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Mac OS X,R和C ++的新手.听起来不错,不是吗?

I'm a total newbie in Mac OS X, R and C++. Sound like a good mix, doesn't it?

我需要使用RQuantLib,因为我想在Mac OS X驱动的环境中使用R内QuantLib包中的某些定价功能.

I have the need to use RQuantLib, because I want to use some pricing functions part of the QuantLib package inside R, all on a Mac OS X-powered environment.

我已经正确安装了QuantLib.我已经问过官方的QuantLib邮件列表,并且我们一起似乎得出的结论是,我遇到的问题与我的QuantLib安装无关,这看起来不错并且配置正确.

I've correctly installed QuantLib. I've already asked to the official QuantLib mailing list, and together we seem to have reached the conclusion that the problems I'm encountering are not related to my QuantLib installation, which seems ok and correctly configured.

因此,我转向R尝试解决问题.每当我尝试从R内部运行ZeroCouponBond,复制并粘贴官方文档提供的第一个示例时,都会出现以下错误:

So, I turned to R to try and solve the problem. Whenever I try to run ZeroCouponBond from within R, copying and pasting the first example provided with the official documentation, I get the following error:

"Error in DiscountCurve.default(discountCurve.param, list(flat = 0.05)) : 
cannot find function errorOccured"

现在,我将排除所有与语法相关的问题,因为我要复制官方帮助中存在的相同示例.

Now, I would rule any syntax.related problem out, since I'm copying the very same example present in the official help.

我不知道我做错了什么,但我知道我需要不惜一切代价寻找解决方案.我已经安装了Rcpp,配置看起来确实不错.仅一个问题我无法找到答案:据我所知,RQuantLib基本上是QuantLib和R之间的链接.如果是正确的话,我如何告诉RQuantLib在哪里可以找到libQuantLib.a,即在安装QuantLib本身时执行"make&& sudo make install"命令生成的编译库?

I don't know what I did wrong, but I know I need to find a solution at all costs. I've installed Rcpp, and the configuration seems really ok. Just one question I was not able to find an answert to: in my understanding, RQuantLib basically acts as a link between QuantLib and R. If that's correct, how can I tell RQuantLib where to look to find libQuantLib.a, that is, the compiled library resulting from the "make && sudo make install" commands performed while installing QuantLib itself?

推荐答案

对,所以,我终于设法使其正常工作.

Right, so, I've finally managed to get it to work.

首先,我想说的是,如果提供了完整的分步安装过程,事情将会变得容易得多.我承认自己是个新手,但我认为其他初次接触R的人可能会遇到类似于我必须克服的困难.

First of all, I would like to say that things would have been much easier if a thorough, step-by-step installation procedure had been provided. I acknowledge I'm a total newbie, but I think other people approaching to R for the first time might encounter difficulties similar to those I had to overcome.

无论如何,这就是我所做的:

Anyway, this is what I did:

  • 我已经为 source 软件包. rel ="nofollow"> Rcpp 和 RQuantLib 来自cran.r-project.org
  • 我已经编译了它们,并从R环境中安装了它们.这是我犯错的地方.确实,我试图通过从终端调用configure安装脚本来编译它们.但是,正如Dirk所说,config脚本查找QuantLib的quantlib-config脚本,而我不知道正确的语法来告诉configure脚本QuantLib的正确路径.通过正确地定位并加载所有依赖项,从R中执行该过程(只需安装软件包)就可以解决所有问题.
  • I've downloaded the .tar.gz source packages for both Rcpp and RQuantLib from cran.r-project.org
  • I've compiled them installing them from within the R environment. This is where I was making a mistake. Indeed, I was trying to compile them by invoking the configure installation script from the terminal; however, as Dirk said, the config script looks for QuantLib's quantlib-config script, and I didn't know the correct syntax to tell the configure script the correct path to QuantLib. Executing the procedure from R (by just installing the package) sorts out any problem, as all the dependencies are correctly located and loaded

所以,它就差不多了:就像安装二进制版本一样,只需安装.tar.gz source 软件包,一切就可以正常进行.

So, that's pretty much it: just install the .tar.gz source package as you would do with the binary version, and everything should work ok.

当然,我仍然很想了解:

Of course, I'm still curious to understand:

  • 如果可以从终端编译Rcpp和RQuantLib;和
  • 为什么Mac OS X的二进制版本在我的系统上不起作用,即:为什么我必须从源代码开始进行编译?

非常感谢愿意回答我(可能是天真又愚蠢)问题的任何人.我渴望了解更多!

Thank you so much to anyone willing to answer my (probably naive and silly) questions. I'm eager to understand a bit more!

谢谢!

这篇关于RQuantlib和Mac OS X 10.8.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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