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

Add missing quotes in requireNamespace call #5

Merged
merged 1 commit into from
Sep 23, 2015
Merged

Add missing quotes in requireNamespace call #5

merged 1 commit into from
Sep 23, 2015

Conversation

agrueneberg
Copy link
Contributor

The following happens if the Rcpp argument is TRUE in cfunction:

Loading required namespace: TRUE
Failed with error:  ‘there is no package called ‘TRUE’’

@eddelbuettel
Copy link
Owner

Ooops. Good catch. Thanks. And it probbaly want , quietly=TRUE as well.

Package probably needs a refresher anyway. [ But everybody should use Rcpp Attributes these days... ]

eddelbuettel added a commit that referenced this pull request Sep 23, 2015
Add missing quotes in requireNamespace call
@eddelbuettel eddelbuettel merged commit 56d0bf3 into eddelbuettel:master Sep 23, 2015
@agrueneberg
Copy link
Contributor Author

Thanks! I only used the package because I needed to link Boost's iostreams for an inline benchmark and couldn't figure out how to do it with cppFunction and the likes.

@agrueneberg agrueneberg deleted the patch-1 branch September 23, 2015 19:56
@eddelbuettel
Copy link
Owner

Does iostream require a library for linking? Some of these can be used with and without linking, eg Boost Date_time can be used without parsers and formatters, in which case headers-only is good enough. And then you can get by with a plugin .... but that is maybe a discussion to be had on rcpp-devel.

@agrueneberg
Copy link
Contributor Author

Yes, it looks like IOStreams is not header-only. I need it for parsing gzipped files without giving up on the convenience of using std::getline :P After some more tinkering I actually got it working with cppFunction: I forgot to set rebuild = TRUE after setting Sys.setenv("PKG_LIBS"="-lboost_iostreams"). Thanks for the pointer to rcpp-devel, will make sure to stop by!

@eddelbuettel
Copy link
Owner

Nice. You may be able to cheat as we get the compression library from R. See what I do in RcppCNpy to open compressed files. You could then go over the file pointer with std::getline, no?

@agrueneberg
Copy link
Contributor Author

Thanks, I didn't know that zlib is bundled with R. I was looking at RcppCNpy and was wondering how you manage that dependency, so now I have my answer. I found a small library called Gzstream that provides an ifstream that can be used in std::getline, but then again, I also need regular expressions, so maybe Boost isn't so bad. Unless I switch to C++11, I guess. Anyway, I really appreciate the help! Rcpp has been a pleasure so far!

@eddelbuettel
Copy link
Owner

Yes, for some smaller packages where I didn't care that I might loose some users on really old systems I just turned C++11 on -- it even kinda sorta somewhat works on Windows with g++ 4.6.3, and gets rid of some issues (ie the stupid long long warnings).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants