Ahmadou, Thanks so much for the follow-up! As I don't use OS X, I am mostly a bystander on these usage questions.
On 27 April 2014 at 06:47, Ahmadou Dicko wrote: | | I am slowly switching to Rcpp (what a wonderful tool!).. The classic Rcpp | works fine.. but when I try to run a code with RccpArmadillo, I get the | following error.. | | | Indeed Rcpp is really awesome. | | I have some questions : | - Can we have access to your example (test2.cpp) ? | - Which version of clang do you use ? | | And finally what is the output of the following code : | | library(Rcpp) | library(RcppArmadillo) | | cppFunction(code = | 'arma::mat armatrans(arma::mat A) { | return arma::trans(A); | }', depends = "RcppArmadillo") | | armatrans(matrix(1:6, ncol = 3)) | ## [,1] [,2] | ## [1,] 1 2 | ## [2,] 3 4 | ## [3,] 5 6 | | | Now if this code doesn't work you also check if you have a working fortran | compiler (e.g http://r.research.att.com/libs/gfortran-4.8.2-darwin13.tar.bz2), | you will have more info at http://cran.r-project.org/doc/manuals/R-admin.html# | Mavericks All excellent points and straigth to the core of the issue. There is no fundamental problem but one needs to get one's ducks into a neat row. [1] | You can finally try to search the R-sig-mac archives too, you will probably | find some intersting threads. And even then it seems confusing. I had an (unrelated, different package, simply using Rcpp too) report on RQuantLib not loading and pointed to Brian Ripley's recent post http://article.gmane.org/gmane.comp.lang.r.mac/8675 which also indicated that some 3rd party libraries need a rebuild for Mavericks before binary packages can work: Some of the Mavericks binary packages are missing for good reason. The C++ binary interface for the Xcode 5.x compilers in Mavericks is completely different, so external software has to be compiled with those compilers. This affects CRAN packages RQuantlib RProtoBuf RVowalWabbit rgdal rjags rzmq I maintain the first three, if someone wants to help ... maybe contact me off-list? [ And the third ships its own library code, so Brian Ripley would appear to be wrong here. ] | Hope it helps Sure did. Thanks again. Dirk [1] Which to me as a non-user of OS X still seems harder than on other OS's but whenever I say that I get yelled at by the most vocal OS X fanboys so I try not to mention it too often :) | | | | On Sun, Apr 27, 2014 at 3:47 AM, Modibo Sidibe <sidibe.mod...@gmail.com> wrote: | | Hi All, | | I am slowly switching to Rcpp (what a wonderful tool!).. The classic Rcpp | works fine.. but when I try to run a code with RccpArmadillo, I get the | following error.. | | clang++ -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/ | usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/ | Users/ms486/Library/R/3.1/library/Rcpp/include" -I"/Users/ms486/Library/R/ | 3.1/library/RcppArmadillo/include" -fPIC -Wall -mtune=core2 -g -O2 -c | test2.cpp -o test2.o clang++ -dynamiclib -Wl,-headerpad_max_install_names | -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/ | local/lib -o sourceCpp_40346.so test2.o -L/Library/Frameworks/R.framework/ | Resources/lib -lRlapack -L/Library/Frameworks/R.framework/Resources/lib | -lRblas -L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2 -lgfortran | -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R | -Wl,-framework -Wl,CoreFoundation | Error in sourceCpp("test2.cpp") : | Error 1 occurred building shared library. | ld: warning: directory not found for option '-L/usr/local/lib/gcc/ | x86_64-apple-darwin13.0.0/4.8.2' | ld: library not found for -lquadmath | clang: error: linker command failed with exit code 1 (use -v to see | invocation) | make: *** [sourceCpp_40346.so] Error 1 | | Here is the outcome of the Rsession | | R version 3.1.0 (2014-04-10) | Platform: x86_64-apple-darwin13.1.0 (64-bit) | | 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 methods base | | other attached packages: | [1] Rcpp_0.11.1 | | loaded via a namespace (and not attached): | [1] parallel_3.1.0 RcppArmadillo_0.4.200.0 tools_3.1.0 | | Thanks for your help! | _______________________________________________ | Rcpp-devel mailing list | Rcpp-devel@lists.r-forge.r-project.org | https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel | | | | | -- | Ahmadou H. DICKO | statistician economist (Ingénieur Statisticien Économiste) | PhD candidate in Climate change economics | Faculty of economics and managment - Cheikh Anta Diop University | West African Science Service Center on Climate Change and Adaptated Land Use | (WASCAL) | Center for Development Research (ZEF) - University of Bonn | email : ahmadou.di...@ucad.edu.sn | twitter : @dickoah | github : github/dickoa | tel : +221 33 827 55 16 | portable: +221 77 123 81 69 | | ---------------------------------------------------------------------- | _______________________________________________ | Rcpp-devel mailing list | Rcpp-devel@lists.r-forge.r-project.org | https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel -- Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com _______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel