Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile needs to compile with -fPIC option to install #1

Open
ndrein opened this issue Nov 2, 2016 · 0 comments
Open

Makefile needs to compile with -fPIC option to install #1

ndrein opened this issue Nov 2, 2016 · 0 comments

Comments

@ndrein
Copy link

ndrein commented Nov 2, 2016

Hi,

I've tried install R-snappy, but I get errors when trying to "make":

Full output below:

[nreinhardt@qlogin6 R-snappy2]$ make
R CMD COMPILE r-snappy.c
make[1]: Entering directory /hpf/largeprojects/ccmbio/nreinhardt/sergey-report/R-snappy2' gcc -std=gnu99 -I/hpf/tools/centos6/R/3.3.1/lib64/R/include -DNDEBUG -I/usr/local/include -fpic -g -O2 -c r-snappy.c -o r-snappy.o make[1]: Leaving directory /hpf/largeprojects/ccmbio/nreinhardt/sergey-report/R-snappy2'
g++ -o snappy.o -c snappy/snappy.cc
g++ -o snappy-c.o -c snappy/snappy-c.cc
g++ -o snappy-sinksource.o -c snappy/snappy-sinksource.cc
g++ -o snappy-stubs-interal.o -c snappy/snappy-stubs-internal.cc
g++ -fPIC -shared -Wall -g -O2 -o snappy.so r-snappy.o snappy.o snappy-c.o snappy-sinksource.o snappy-stubs-interal.o
/usr/bin/ld: snappy.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
snappy.o: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make: *** [snappy.so] Error 1

I modified R-snappy/Makefile to compile with -fPIC, and the installation works. I've tested the sample usage given, and that works as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant