R-3.1.3从源错误安装.bss.zero_length_string'制作共享对象时不能使用;用-fPIC重新编译

时间:2016-01-18 17:52:53

标签: r linux gcc amazon-ec2 amazon

我一直试图从

上的源代码安装R-3.1.3
# cat /etc/*release*
NAME="Amazon Linux AMI"
VERSION="2015.09"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2015.09"
PRETTY_NAME="Amazon Linux AMI 2015.09"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2015.09:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"
Amazon Linux AMI release 2015.09
cpe:/o:amazon:linux:2015.09:ga

之后./configure&&安装失败并出现以下错误

gcc -std=gnu99 -shared -fopenmp -L/usr/local/lib64 -o libRlapack.so 
dlamch.o dlapack.o cmplx.o   -L../../../lib -lRblas -lgfortran -lm -lquadmath
/usr/bin/ld: /usr/lib/gcc/x86_64-amazon-linux/4.8.3/libgfortran.a(string_intrinsics.o): relocation R_X86_64_32S against `.bss.zero_length_string' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-amazon-linux/4.8.3/libgfortran.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make[4]: *** [libRlapack.so] Error 1

当然,我在how to recompile with -fPICWhat do R_X86_64_32S and R_X86_64_64 relocation mean?上的R_X86_64_32S了解-fPIC

然后我在CFLAGS中进行了更改

#  ./configure 'CFLAGS=-g -O2 -fPIC' --with-x=no --enable-shared

我知道它有效,因为configure会打印它设置的值

C compiler:                gcc -std=gnu99  -g -O2 -fPIC
Fortran 77 compiler:       gfortran  -g -O2

然而,同样的错误发生了。 我已经在Centos65上测试了这个,Centos71和Ubuntu1404都可以正常工作,但是我的VPC没赢,请帮忙

0 个答案:

没有答案