Skip to content

problems compiling R packages with Linux

3 messages · Peter Dalgaard, Ulf Mehlig

#
Hello out there,

my first try to install a package (e.g. ctest from CRAN) didn't
succeed; looking at the error messages I think it must be a
configuration problem of my machine, but as I'm not very experienced I
would be glad if someone could give me a hint ...

R's version is 0.63.0, my i386-Linux is kernel 2.0.35. I hadn't had
problems to compile R, and R itself seems to work.

If I try to install the package by

  > R INSTALL /usr/local/share/R/library/ctest/

I get a lot of error messages. R is installed in /usr/local/share/R,
and I untar'ed the package in the library directory. I have write
permissions for those directories. Apparently the linker cannot find a
"main" module file or a certain (shared?) library. Some -lxxx missing
on compiler's command line?

  Installing package `ctest' ...
   libs
  make: `fexact.o' is up to date.
  ld: warning: cannot find entry symbol _start; defaulting to 08048280
  fexact.o: In function `fexact':
  /usr/local/share/R/library/ctest/src/fexact.c:160: undefined reference to `calloc'
  /usr/local/share/R/library/ctest/src/fexact.c:290: undefined reference to `free'
  fexact.o: In function `f2xact':
  /usr/local/share/R/library/ctest/src/fexact.c:503: undefined reference to `log'
  /usr/local/share/R/library/ctest/src/fexact.c:505: undefined reference to `log'   

  [...]

  fexact.o: In function `alogam':
  /usr/local/share/R/library/ctest/src/fexact.c:2229: undefined reference to `log'
  /usr/local/share/R/library/ctest/src/fexact.c:2232: undefined reference to `log'
  /usr/lib/libblas.so: undefined reference to `strcpy'
  /usr/lib/libblas.so: undefined reference to `sqrt'
  /usr/lib/libblas.so: undefined reference to `times'
  /usr/lib/libblas.so: undefined reference to `__ctype_b'
  /usr/lib/libblas.so: undefined reference to `errno'
  /usr/lib/libblas.so: undefined reference to `__strtol_internal'
  /usr/lib/libblas.so: undefined reference to `_IO_stdout_'        

  [...]

I hope there is a kind soul who can help a little bit ;-)

Many thanks,
Ulf

----------------------------------------------------------------------
P.S.: g77 -v yields

  g77 version 0.5.22
   gcc -v -fnull-version -o /tmp/gfa11201 -xf77-cpp-input /tmp/gfa11201.f -xnone -lf2c -lm
  Reading specs from /usr/lib/gcc-lib/i486-delix-linux/2.7.2.3/specs
  gcc version 2.7.2.3
   /usr/lib/gcc-lib/i486-delix-linux/2.7.2.3/cpp -lang-c -v -undef -D__GNUC__=2 -D__GNUC_MINOR__=7 -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__i386 -D__linux -Asystem(unix) -Asystem(posix) -Acpu(i386) -Amachine(i386) -D_LANGUAGE_FORTRAN -traditional -D__i486__ /tmp/gfa11201.f /tmp/cca11202.i
  GNU CPP version 2.7.2.3 (i386 Linux/ELF)
  #include "..." search starts here:
  #include <...> search starts here:
   /usr/local/include
   /usr/i486-delix-linux/include
   /usr/lib/gcc-lib/i486-delix-linux/2.7.2.3/include
   /usr/include
  End of search list.
   /usr/lib/gcc-lib/i486-delix-linux/2.7.2.3/f771 /tmp/cca11202.i -fset-g77-defaults -quiet -dumpbase gfa11201.F -version -fversion -fnull-version -o /tmp/cca11202.s
  GNU F77 version 2.7.2.3 (i386 Linux/ELF) compiled by GNU C version 2.7.2.3.
  GNU Fortran Front End version 0.5.22 compiled: Mar 29 1998 22:48:35
   as -V -Qy -o /tmp/cca112021.o /tmp/cca11202.s
  GNU assembler version 2.9.1 (i686-pc-linux-gnulibc1), using BFD version 2.9.1.0.7
   ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.1 -o /tmp/gfa11201 /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/lib/gcc-lib/i486-delix-linux/2.7.2.3 /tmp/cca112021.o -lf2c -lm -lgcc -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o
  __G77_LIBF77_VERSION__: 0.5.22
  @(#)LIBF77 VERSION 19970919
  __G77_LIBI77_VERSION__: 0.5.22
  @(#) LIBI77 VERSION pjw,dmg-mods 19970916
  __G77_LIBU77_VERSION__: 0.5.22
  @(#) LIBU77 VERSION 19970919
#
Ulf Mehlig <umehlig at uni-bremen.de> writes:
Two things here look like trouble. One is that a lot of configure/make
issues has been hashed out between 0.63.0 and 0.63.1, and the other is
that you seem to be extracting your source files into the same
directory that the package should be installed in, which may confuse
make rather badly. Try one of

* extract to (say) /usr/local/src/R-contrib/ctest and then just
  R INSTALL /usr/local/src/R-contrib/ctest

* upgrade to 0.63.1

... or both. Works ok here with 
  Version 0.63.2 in progress (December 22, 1998)
anyway.
#
Peter Dalgaard <p.dalgaard at biostat.ku.d> wrote:

            
Thanks! Unfortunately, neither one of your suggestions works.
Observing the built of R-0.63.1, I got similar error messages like
yesterday when I tried to INSTALL the libraries; afterwards I
re-compiled 0.63.0 for control purpose, and got the errors, too!
Apparently I overlooked them when building the first time in November;
nevertheless, both versions produce working executables, but 0.63.1
won't install them like 0.63.0 ... *not* working (0.63.0) is building
of eda.so and similarly modreg.so as well as mva.so -- you see, I
rather didn't check anything thoroughly when building then :-(

With R-0.63.1, the make process fails completely, but at the same
place (see logs of make's activities below).

Do you need further informations (output of configure, Makefile etc.)?
I don't want to molest people on the list by posting lengthy error
logs, so if somebody thinks he/she could give me a hint how to
proceed, please tell me, which information we need to find the cause
of trouble.

Many thanks!
Ulf


----------------------------------------------------------------------
log of make [0.63.0]:

  [...]
  ld -lblas  -o eda.so line.o smooth.o
  ld: warning: cannot find entry symbol _start; defaulting to 080481e0
  line.o: In function `il':
  /usr/local/src/R/R-0.63/src/library/eda/src/line.c:6: undefined reference to `floor'
  line.o: In function `iu':
  /usr/local/src/R/R-0.63/src/library/eda/src/line.c:11: undefined reference to `ceil'
  line.o: In function `line':
  /usr/local/src/R/R-0.63/src/library/eda/src/line.c:24: undefined reference to `rsort'
  /usr/local/src/R/R-0.63/src/library/eda/src/line.c:49: undefined reference to `rsort'
  /usr/local/src/R/R-0.63/src/library/eda/src/line.c:55: undefined reference to `rsort'
  /usr/local/src/R/R-0.63/src/library/eda/src/line.c:62: undefined reference to `rsort'
  /usr/lib/libblas.so: undefined reference to `strcpy'
  /usr/lib/libblas.so: undefined reference to `sqrt'
  [...]

----------------------------------------------------------------------
log of make [0.63.1]:

  ld  -o eda.so line.o smooth.o
  ld: warning: cannot find entry symbol _start; defaulting to 08048080
  line.o: In function `il':
  /usr/local/src/R/R-0.63.1/src/library/eda/src/line.c:6: undefined reference to `floor'
  line.o: In function `iu':
  /usr/local/src/R/R-0.63.1/src/library/eda/src/line.c:11: undefined reference to `ceil'
  line.o: In function `line':
  /usr/local/src/R/R-0.63.1/src/library/eda/src/line.c:24: undefined reference to `rsort'
  /usr/local/src/R/R-0.63.1/src/library/eda/src/line.c:49: undefined reference to `rsort'
  /usr/local/src/R/R-0.63.1/src/library/eda/src/line.c:55: undefined reference to `rsort'
  /usr/local/src/R/R-0.63.1/src/library/eda/src/line.c:62: undefined reference to `rsort'
  make[4]: *** [eda.so] Error 1
  make[4]: Leaving directory `/usr/local/src/R/R-0.63.1/src/library/eda/src'
  make[3]: *** [all] Error 1
  make[3]: Leaving directory `/usr/local/src/R/R-0.63.1/src/library/eda'
  make[2]: *** [R] Error 1
  make[2]: Leaving directory `/usr/local/src/R/R-0.63.1/src/library'
  make[1]: *** [R] Error 1
  make[1]: Leaving directory `/usr/local/src/R/R-0.63.1/src'
  make: *** [R] Error 1