<div dir="ltr"><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">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..</blockquote><div><br></div><div>Indeed Rcpp is really awesome.<br></div><div><br>I have some questions : <br> - Can we have access to your example (test2.cpp) ?<br></div><div> - Which version of clang do you use ?<br>
<br></div><div>And finally what is the output of the following code :<br><br>library(Rcpp)<br>library(RcppArmadillo)<br><br>cppFunction(code =<br>            'arma::mat armatrans(arma::mat A) {<br>             return arma::trans(A);<br>
         }', depends = "RcppArmadillo")<br><br>armatrans(matrix(1:6, ncol = 3))<br>##      [,1] [,2]<br>## [1,]    1    2<br>## [2,]    3    4<br>## [3,]    5    6<br><br><br></div><div>Now if this code doesn't work you also check if you have a working fortran compiler (e.g <a href="http://r.research.att.com/libs/gfortran-4.8.2-darwin13.tar.bz2">http://r.research.att.com/libs/gfortran-4.8.2-darwin13.tar.bz2</a>), you will have more info at  <a href="http://cran.r-project.org/doc/manuals/R-admin.html#Mavericks">http://cran.r-project.org/doc/manuals/R-admin.html#Mavericks</a></div>
<div>You can finally try to search the <a href="https://stat.ethz.ch/mailman/listinfo/r-sig-mac">R-sig-mac</a> archives too, you will probably find some intersting threads. <br></div><div><br></div><div>Hope it helps<br></div>
<div><br><br></div><div> <br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Apr 27, 2014 at 3:47 AM, Modibo Sidibe <span dir="ltr"><<a href="mailto:sidibe.modibo@gmail.com" target="_blank">sidibe.modibo@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi All,<br>
<br>
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..<br>
<br>
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<br>

Error in sourceCpp("test2.cpp") :<br>
  Error 1 occurred building shared library.<br>
ld: warning: directory not found for option '-L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2'<br>
ld: library not found for -lquadmath<br>
clang: error: linker command failed with exit code 1 (use -v to see invocation)<br>
make: *** [sourceCpp_40346.so] Error 1<br>
<br>
Here is the outcome of the Rsession<br>
<br>
R version 3.1.0 (2014-04-10)<br>
Platform: x86_64-apple-darwin13.1.0 (64-bit)<br>
<br>
locale:<br>
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8<br>
<br>
attached base packages:<br>
[1] stats     graphics  grDevices utils     datasets  methods   base<br>
<br>
other attached packages:<br>
[1] Rcpp_0.11.1<br>
<br>
loaded via a namespace (and not attached):<br>
[1] parallel_3.1.0          RcppArmadillo_0.4.200.0 tools_3.1.0<br>
<br>
Thanks for your help!<br>
_______________________________________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Ahmadou H. DICKO<br>statistician economist (Ingénieur Statisticien Économiste)<br>PhD candidate in Climate change economics<br>Faculty of economics and managment - Cheikh Anta Diop University<br>
West African Science Service Center on Climate Change and Adaptated Land Use (WASCAL)<br>Center for Development Research (ZEF) - University of Bonn <br>email : <a href="mailto:ahmadou.dicko@ucad.edu.sn" target="_blank">ahmadou.dicko@ucad.edu.sn</a><br>
twitter : @dickoah<br>github : <a href="https://github.com/dickoa" target="_blank">github/dickoa</a><br>tel : +221 33 827 55 16<br>portable: +221 77 123 81 69<br></div>
</div>