[Rcpp-devel] Getting different build commands on Linux vs. Mac OS

Evan Biederstedt evan.biederstedt at gmail.com
Fri May 4 01:08:22 CEST 2018


Hi Dirk

I appreciate the help.

> You have the hardest possibe deployment option here it requires temporary
root to make a library a system library -- and R CMD ... does not have that.

I think I was able to sidestep this.

After installing bamdb without 'sudo make install'/root privileges, I was
able to hack the Makevars to install bambi on Linux

```
CXX_STD = CXX11

PKG_CPPFLAGS += -I../inst/include/
PKG_LIBS= -lhts -L/nfs/sw/htslib/htslib-1.7 -llmdb -L/usr/local/lib -lbamdb
-L/blah/blah/bamdb/build
```

Given the R package structure, I was thinking it would be possible to link
to the C library (not installed with 'sudo make install') via the `-L`
flag, maybe `-L/something/src/bamdb/build`

If this would work, the unsolved problem would be using the Makevars to
accomplish the `cmake .. && make` step....

Does this sound crazy?




On Thu, May 3, 2018 at 6:38 PM, Dirk Eddelbuettel <edd at debian.org> wrote:

>
> On 3 May 2018 at 16:19, Evan Biederstedt wrote:
> | Working with Linux first, is it common to compile a C library (i.e.
> bamdb)
> | within /src, and then use extern? My understanding is that I will have to
> | change the R package's Makevars to compile the C library first, and then
> | link to this.
> |
> | If there are any examples on github which you would be able to recommend,
> | that might be best. Then I can close this thread :)
>
> You have the hardest possibe deployment option here it requires temporary
> root to make a library a system library -- and R CMD ... does not have
> that.
>
> You need to change your plan. Using external libraries is hard. There are
> no
> freebies.
>
> Dirk
>
> --
> http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20180503/a17f505e/attachment.html>


More information about the Rcpp-devel mailing list