-
-
Notifications
You must be signed in to change notification settings - Fork 208
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
sourceCpp() failed to compile if there is some space in R path #1234
Comments
Yes that line Line 132 in 8a44ae1
is a little suspicious. We could use edd@rob:~/git/rcpp(master)$ ag normalizePath
R/tools.R
43: path <- normalizePath(path) # #nocov start
R/Attributes.R
39: cacheDir <- normalizePath(cacheDir)
50: rWorkingDir <- normalizePath(dirname(file))
54: file <- normalizePath(file, winslash = "/")
238: cppSourcePath <- normalizePath(cppSourcePath)
239: buildDirectory <- normalizePath(buildDirectory)
245: cacheFiles <- normalizePath(cacheFiles)
416: pkgdir <- normalizePath(pkgdir, winslash = "/")
465: cppFiles <- normalizePath(cppFiles, winslash = "/")
src/attributes.cpp
902: Rcpp::Function normalizePath = baseEnv["normalizePath"];
942: include = normalizePath(include, "/");
984: Rcpp::Function normalizePath = baseEnv["normalizePath"];
985: sourceFile = Rcpp::as<std::string>(normalizePath(sourceFile, "/"));
edd@rob:~/git/rcpp(master)$ Can you also try the alternate form r <- normalizePath(file.path(R.home("bin"), "R"), winslash = "/") which should work (but I don't have a Windows system handy to test. |
Thank you for the prompt response!
Add ".exe" after "R" helps to get rid of the warning Hence, maybe we should check the current OS like this?
|
Yes either that or maybe simpler to just add |
Yes, it did, much simpler!
|
Splendid. I will get this taken care of. Thanks for the heads-up and the tests, much appreciated! |
When there is some space in R path, sourceCpp failed to compile:
It showed the error:
A possible solution is to add the command
r <- paste0('"', r, '"')
after the commandr <- paste(R.home("bin"), "R", sep = .Platform$file.sep)
.After done that, it compiles normally.
The text was updated successfully, but these errors were encountered: