[Rcpp-devel] Rcpp question regarding compilation of another package
edd at debian.org
Tue Dec 13 14:31:11 CET 2016
Thanks for posting here, and showing complete references. Your earlier
StackOverflow questions went nowhere. Hopefully we can tackle this here.
On 12 December 2016 at 17:32, khagay nagdimov wrote:
| I am trying to create a package that uses Rcpp to translate code from SeqLib (
| https://github.com/walaj/SeqLib) into R. I have compiled SeqLib but, I still
| have problems referencing the function definitions. The current structure of my
| R package is shown here: https://github.com/KhagayN/SeqLibr
A bit of a mess. The repo is full of object files (.o), editor backups (*~),
editor temp files (#*#). But at least you are using the right editor.
I have no experience with git submodules and cannot say wether SeqLib again
in SeqLibR is a good idea.
| My makevars links to the location of the header files and to the static
| libraries. To my understanding, the header files linked via PKG_CXXFLAGS point
| to the header files and PKG_LIBS points to the static libraries. Then, in
The Makevars is suspicious:
## the following flags are for PreProcessor.
PKG_CPPFLAGS= -I../bwa/ -I../ -I../src/SeqLib/*
First, the ../bwa/ directory does not work. R includes _everything below
inst/_ but only a few known directories at the top-level. This is why we all
put headers into inst/include/ --- so I would make **very strongly** suggest
you move bwa/ into inst/include/bwa and then use -I../inst/include/bwa.
Second, you are in src/ so ../src/ makes no sense. Make that -ISeqLib/
Third, there is no notion of wildcards in include directories. So -ISeqLib/
Fourth, for SeqLib you do
( cd SeqLib; ./configure; make; make install; )
and you _almost surely_ should not run 'make install'. The rest of your
src/Makevars is trying to use the static library from that directory; make
install would attempt to write the library somewhere else. "Writing R
Extensions* _explicitly_ prohibits that for good reason.
I stop here. Other failures related to loading object are likely due to
these issues which you probably want to correct first.
| rcpp_hello_world.cpp, I reference a function called Open within the FastqReader
| class within the SeqLib namespace but, when I run load_all() I get an effor
| Error in dyn.load(dllfile);
| unable to load shared object 'subsetSeqLib.so': undefined symbol:
| _ZN6SeqLib11FastqReader40OpenERKSs, which references that Open function from
| FastqReader. I don't understand why this is happening since I am linked to the
| static libraries that have the definition of that function.
| Thanks for all the help.
| Rcpp-devel mailing list
| Rcpp-devel at lists.r-forge.r-project.org
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
More information about the Rcpp-devel