-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
installation documentation for macOS is incorrect #154
Comments
So ... why are you opening a duplicate issue rather than just commenting on the existing one? What does this add? What could I possibly do -- I cannot influence the |
If there is documentation to fix, could you kindly provide a URL or file link? I can surely take a look but a global "docs borked" is not exactly operational. As I said a few over the nearly two decades of this project, I don't have a macOS box so ... |
The point is that this isn't brew problem, as far as I can tell. QuantLib is installed with the correct flags as per the requirements of RQuantLib. Step 4 on the wiki for macOS should be: The current version of quantlib in Homebrew is 1.21 so step 6 is unnecessary (plus it seems those 'inline's are already there. Finally, in step 8 I get a whole bunch of deprecated warnings and build fails with:
|
Ok, now I know to look at the wiki, thanks. That was missing. The 'flat namespace' rings a bell, I think we have seen this with other packages too and I think it has something to do with your local macOS setup. I am sorry that I don't have a pointer as I am not a macOS user myself. Here is one from RcppArmadillo being apparently related to mixing gcc/g++ and clang. Here is one from Rcpp suggesting that if you install something from source that uses Rcpp you may also need Rcpp from source. In sum this suggests that your mixing with precompiled units from Could you compile QuantLib, Rcpp, RQuantLib from source to check this? |
Just realised that was using gcc v8 from Homebrew. Trying again with the default clang in macOS also has loads of deprecation warnings e.g.
I can have a look at compiling from source, but not for a few days. I'll keep you posted. |
Oh, that is better! Deprecation warnings are a pest, especially as CRAN has a formal (!!) policy to not allow us to suppress them (!!) in packages which is annoying (but makes sense for debugging). The best fix we have is to add them in our personal
Adjust Really appreciate the help on macOS. The 'Venn diagram intersection' of R && QuantLib && macOS && chops_to_build_from_source is pretty sparse. |
Damn, I forgot the rest of it., sorry. The compilation still failed.
|
Those things tends to go away with Rcpp built from source, along with the Rcpp-using package from source. "Our problem here" is that the same fix may be needed for QuantLib itself which is Yuge and takes a jolly moment to build. |
I couldn't let this go ;) Have compiled all three (QuantLib, Rcpp and RQuantlib) from source. No change. Expanding errors to include last compile step:
There are the commands used:
As per their instructions I ran the example which worked fine. Rcpp RQuantLib This is on an intel Mac, macOS (10.15.7 Catalina) and R 4.0.3. Let me know if there's anything else I can try. |
That is the spirit. I do not have good pointers (as I don't use macOS) but a) we had [when the macOS maintainer at CRAN had time to build QuantLib] working macOS packages so there is no foundational issue and b) I have of course in near-20 years of mucking with QuantLib and RQuantLib (and having Rcpp "fall out" as a happy side effect) seen segfaults like that---invariably they were of my making. Maybe another piece in the middle is still bad / a path wrong pointing to the wrong build / ... I would now try to triangulate. With QuantLib sources you have examples. Do those build and run? (I guess). Can R call code via Rcpp? Do the old |
Crap. Forgot about Boost. There you go. Likely culprit :-/ |
Recompiled Boost from source with same outcome :( The QuantLib examples run fine as do Rcpp calls. Can you elaborate further on the "Write a five liner with a QuantLib header and "manually" link." bit please? I'm not much of a C++ coder and even less one via Rcpp. |
Dang. That makes it weirder. Sorry, for the five liner (or, with the verbosity of QuantLib, fifty) I meant to add a header file, instantiate object and just print 'hello, world, still here' to again close the gap a little more the working pieces and the fuller (but not working package). |
Created this
And then ran it as:
Got a whole bunch of warnings (just like when compiling RQuantLib), but it printed out 'Hello, quantlib world|" just fine. Any other ideas? p.s. I also did this in a new user account on the same mac with no difference. |
I assume you are aware of So with that: which section of which document are you looking at that makes you think this was working? The overall in the wiki covers, if I recall correctly, only basic install. More could be done, but someone has to lay down the ground work first. Maybe you can? |
Your assumptions regarding Rcpp are incorrect. I have no experience of it at all so am just going on what I find on stackoverflow ;) So if there's any more detailed pointers or links I can follow, I'd be happy o try.>
What do you mean by "this"? The Rcpp call, QuantLib, or something else? From what I can see is that by including 'ql/quantlib.hpp' in the basic code, the header is being compiled into the final executable (hence all the deprecation warnings), but of course nothing is being used. |
E.g. your Subject: line here "installation documentation ... incorrect" but I am not all-knowing all-seeing and do not know what document you may have read. I assume you understand the technical implication of 'header included' possibly leading to 'object instantiated' requiring linking. C++ can be setup differently via header-only libraries and there even once was a trial for (R)QuantLib which I wrapped here -- while not current with current QuantLib it is (far) better than nuttin' at all. |
I had similar issue - installing |
Thanks for the edit. I don't have a macOS machine so we rely on community-curation. |
For those who are using Macbook M1 This is what I did: I have installed quantlib using brew: Change this line "/usr/local/include to /opt/homebrew/include (or create a symbolic link) it worked for me. |
I'm having a hard time getting this to work. I'm trying to build from source because I need the intraday enabled. The machine it's on is running Catalina. I installed
EDIT: After waiting a while, finally it coughed up a bunch of blocks resembling:
before finally concluding with
I looked for
but I have no .R folder in my home directory, visible or invisible. |
I am sorry to hear you are have troubling on macOS. As I do not use the platform, I will not be able to help you much. That said, r-universe appears to have to trouble with either x86_64 or amd64 macOS. Which makes sense as this is a pretty vanilla (if large, on the QuantLib side) package. The screenshot is from https://eddelbuettel.r-universe.dev/RQuantLib, which itself hangs off 'my' r-universe page at https://eddelbuettel.r-universe.dev/RQuantLib. Similarly, CRAN has no issues (apart from outdated Boost warnings not yet taken care of on macOS). CRAN also tells us what they use: So if in doubt, make sure you have compilers / OS versions as recent as theirs. |
Whoops. But that at least alerted me to the fact that I had committed and pushed to github following the most recent release 0.4.21. Done now. So r-universe will 'soon' (usually about an hour) also show 0.4.21. |
Thanks for the speedy reply. You've got me at a bit of a loss here as this is all a little bit out of my wheelhouse... I first became acquainted with R, looked at it for the very first time ever, about 4 hours ago, so a lot of this is still greek to me. When I woke up this morning I still thought I'd be doing all this in Excel, but that's a non-starter, so here I am. On the MacOS side, the compilers/hardware/os versions on that screenshot, if that's the minimum requirement, completely preclude repurposing my still-good old hardware for this... I'm already running the latest XCode this OS can run (with Apple Clang 12.) However: I had no problem installing a precompiled binary with I'll give it an hour and then poke around those links you give and see if I can figure anything out. Basically, I think what's happening here is probably a knowledge gap on my end, nobody's responsibility but my own, but if anyone can spot it and let me know how to get where I need to be with this, I'd appreciate it. I've got to do intraday calcs. My future vast personal fortune depends on it. |
You are approaching it the right way, I think. It all decomposes. Start at your R prompt with
then you should be in business. Nobody said it was simple but it should be feasible. If it is all too much you could also try developing on Linux by virtue of a Docker container. |
I don't use Homebrew so no worries there. I installed boost with Macports, which puts things in the standard expected locations (I checked.) Not entirely sure how to proceed with trying to recompile; I don't do a lot of work in compiled languages so it's all a bit foreign to me. I know how to download a .zip from github, Parenthetically, as it happens, after decades of being a Mac guy, I've been very tempted in the last few months to switch to Linux for primary use anyway. My needs are getting more technical over time, while MacOS is turning more and more into a toy. Plus I already run 2 Debian VMs full-time for other purposes, and, surprisingly, more and more, they're proving to be easier to deal with than the latest few versions of MacOS. Thanks for your tips! |
Well Debian maintainer of QuantLib here so I can help. Ubuntu is also good (happens to be what I use on desktop/server and laptop) so I happen to also build QuantLib there in my PPA. If you want to try that, your life is likely going to be easier. [ I have nothing against macOS. I just don't know it, and I get more interactions with users when "stuff ain't working" which may bias me a little. The hardware is nice, I once 'inherited' two by now too-old-and-weak macbooks from my kids. ] |
I recently had a chance to revisit (re-install) RQuantLib on macOS and update the wiki. Many of the instructions were outdated and misleading (e.g., you should not install quantlib from |
Thanks @matthewgson -- maybe next time when you edit ping me and we can review. (While I am repo owner I do not get updates on wiki changes...) |
I realise this has already been raised on #141 but the issue still stands that the documentation is incorrect for macOS.
Also as it is RQuantLib does not work on macOS using the default instructions. This is what I get when trying load it in R 4.0.3 macOS Catalina.
As previously stated the Homebrew install has the '--enable-intraday' argument enabled.
I'll also open a ticket with Homebrew and see where the problem stems from as it appears it all should work.
The text was updated successfully, but these errors were encountered: