Done already, without success. The whole Makevars file is as follows (I didnt paste it before):

OBJECTS.PnuChart = ngraph.o RcppExports.o
OBJECTS.PnuChart = PnuChart/Finder.o
OBJECTS = $(OBJECTS.PnuChart)

PKG_CPPFLAGS = -DPRINTLOG -I"../inst/include" -I. -pthread
PKG_LIBS = -lcurl -lpthread `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"` $(R_HOME)/bin/Rscript -e "RcppGSL:::LdFlags()"`
CXX_STD = CXX11

And the g++ linking phase:

g++ -std=c++0x -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o NgrapH.so PnuChart/Finder.o -lcurl -lpthread /usr/lib/R/bin/Rscript -e RcppGSL:::LdFlags()/usr/lib/R/bin/Rscript -e Rcpp:::LdFlags()-L/usr/lib -lgsl -lgslcblas -lm -L/usr/lib/R/lib -lR



Fabio



On 05/05/2015 11:14 PM, Kevin Ushey wrote:
You need to link to GSL as well. RcppGSL provides the appropriate flags
within `RcppGSL::LdFlags()`. See what RcppGSL does itself in its
configure scripts:
https://github.com/eddelbuettel/rcppgsl/blob/2849b8dd777c8057e524c2141dfeaa8e28840350/inst/skeleton/configure.win.

Kevin


On Tue, May 5, 2015 at 2:08 PM, Fabio Tordini <tord...@di.unito.it
<mailto:tord...@di.unito.it>> wrote:

    Ok, I found the 'scrm' Rcpp package: here the file scrmr.cpp
    provides an interface for calling the scrm C++ application from R.
    following their solution, I modified my Makevars file, adding:

    OBJECTS.PnuChart = ngraph.o RcppExports.o
    OBJECTS.PnuChart = PnuChart/Finder.o
    OBJECTS = $(OBJECTS.PnuChart)

    Now the linker finds the object files and knows where functions
    "are". so, previous error is solved.

    but loading still fails with the following message:

      /home/fabio/R/x86_64-pc-linux-gnu-library/3.0/NgrapH/libs/NgrapH.so: 
undefined symbol: gsl_vector_alloc
    Error: loading failed

    In fact, I do use gsl, that's why I added RcppGSL in the DESCRIPTION
    file at 'LinkingTo'. Also, I use the attribute
    '// [[Rcpp::depends(RcppGSL)]]' in those headers where GSL functions
    are used, and included <RcppGSL.h>. I do not export those functions
    because they're not called directly from R.

    still, I get the loading failed error.


    Fabio





    On 05/05/2015 10:15 PM, Dirk Eddelbuettel wrote:


        On 5 May 2015 at 16:28, Fabio Tordini wrote:
        | Here is the actual (simple) code:
        |
        |       Finder *f = new Finder();
        |       f->parseFiles(str_g, str_f, str_s);

        So where is Finder implemented?

        The computer tells you that you want to use it, but don't supply it.

        Dirk

    _______________________________________________
    Rcpp-devel mailing list
    Rcpp-devel@lists.r-forge.r-project.org
    <mailto:Rcpp-devel@lists.r-forge.r-project.org>
    https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel



--
Fabio Tordini
PhD Candidate
Computer Science Dep.
University of Torino - Italy
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to