Hi Dirk,<br><br>Just so that I understand.  I copied the code in the RcppArmadillo section on your website and pasted and saved it.  Are you saying I should change #include &lt;RcppArmadillo&gt; to #include &lt;Rcpp&gt; and #include &lt;armadillo&gt; ?<br>
<br>best,<br>abhisek<br><br><div class="gmail_quote">On Fri, Mar 26, 2010 at 1:40 PM, Dirk Eddelbuettel <span dir="ltr">&lt;<a href="mailto:edd@debian.org">edd@debian.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Hi Abhisek,<br>
<div class="im"><br>
On 26 March 2010 at 12:28, Abhisek wrote:<br>
| I downloaded the stuff just last friday so it should be the latest version<br>
| of Rcpp as well as Armadillo.  I used install.packages() for Rcpp and<br>
| RcppArmadillo.  Armadillo is 0.9.4.  Im using xubuntu karmic koala.<br>
<br>
</div>Ok, that is all good.  And if RcppArmadillo installed you have proper<br>
libraries, Armadillo included.<br>
<br>
I think part of your problem is a misunderstanding of an issue we may not<br>
have made particularly clear:  You can&#39;t just look at FastLM() and think<br>
your code will run like it.  RcppArmadillo __does not export its classes__.<br>
It is an implementation reference -- it gives you guidance as to how to<br>
implement C++ packages of your own against other libraries.<br>
<br>
If you &quot;just&quot; want to use Armadillo and have Rcpp help you, look at the<br>
installed example &#39;FastLM&#39; in the Rcpp package.  In other words ignore<br>
RcppArmadillo for now.<br>
<br>
The example (in 0.7.10) uses an idiom we no longer like and I am about to<br>
change that for an upcoming 0.7.11 release, but it should works as is and<br>
just use inline -- so no messing with makefile etc.<br>
<br>
Try that and see how it goes and keep us posted.<br>
<br>
Cheers, Dirk<br>
<div><div></div><div class="h5"><br>
<br>
| i also had some problem using Armadillo which I posted on the Armadillo<br>
| discussion board.  Conrad got back to me.  Here is the discussion:<br>
| <a href="https://sourceforge.net/apps/phpbb/arma/viewtopic.php?f=1&amp;t=4" target="_blank">https://sourceforge.net/apps/phpbb/arma/viewtopic.php?f=1&amp;t=4</a><br>
|<br>
| so it may be that armadillo is the problem but im really not sure.<br>
|<br>
| Many thanks<br>
| Abhisek<br>
|<br>
| On Fri, Mar 26, 2010 at 12:17 PM, Dirk Eddelbuettel &lt;<a href="mailto:edd@debian.org">edd@debian.org</a>&gt; wrote:<br>
|<br>
| &gt;<br>
| &gt; (resending, this time to list I omitted last time, sorry. --Dirk)<br>
| &gt;<br>
| &gt; On 26 March 2010 at 11:10, Abhisek wrote:<br>
| &gt; | Hi,<br>
| &gt; |<br>
| &gt; | Ive been trying to make RcppArmadillo work using the example file<br>
| &gt; (fastLM).<br>
| &gt; | I copied and pasted the code and saved it as RcppArmadilloEg.cpp (not to<br>
| &gt; use<br>
| &gt; | fastLM but to figure out how to work RcppArmadillo).  Then i tried using<br>
| &gt; the<br>
| &gt; | command R CMD SHLIB RcppArmadilloEg.cpp but an error came up saying that<br>
| &gt; | RcppArmadillo.h not found.<br>
| &gt; |<br>
| &gt; | So i tried doing a symbolic link from /usr/local/include to the directory<br>
| &gt; | where RcppArmadillo.h and RcppArmadilloDefines.h is stored.  I also did a<br>
| &gt; | symbolic link analogously for RcppArmadillo.so.  When i ran R CMD SHLIB<br>
| &gt; | again I got the following error:<br>
| &gt; |<br>
| &gt; | abhisek@shieks:~/Desktop/Personal/Test$ R CMD SHLIB RcppArmadilloEg.cpp<br>
| &gt; | g++ -I/usr/share/R/include<br>
| &gt; | -I/home/abhisek/R/i486-pc-linux-gnu-library/2.10/Rcpp/lib -fpic  -g -O2<br>
| &gt; -c<br>
| &gt; | RcppArmadilloEg.cpp -o RcppArmadilloEg.o<br>
| &gt;<br>
| &gt; So far so good:  one -I for R as usual, one for Rcpp.<br>
| &gt;<br>
| &gt; | In file included from<br>
| &gt; | /home/abhisek/R/i486-pc-linux-gnu-library/2.10/Rcpp/lib/RcppCommon.h:215,<br>
| &gt; |                  from<br>
| &gt; | /home/abhisek/R/i486-pc-linux-gnu-library/2.10/Rcpp/lib/Rcpp.h:28,<br>
| &gt; |                  from RcppArmadilloEg.cpp:1:<br>
| &gt; |<br>
| &gt; /home/abhisek/R/i486-pc-linux-gnu-library/2.10/Rcpp/lib/Rcpp/internal/wrap.h:<br>
| &gt; | In function ‘SEXPREC*<br>
| &gt; Rcpp::internal::wrap_dispatch_unknown_iterable(const<br>
| &gt; | T&amp;, Rcpp::traits::false_type) [with T = arma::Col&lt;double&gt;]’:<br>
| &gt; |<br>
| &gt; /home/abhisek/R/i486-pc-linux-gnu-library/2.10/Rcpp/lib/Rcpp/internal/wrap.h:491:<br>
| &gt; | instantiated from ‘SEXPREC* Rcpp::internal::wrap_dispatch_unknown(const<br>
| &gt; T&amp;,<br>
| &gt; | Rcpp::traits::false_type) [with T = arma::Col&lt;double&gt;]’<br>
| &gt; |<br>
| &gt; /home/abhisek/R/i486-pc-linux-gnu-library/2.10/Rcpp/lib/Rcpp/internal/wrap.h:509:<br>
| &gt; | instantiated from ‘SEXPREC*<br>
| &gt; | Rcpp::internal::wrap_dispatch_unknown_importable(const T&amp;,<br>
| &gt; | Rcpp::traits::false_type) [with T = arma::Col&lt;double&gt;]’<br>
| &gt; |<br>
| &gt; /home/abhisek/R/i486-pc-linux-gnu-library/2.10/Rcpp/lib/Rcpp/internal/wrap.h:526:<br>
| &gt; | instantiated from ‘SEXPREC* Rcpp::internal::wrap_dispatch(const T&amp;,<br>
| &gt; | Rcpp::traits::wrap_type_unknown_tag) [with T = arma::Col&lt;double&gt;]’<br>
| &gt; |<br>
| &gt; /home/abhisek/R/i486-pc-linux-gnu-library/2.10/Rcpp/lib/Rcpp/internal/wrap.h:541:<br>
| &gt; | instantiated from ‘SEXPREC* Rcpp::wrap(const T&amp;) [with T =<br>
| &gt; | arma::Col&lt;double&gt;]’<br>
| &gt; | /home/abhisek/R/i486-pc-linux-gnu-library/2.10/Rcpp/lib/Rcpp/Named.h:54:<br>
| &gt; | instantiated from ‘Rcpp::Named::Named(const std::string&amp;, const T&amp;) [with<br>
| &gt; T<br>
| &gt; | = arma::colvec]’<br>
| &gt; | RcppArmadilloEg.cpp:19:   instantiated from here<br>
| &gt; |<br>
| &gt; /home/abhisek/R/i486-pc-linux-gnu-library/2.10/Rcpp/lib/Rcpp/internal/wrap.h:394:<br>
| &gt; | error: cannot convert ‘const arma::Col&lt;double&gt;’ to ‘SEXPREC*’ in<br>
| &gt; | initialization<br>
| &gt; | make: *** [RcppArmadilloEg.o] Error 1<br>
| &gt; |<br>
| &gt; |<br>
| &gt; | could someone provide some advice?<br>
| &gt;<br>
| &gt; Which Rcpp version do you have installed?<br>
| &gt;<br>
| &gt; Which Armadillo version do you have installed?<br>
| &gt;<br>
| &gt; I have not tried the free-floating direct compile you try here.  Maybe the<br>
| &gt; defines for RcppArmadillo that we use are missing here -- hard to say.<br>
| &gt;<br>
| &gt; Could you try to create your own little package but copying the<br>
| &gt; RcppArmadillo<br>
| &gt; files, changes DESCRIPTION to what you do and changes the FastLM code in<br>
| &gt; C++<br>
| &gt; and R?<br>
| &gt;<br>
| &gt; Dirk<br>
| &gt;<br>
| &gt; --<br>
| &gt;  Registration is open for the 2nd International conference R / Finance 2010<br>
| &gt;  See <a href="http://www.RinFinance.com" target="_blank">http://www.RinFinance.com</a> for details, and see you in Chicago in<br>
| &gt; April!<br>
| &gt;<br>
<br>
</div></div>--<br>
<div><div></div><div class="h5">  Registration is open for the 2nd International conference R / Finance 2010<br>
  See <a href="http://www.RinFinance.com" target="_blank">http://www.RinFinance.com</a> for details, and see you in Chicago in April!<br>
</div></div></blockquote></div><br>