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

rmarkdown knit pdf failed due to Rcpp #751

Closed
zhiruiwang opened this issue Sep 18, 2017 · 6 comments
Closed

rmarkdown knit pdf failed due to Rcpp #751

zhiruiwang opened this issue Sep 18, 2017 · 6 comments

Comments

@zhiruiwang
Copy link

When I knit a pdf using rmarkdown, it always return such error:

Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/Library/Frameworks/R.framework/Versions/3.4.1-MRO/Resources/library/Rcpp/libs/Rcpp.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.4.1-MRO/Resources/library/Rcpp/libs/Rcpp.so, 6): Library not loaded: /usr/local/clang4/lib/libc++abi.dylib
  Referenced from: /Library/Frameworks/R.framework/Resources/lib/libc++.1.dylib
  Reason: image not found
Calls: :: ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted

sessionInfo():

R version 3.4.1 (2017-06-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets 
[6] methods   base     

loaded via a namespace (and not attached):
 [1] compiler_3.4.1   backports_1.1.0  magrittr_1.5    
 [4] RevoUtils_10.0.5 rprojroot_1.2    htmltools_0.3.6 
 [7] tools_3.4.1      yaml_2.1.14      Rcpp_0.12.12    
[10] stringi_1.1.5    rmarkdown_1.6    knitr_1.17      
[13] stringr_1.2.0    digest_0.6.12    evaluate_0.10.1
@coatless
Copy link
Contributor

Not an Rcpp problem. Toolchain issue. Does:

Rcpp::evalCpp("1+1")

give the correct answer?

@eddelbuettel
Copy link
Member

That's peculiar because @coatless and I have been working A LOT on rmarkdown use lately. And he uses macOS. And he just beat me...

@eddelbuettel
Copy link
Member

eddelbuettel commented Sep 18, 2017

Library not loaded: /usr/local/clang4/lib/libc++abi.dylib

You probably just have a hash of pre-built and locally-built components. "If it breaks, rebuild."

@zhiruiwang
Copy link
Author

It seems like a problem of clang. How could I fix it?

> Rcpp::evalCpp('1+1')
/bin/sh: /usr/local/clang4/bin/clang++: No such file or directory
make: *** [file3e76680fbd3c.o] Error 127
/usr/local/clang4/bin/clang++  -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I"/Library/Frameworks/R.framework/Versions/3.4.1-MRO/Resources/library/Rcpp/include" -I"/private/var/folders/1v/wz_prgn52n91b5x1byjxwnl00000gn/T/RtmpXqL3rj/sourceCpp-x86_64-apple-darwin15.6.0-0.12.12" -DU_STATIC_IMPLEMENTATION -Wall -mtune=core2 -g -O2 -I/opt/X11/include   -fPIC  -DU_STATIC_IMPLEMENTATION -Wall -mtune=core2 -g -O2 -I/opt/X11/include  -c file3e76680fbd3c.cpp -o file3e76680fbd3c.o
Error in sourceCpp(code = code, env = env, rebuild = rebuild, cacheDir = cacheDir,  : 
  Error 1 occurred building shared library.

@coatless
Copy link
Contributor

You can get the necessary compiler here:

https://github.com/coatless/r-macos-clang

@eddelbuettel please close the ticket.

@zhiruiwang
Copy link
Author

@coatless it works. Thank you!

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

No branches or pull requests

3 participants