Skip to content
Prev 50929 / 63421 Next

R doesn't compile on FreeBSD 10.2

Prof Brian Ripley writes:
As suggested, I tried compiling from Subversion tag 3.2.2 (r69054).
I used no command-line options to 'configure', as mentioned in my
previous email, and this is the output:

  R is now configured for x86_64-unknown-freebsd10.2

    Source directory:          .
    Installation directory:    /usr/local

    C compiler:                cc  -g -O2
    Fortran 77 compiler:       gfortran48  -g -O2

    C++ compiler:              c++  -g -O2
    C++ 11 compiler:           c++  -std=c++11 -g -O2
    Fortran 90/95 compiler:    gfortran48 -g -O2
    Obj-C compiler:	     cc -g -O2 -fobjc-exceptions

    Interfaces supported:      X11, tcltk
    External libraries:        readline, zlib, bzlib, lzma, PCRE, curl
    Additional capabilities:   PNG, JPEG, TIFF, NLS, cairo, ICU
    Options enabled:           shared BLAS, R profiling

    Capabilities skipped:      
    Options not enabled:       memory profiling

    Recommended packages:      yes

(I thought this, and more, would be included in config.log, but please
let me know if there is other place to get the configuration details
that are relevant.)

Still the same error:

  --- tools.so ---
  cc -shared -L/usr/local/lib -o tools.so text.o init.o Rmd5.o md5.o signals.o install.o getfmts.o http.o gramLatex.o gramRd.o
  --- all ---
  --- shlib ---
  mkdir ../../../../library/tools/libs
  --- sysdata ---
  installing 'sysdata.rda'
  Error in dyn.load(file, DLLpath = DLLpath, ...) : 
    unable to load shared object '/usr/home/davor/R-3.2.2/library/tools/libs/tools.so':
    /usr/home/davor/R-3.2.2/library/tools/libs/tools.so: Undefined symbol "R_ClassSymbol"
  Error: unable to load R code in package 'tools'
  Execution halted
Interestintly, checking for R_ClassSymbol gives the same output as on
your working Linux system:

  ~/R-3.2.2$ nm -g bin/exec/R | grep R_ClassSymbol
  00000000008f8ff8 B R_ClassSymbol

  ~/R-3.2.2$ nm -g src/main/main.o | grep R_ClassSymbol
  0000000000000008 C R_ClassSymbol

  ~/R-3.2.2$ nm -g library/tools/libs/tools.so | grep R_ClassSymbol
                   U R_ClassSymbol

  ~/R-3.2.2$ nm -g src/library/tools/src/gramRd.o | grep R_ClassSymbol
                   U R_ClassSymbol
I tried 'configure --enable-R-shlib', still the same error.

I then tried adding MAIN_LDFLAGS as you suggested, and the install
worked. Thanks you very much! ("make check" fails in datetime.R, but
that's something I'll follow up in a separate email.)

Should configure.ac be changed to account for this on FreeBSD's using
clang? (I should probably also try compiling with GCC, which I had to
install anyways for gfortran.)

Davor