<div dir="ltr"><div><br></div><div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br></span></div>
<div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Mar 19, 2014 at 6:04 PM, Dirk Eddelbuettel <span dir="ltr"><<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><br>
On 19 March 2014 at 17:32, amine gassem wrote:<br>
|<br>
| Context:<br>
|<br>
| I develop a new rcouchbase package client for couchbase. <br>
| I am following the example of rhiredis package.<br>
| Including libcouchbase headers using : #include <libcouchbase/couchbase.h>works<br>
| fine.  <br>
|<br>
| Problem:<br>
|<br>
| dyn.load failed to load symbol due to and undefined symbol: lcb_destroy. <br>
| I think this is a link problem because I don't tell Rcpp compiler where/how to<br>
| find libcouchebase libs.<br>
| Ho can I fix this?<br>
<br>
</div>There is no 'Rcpp compiler', only a C++ compiler called by 'R CMD ...'.<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
You tell it what to link with via src/Makevars (Linux, OS X, ...) or<br>
src/Makevars.win. See rhiredis for an (at this point) unconditional use of<br>
the -lhiredis library.<br>
<div class=""><br></div></blockquote><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="">
| What I have tried:<br>
|<br>
| Should I create <a href="http://configure.in" target="_blank">configure.in</a> and <a href="http://makvers.in" target="_blank">makvers.in</a> like in this RcppGSL package? <br>
<br>
</div>It use a call to a script gsl-config --- and I use that same trick in other<br>
packages.  It depends on what Couchbase supplies.<br></blockquote><div><br></div><div>libcouchbase provides a script ( I think a perl script) called <code style="font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;margin:0px;border:1px solid rgb(221,221,221);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;max-width:100%;display:inline-block;overflow:auto;vertical-align:middle;line-height:1.3;padding:0px;white-space:nowrap;color:rgb(51,51,51)"><a href="https://github.com/couchbase/libcouchbase ">cmake/configure</a></code></div>
<div>that I used it to build from sources. Do you think that this script is a good start?</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<br>
You could look at RPostgreSQL; or any other R packages using external<br>
libraries. There are lots.<br>
<div class=""><br>
| Reading the vignette I did not see how can I adopt it for my needs. <br>
| Also from this vignette  it looks like this changed with Rcpp release 0.11.0.<br>
| These files are now optional.<br>
| And also, The rhiredis package don't provide a configure for autoconf, and I<br>
| think  it works fine.<br>
<br>
</div>rhiredis is not a good example as it is not a CRAN -- so its build system is<br>
not as polished.  It may not have gotten used anywhere but on Linux (and<br>
build a hiredis library for CRAN / win-builder is on my TODO list).<br>
<br>
Hope this helps, and as is this more-or-less "just" a basic "how do I write a<br>
package" question, should we take this over to r-devel?<br></blockquote><div><br></div><div>As you like, you can take it over r-devel.</div><div>Thanks.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<span class=""><font color="#888888"><br>
Dirk<br>
</font></span><div class=""><div class="h5"><br>
--<br>
Dirk Eddelbuettel | <a href="mailto:edd@debian.org">edd@debian.org</a> | <a href="http://dirk.eddelbuettel.com" target="_blank">http://dirk.eddelbuettel.com</a><br>
</div></div></blockquote></div>Amine.</div></div>