Re: [Rd] R CMD check linking errors, when interfacing c++

From: Zalan Szakolci <szakolci_at_petabyte-research.org>
Date: Wed, 09 May 2012 15:28:56 +0200

Yes, you were right guys, I've deleted my Makefile from the directory, and everything goes fine.

Many thanks.

On 9 May 2012 15:16, Simon Urbanek <simon.urbanek_at_r-project.org> wrote:

>
> On May 9, 2012, at 9:10 AM, Zalan Szakolci wrote:
>
> > Hi,
> >
> > Thanks for the suggestions. I've forgotten to point out, that
> >
> > R CMD COMPILE and
> > R CMD SHLIB
> >
> > works fine, the dll file was indeed created. I get these undefined
> > references when I'm trying to run R CMD INSTALL.
> >
>
> ... which means you are probably doing something silly in Makevars or
> Makefile (ideally, you should not have either) -- and that's why Dirk was
> asking you.
>
>
> > I've read through the "Writing R extensions" and the archives, but I
> really
> > don't know what am I doing wrong.
> >
> > More suprising, when I run the same package in windows with R CMD check,
> > the dll for src-i386 was created, but not the 64 -bit, i'm getting:
> sorry,
> > 64 bit compilation not supported (or someting similar)
> >
>
> You have the wrong toolchain on your PATH (see recent question here).
>
> Cheers,
> Simon
>
>
>
> > If anyone have an idea, comments welcome.
> >
> > Thanks,
> >
> > Zalan
> >
> > On 9 May 2012 14:11, Dirk Eddelbuettel <edd_at_debian.org> wrote:
> >
> >>
> >> On 9 May 2012 at 00:35, Zalan Szakolci wrote:
> >> | Hi there,
> >> |
> >> | I am trying to interface c++ code in R and make a package. With R CMD
> >> SHLIB
> >> | the dll was created, but when I try R CMD check, I am getting
> 'undefined
> >> | reference to..' linkage error messages.
> >> |
> >> | The relevant c++ source from conf-infomap.cpp:
> >>
> >> [...]
> >>
> >> | Now when I run R CMD check, in file 00install.out I am getting the
> >> | following linking errors:
> >> |
> >> | * installing *source* package DyA ...
> >> | ** libs
> >> | ** arch -
> >> | g++ -I/usr/share/R/include -DNDEBUG -fpic -I -Wall -O3
> >> -funroll-loops
> >> | -pipe -c conf-infomap.cpp -o conf-infomap.o
> >> | g++ -I/usr/share/R/include -DNDEBUG -fpic -I -Wall -O3
> >> -funroll-loops
> >> | -pipe -c GreedyBase.cpp -o GreedyBase.o
> >> | g++ -I/usr/share/R/include -DNDEBUG -fpic -I -Wall -O3
> >> -funroll-loops
> >> | -pipe -c Greedy.cpp -o Greedy.o
> >> | g++ -I/usr/share/R/include -DNDEBUG -fpic -I -Wall -O3
> >> -funroll-loops
> >> | -pipe -c Node.cc -o Node.o
> >> | g++ conf-infomap.o GreedyBase.o Greedy.o Node.o mersenne.cpp stoc1.cpp
> >> | userintf.cpp -lm -o conf-infomap
> >>
> >> What is your src/Makevars file?
> >>
> >> This looks very wrong as you are obviously not linking against R itself.
> >>
> >> I would recommend a good long look at both the 'Writing R Extensions'
> >> manual
> >> as well as some of the existing CRAN packages uses C++ sources.
> >>
> >> You can (and should) also try
> >>
> >> R CMD COMPILE ...
> >>
> >> R CMD SHLIB ...
> >>
> >> R CMD INSTALL ...
> >>
> >> etc as 'R CMD check' is really only the final bit.
> >>
> >> Dirk
> >>
> >> --
> >> R/Finance 2012 Conference on May 11 and 12, 2012 at UIC in Chicago, IL
> >> See agenda, registration details and more at http://www.RinFinance.com
> >>
> >
> > [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-devel_at_r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
>
>

        [[alternative HTML version deleted]]



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed 09 May 2012 - 13:32:09 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 10 May 2012 - 08:31:16 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive