<div class="gmail_quote"><br>Hello again Rcpp experts,  I asked my colleague to attempt an install on his personal Macbook just to be sure he wasn&#39;t experiencing security issues at work.  Anyway, he now receives an easier-to-comprehend error message.  Yet, it appears to not recognize the &#39;symmatl&#39; function of Armadillo (contained in the RcppArmadillo templates) and is treating it like an undeclared variable.  The package was build under Rcpp and RcppArmadillo on Windows where it installs without issues under both 32-bit and 64-bit builds.<div>

<br></div><div><p class="MsoNormal"><span><span style="font-size:13.5pt;color:black">bash-3.2$ R CMD install growcurves_0.1.tar.gz </span></span><span style="font-size:13.5pt;color:black"><br>
</span><span><span style="font-size:13.5pt;color:#DF4616">*
installing to library &#39;/Library/Frameworks/R.framework/Resources/library&#39;</span></span><span style="font-size:13.5pt;color:#DF4616"><br>
<span>* installing *source* package &#39;growcurves&#39; ...</span><br>
<span>** libs</span><br>
<span>*** arch - i386</span><br>
<span>g++ -arch i386
-I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include/i386 
-I/usr/local/include
-I&quot;/Library/Frameworks/R.framework/Resources/library/Rcpp/include&quot;
-I&quot;/Library/Frameworks/R.framework/Resources/library/RcppArmadillo/include&quot;
-I&quot;/Library/Frameworks/R.framework/Resources/library/ggplot2/include&quot;
-I&quot;/Library/Frameworks/R.framework/Resources/library/Formula/include&quot;  
-fPIC  -g -O2 -c DPre.cpp -o DPre.o</span><br>
<span>DPre.cpp: In function &#39;SEXPREC*
rmvncholclust(const arma::field&lt;arma::Mat&lt;double&gt; &gt;&amp;, const
arma::mat&amp;, const arma::field&lt;arma::Col&lt;double&gt; &gt;&amp;,
arma::colvec&amp;, double)&#39;:</span><br>
<span>DPre.cpp:643: error: &#39;symmatl&#39; was not declared in
this scope</span><br>
<span>make: *** [DPre.o] Error 1</span><br>
<span>ERROR: compilation failed for package &#39;growcurves&#39;</span><br>
<span>* removing
&#39;/Library/Frameworks/R.framework/Resources/library/growcurves&#39;</span></span><span style="font-size:10.5pt"></span></p></div><div><br><div><br></div><div>Below is the offending function, though it lacks context to be of much use.  I employ the following namespace declarations in DPre.cpp:</div>
<div>
<br></div><div><div>using namespace Rcpp;</div><div>using namespace arma;</div><div>using namespace std;</div></div><div><br></div><div><div>SEXP rmvncholclust(const field&lt;mat&gt;&amp; zwedge, const mat&amp; Pmat,</div>

<div>            const field&lt;colvec&gt;&amp; ytilwedge, colvec&amp; b, double taue)</div><div>    {</div><div>        BEGIN_RCPP</div><div>        int n = zwedge.n_rows; int p = zwedge(0,0).n_cols;</div><div>        mat ztz(p,p); ztz.zeros(); colvec zty(p); zty.zeros();</div>

<div>        mat phi(p,p), phiinv(p,p), U(p,p);</div><div>        colvec h(p);</div><div>        int i;</div><div>        for(i = 0; i &lt; n; i++)</div><div>        {</div><div>           ztz += trans(zwedge(i,0))*zwedge(i,0);</div>

<div>           zty += trans(zwedge(i,0))*ytilwedge(i,0);</div><div>        }</div><div>        phi = taue*ztz + Pmat; phiinv = inv( symmatl(phi) );</div><div>        h = taue*phiinv*zty;</div><div>        U = chol(phiinv);</div>

<div>        colvec noisevec = randn&lt;colvec&gt;(p);</div><div>        b = trans(U)*noisevec + h;</div><div>        END_RCPP</div><div><div></div><div class="h5"><div>    }</div><br><div class="gmail_quote">On Wed, Oct 12, 2011 at 5:59 PM, terrance savitsky <span dir="ltr">&lt;<a href="mailto:tds151@gmail.com" target="_blank">tds151@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Rcpp Experts,  I have built a package that employs Rcpp and RcppArmadillo on a Windows 7 x64.  The package builds on installs properly on both 32 and 64 bit Windows configurations.  As a prelude to ftp&#39;ing the package on C-RAN, I&#39;ve asked a colleague to build and install the package from a .tar file on his Mac under OS-X (not Lion).  He has installed Xcode, as well as a Fortran compiler.  Below are two snippets of error messages he receives when attempting to install the package (growcurves).<div>


<br></div><div><p class="MsoNormal"><span style="font-size:10.5pt;color:#DF4616">/bin/sh:
/Library/Frameworks/R.framework/Versions/2.13/Resources/library/Rcpp/lib/x86_64/libRcpp.a:
Permission denied</span><span style="font-size:10.5pt"></span></p>

<p class="MsoNormal"><span style="font-size:10.5pt;color:black"> </span></p>

<p class="MsoNormal"><span style="font-size:10.5pt;color:black">And later</span></p>

<p class="MsoNormal"><span style="font-size:10.5pt;color:black"> </span></p>

<p class="MsoNormal"><span style="font-size:10.5pt;color:#DF4616">** testing if
installed package can be loaded</span><span style="font-size:10.5pt"></span></p>

<p class="MsoNormal"><span style="font-size:10.5pt;color:#DF4616">Error in
dyn.load(file, DLLpath = DLLpath, ...) : </span><span style="font-size:10.5pt"></span></p>

<p class="MsoNormal"><span style="font-size:10.5pt;color:#DF4616">  unable to load
shared object
&#39;/Library/Frameworks/R.framework/Versions/2.13/Resources/library/growcurves/libs/i386/growcurves.so&#39;:</span><span style="font-size:10.5pt"></span></p>

<p class="MsoNormal"><span style="font-size:10.5pt;color:#DF4616"> 
dlopen(/Library/Frameworks/R.framework/Versions/2.13/Resources/library/growcurves/libs/i386/growcurves.so,
6): Symbol not found: __ZTIN4Rcpp12not_a_matrixE</span><span style="font-size:10.5pt"></span></p>

<p class="MsoNormal"><span style="font-size:10.5pt;color:#DF4616">  Referenced
from:
/Library/Frameworks/R.framework/Versions/2.13/Resources/library/growcurves/libs/i386/growcurves.so</span><span style="font-size:10.5pt"></span></p>

<p class="MsoNormal"><span style="font-size:10.5pt;color:#DF4616">  Expected in:
flat namespace</span><span style="font-size:10.5pt"></span></p>

<p class="MsoNormal"><span style="font-size:10.5pt;color:#DF4616"> in
/Library/Frameworks/R.framework/Versions/2.13/Resources/library/growcurves/libs/i386/growcurves.so</span><span style="font-size:10.5pt"></span></p><div><br></div><div>I was concerned there may be a problem in my Makevars file, but it does appear that the Rcpp library location is found.  I&#39;m sorry that I&#39;m not sufficiently knowledgeable to diagnose whether the error is on his (the user) end or mine (the package creator) and would appreciate any insight you may offer.</div>


<div><br></div><div>Below is a link to the .tar file:</div><div><br></div><div><a href="https://docs.google.com/leaf?id=0B0DIDcaf6yMwOWFjN2NlYzktZGRmOC00MTZjLTg5YzEtNGY3OTcwZmJmYjQ0&amp;hl=en_US" target="_blank">https://docs.google.com/leaf?id=0B0DIDcaf6yMwOWFjN2NlYzktZGRmOC00MTZjLTg5YzEtNGY3OTcwZmJmYjQ0&amp;hl=en_US</a></div>


<div><br></div><font color="#888888">-- <br>Thank you, Terrance Savitsky<br>
</font></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Thank you, Terrance Savitsky<br>
</div></div></div></div>
</div><br><br clear="all"><div><br></div>-- <br>Thank you, Terrance Savitsky<br>