[R] Trouble building R 3.5.0 under Ubuntu 18.04

Steve Gutreuter @gutreuter @ending from gm@il@com
Wed May 23 00:47:49 CEST 2018


I would love to hear from anyone who has successfully built 3.5.0 under
 Ubuntu 18.04 (Bionic Beaver).  My attempts have failed, including:

export LDFLAGS="$LDFLAGS -fPIC"
export CXXFLAGS="$CXXFLAGS -fPIC"
export CFLAGS="$CFLAGS -fPIC"
./configure --enable-R-shlib --prefix=/usr/lib/R/3.5.0

#### Configure completes normally without errors or warnings

make

#### make fails, always with lines like:
/usr/bin/x86_64-linux-gnu-ld: ../appl/dtrsl.o: relocation R_X86_64_32
against `.rodata' can not be used when making a shared object;
recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: attrib.o: relocation R_X86_64_PC32
against symbol `R_NilValue' can not be used when making a shared
object; recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
Makefile:177: recipe for target 'libR.so' failed
make[3]: *** [libR.so] Error 1
make[3]: Leaving directory '/home/steve/src/R/R-3.5.0/src/main'
Makefile:135: recipe for target 'R' failed

How does one set the -fPIC flag?

I have never had trouble compiling under Mint, which is based on
Ubuntu.

Thanks!
Steve



More information about the R-help mailing list