Hi Simon and Vladimir,

>> On Oct 19, 2021, at 4:13 PM, Pariksheet Nanda <pariksheet.na...@uconn.edu> wrote: >> The trouble is, R's installation process will only copy compiled files from ./libs/ that have exactly the extension ".so" and files ending with ".so.1" are ignored.
--snip--
>> library(tsshmm)
>> ...
>> Error: package or namespace load failed for 'tsshmm' indyn.load(file, DLLpath = DLLpath, ...): >> unable to load shared object '/home/omsai/R/x86_64-pc-linux-gnu-library/4.1/tsshmm/libs/tsshmm.so': >> libghmm.so.1: cannot open shared object file: No such file or directory
>
Pariksheet
On 10/19/21 5:00 AM, Simon Urbanek wrote:

dynamic linking won't work, compile a static version with PIC enabled. If the 
subproject is autoconf-compatible this means using --disable-shared --with-pic. 
Then you only need to add libfoo.a to your PKG_LIBS. >
> Simon

On 10/19/21 6:39 AM, Vladimir Dergachev wrote:
>
> The simplest thing to try is to compile the library statically and link it
> into your package. No extra files - no trouble.
>
> You can also try renaming the file from *.so.1 to *.so.
>
> Vladimir Dergachev

Thank you both for your suggestions! I will link the code statically with PIC per your consensus.

I found when linking the R package library, one also has to link the dependencies of the static library; in this case libghmm depends on libxml-2.0 > 2.6 and so I have to link libxml2 to my R package library after finding libxml2 with pkg-config.


Thanks for the quick replies,

Pariksheet

______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to