Skip to content
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

Warnings when installing RQuantLib 0.4.4 from source on OSX #99

Closed
dwinsemius opened this Issue Dec 30, 2017 · 13 comments

Comments

Projects
None yet
2 participants
@dwinsemius
Copy link

dwinsemius commented Dec 30, 2017

I installed boost using homebrew and installed QuantLib 1.11 from source using instructions from their website. (Admittedly I probably should have used homebrew to this as well but didn't find those instructions until later.) Initially I failed to include the --enable-intraday argument to ./configure but after failing to load RQuantLib, I went back and added that and am waiting for the rebuild to complete. At any rate I got 12 warnings like this one during compilation of RQuantLib from the console. Seems likely that these warnings would also have occurred if compiled from Terminal session:

> install.packages("~/RQuantLib_0.4.4.tar.gz", repo=NULL, type="source", configure.args="--with-boost-include=/usr/local/include/ --with-boost-lib=/usr/local/lib/")

<snipped preliminaries>

config.status: creating src/Makevars
Completed configuration and ready to build.
** libs
/usr/local/clang4/bin/clang++ -I/Library/Frameworks/R.framework/Resources/include     -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I/usr/local/include  -mtune=core2 -O3  -I/usr/local/include -I/usr/local/include  -I/usr/local/include/ -I../inst/include -I. -fopenmp -DRCPP_NEW_DATE_DATETIME_VECTORS -fPIC  -mtune=core2 -O3    -c RcppExports.cpp -o RcppExports.o
/usr/local/clang4/bin/clang++ -I/Library/Frameworks/R.framework/Resources/include     -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I/usr/local/include  -mtune=core2 -O3  -I/usr/local/include -I/usr/local/include  -I/usr/local/include/ -I../inst/include -I. -fopenmp -DRCPP_NEW_DATE_DATETIME_VECTORS -fPIC  -mtune=core2 -O3    -c affine.cpp -o affine.o
/usr/local/clang4/bin/clang++ -I/Library/Frameworks/R.framework/Resources/include     -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I/usr/local/include  -mtune=core2 -O3  -I/usr/local/include -I/usr/local/include  -I/usr/local/include/ -I../inst/include -I. -fopenmp -DRCPP_NEW_DATE_DATETIME_VECTORS -fPIC  -mtune=core2 -O3    -c asian.cpp -o asian.o
asian.cpp:23:10: warning: non-portable path to file '<RQuantLib.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include <rquantlib.h>
         ^~~~~~~~~~~~~
         <RQuantLib.h>
1 warning generated.

Seems that a simple fix would be to rename that file "rquantlib.h"?

@eddelbuettel

This comment has been minimized.

Copy link
Owner

eddelbuettel commented Dec 30, 2017

Can you try to format it as code? Right now it is unreadable. See the Styling with Markdown is support link at bottom left of each edit box.

Edit: Did it for you by now.

@eddelbuettel

This comment has been minimized.

Copy link
Owner

eddelbuettel commented Dec 30, 2017

I think the fix would be for macOS to not be stupid and ignore case. RQuantLib.h is the filename, just as it is Rcpp.h. Surely there must be a flag you could use in your ~/.R/Makevars to turn the warning off?

@dwinsemius

This comment has been minimized.

Copy link
Author

dwinsemius commented Dec 31, 2017

@dwinsemius

This comment has been minimized.

Copy link
Author

dwinsemius commented Dec 31, 2017

@eddelbuettel

This comment has been minimized.

Copy link
Owner

eddelbuettel commented Dec 31, 2017

Sorry, I was out with the family for a bit. At the same, @joshuaulrich and I were exchanging Slack messages regarding RQuantLib while he is trying to build/update the Windows -- and he reminded me that I do in fact have rquantlib.h in one place and RQuantLib.h. That works fine on Linux, but may not be a great idea in the long run. I do recall that I tried once to set up use of RQuantLib via sourceCpp(), or possibly even its predecessor from inline. And there was something about having a header in the name of the package. I need to retrace the why and how.

In the meantime, you could try renaming one of the two headers differing only in case and see if it helps. I don't use or own a macOS machine so I am unaffected (as is seemingly @tleitch who happily contributed to RQuantLib using a macOS box...)

@eddelbuettel

This comment has been minimized.

Copy link
Owner

eddelbuettel commented Dec 31, 2017

Yes, a quick recursive grep (or, rathre, ag as I am a fan of the silversearcher-ag) reveals

  • RQuantLib.h included once from R/inline.h for the inline ops, and once from src/RcppExports.h and
    I think that latter use needs the same spelling as the package to declare types
  • rquantlib.h included a lot from src/*.cpp, and that part I can possibly alter.
@eddelbuettel

This comment has been minimized.

Copy link
Owner

eddelbuettel commented Dec 31, 2017

Also from src/rquantlib.h

#ifndef rquantlib_src_h
#define rquantlib_src_h

// Rcpp Attributes requires a file with package name in inst/include,
// in our case inst/include/RQuantLib.h -- but R does not want us to have
// another header file with the same name, differing only by case
//
// So we place the existing 'rquantlib.h' in src/ instead so that the
// issue of equal names (for everything but the case) no longer
// matters.  This provides us with a backwards compatible
// 'rquantlib.h' file, and its definitons are now in a file
// inst/include/rquantlib_internal.h which we source here.

#include "rquantlib_internal.h"

#endif

so the src/rquantlib.h is really an empty shell for backwards compatibility. If it bites, rename it (or even delete it) and quickly update the various #include <rquantlib.h> to #include <rquantlib_internal.h>

Can you let me know if that helps?

@dwinsemius

This comment has been minimized.

Copy link
Author

dwinsemius commented Dec 31, 2017

I wasn't actually having any difficulty. (The only difficulty I had was in getting rgl to load to run the demo, and I solved that.) They were only a warnings and I get those reasonably often when compiling from source. Because OSX seems to be a distinct minority of RQuantLib users and Apple keeps changing the rules, and C compilers, I thought it might be useful to let you know about warnings before some future revision of the rules turned into errors.

Thanks, David.

@eddelbuettel

This comment has been minimized.

Copy link
Owner

eddelbuettel commented Dec 31, 2017

Oh, you have no idea -- there were dozens of emails from folks stranded on macOS / OS X. We do have a somewhat current entry in the wiki that describes it.

Many folks just seem to get lost picking compilers and the like. That is not for everyone. But I can't rely on Simon to always build binaries, just how Uwe stopped providing them for Windows. I saw the mostly-wrong / mostly-ill-informed thread on r-help today but I didn't have sufficient spare time to get involved.

Anyway -- glad to hear you got sorted out.

@eddelbuettel

This comment has been minimized.

Copy link
Owner

eddelbuettel commented Dec 31, 2017

So I presume we can close this then if these were just line-noise warnings?

@dwinsemius

This comment has been minimized.

Copy link
Author

dwinsemius commented Dec 31, 2017

@eddelbuettel

This comment has been minimized.

Copy link
Owner

eddelbuettel commented Dec 31, 2017

You could probably help just by going over the wiki entry about installing and checking / updating / complementing the macOS portion. Or maybe branch off a new one depending on how big a chance is needed.

Otherwise, I'll close this. And I am working on moving rquantlib.h out of the way.

@eddelbuettel

This comment has been minimized.

Copy link
Owner

eddelbuettel commented Jan 1, 2018

For what it is worth, #100 now deprecated rquantlib.h further so the warning may no longer appear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.