eddelbuettel/rcppredis

cannot install rcppredis

cbarbu opened this issue · 4 comments

Hi,
I was trying to install it using devtools
library("devtools")
install()

but I get the following error message :
[...[
/usr/bin/ld: RcppExports.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
RcppExports.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make: *** [RcppRedis.so] Error 1
ERROR: compilation failed for package ‘RcppRedis’

  • removing ‘/tmp/RtmpDEzN2n/devtools_install_20031bc9c839/RcppRedis’
    Erreur : Command failed (1)

Thanks

This is not reproducible and pretty free of useful content:

  • maybe your compiler is too old. But I can't tell as you didn't tell me what compiler you have;
  • maybe your hiredis library is borked, but I can't tell as you gave no detail;

etc.

CRAN tests these package rigorously on multiple platforms; they work on proper setups.

Maybe see the R Installation and Administration manual for more.

Is that the information you care about ?

Linux almira 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2

R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"
Platform: x86_64-pc-linux-gnu (64-bit)

By the way I figured out that it likely is hiredis install that is borked as the linking needs extra things:

gcc -o a.out example_perso.c $(pkg-config --cflags --libs hiredis) -I/usr/include/hiredis
example_perso.c:21:21: fatal error: hiredis.h: No such file or directory
#include <hiredis.h>

but

gcc -o a.out example_perso.c $(pkg-config --cflags --libs hiredis) -I/usr/include/hiredis

is fine.
Looks like the fix posted there: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=739834
Never made it through my distrib.

You appear to be having issues with your hiredis installation. As I mentioned previously, CRAN package like RcppRedis get tested extensively on Debian, Fedora, OS X, Windows, ... and work there.

We use a very standard configure and src/Makevars.in approach. I build that way all the time on Ubuntu. Maybe you are on Debian stable (you didn't say, I infer from g++ 4.8) so maybe you need to install / backport an updated hiredis package. If you can't you need to hardwire your values in src/Makevars.

This isn't really an RcppRedis issue ...

Also:

edd@max:~$ dpkg -L libhiredis-dev | grep hiredis.h
/usr/include/hiredis/hiredis.h
edd@max:~$ cd git/rcppredis/
edd@max:~/git/rcppredis(master)$ grep include src/*cpp
src/RcppExports.cpp:#include <Rcpp.h>
src/Redis.cpp:#include <Rcpp.h>
src/Redis.cpp:#include <hiredis/hiredis.h>        // we check in configure for this
src/Redis.cpp:#include <RApiSerializeAPI.h>     // provides C API with serialization for R
edd@max:~/git/rcppredis(master)$ 

so you do not need a -I flag.