[R] problems compiling R packages with Linux

Ulf Mehlig umehlig at uni-bremen.de
Sat Jan 9 10:12:11 CET 1999

Colin Farrow <c.farrow at geology.gla.ac.uk> wrote:

 > I had similar problems a few weks back. What are you using to
 > compile the fortran? I guess it is either fort77 or g77. I had
 > problems with these.  something to do with ld flags passed to
 > fort77/g77 which don't get passed on to the ld stage. I eventually
 > switched to egcs for compiling and linking and everything ran
 > smoothly.

Hello Colin,

I was using gcc and g77 and 0.5.22, respectively. My (GNU)
make is 3.76.1. I have egcs stuff on my machine, but simply putting
that directory in front of the /usr/bin directory (where "normal" gcc
lives) in PATH didn't compile completely, either. (Now "gcc -v" yielded
"egcs-2.90.27 980315/egcs-1.0.2 release".)

I have to admit, that I don't even know, what egcs -- compared to gcc
-- is ... My Linux rpm package didn't have a good description
.. which egcs version did you use?

BTW, if there are incompatibilities between gcc/gcc-egcs, maybe the
configure script should be made aware of them, shouldn't it?

Further experimenting ...

... You made the observation that the problem had to do something with
switches not passed to the linker. Giving switch -shared to ld (we are
building a shared library, I think) works (invoked "manually"):

    ld -o eda.so line.o smooth.o -shared

produces eda.so (this is, where the first problem occurred). If I
start make again, it stops later at

    ../../../../bin/R SHLIB -o modreg.so bsplvd.o

Might be that R isn't invoking the linker correctly, too?

Linking modreg with ld -shared by hand seems to work, after that
R-0.63.1's Makefile produces the docs and installs; and R runs (at
least some of the demos).

Installing ctest by "R INSTALL ctest/" (my original problem) still
doesn't work, but linking .../ctest/libs/ctest.so fexact.o -shared
produces the library, and a new "R INSTALL ..." seems to install
it. So my problems seems to be solved for the moment (will start to
test the installation later), but there apparently are some
inconsistencies within R's configure/make-scripts, I think.

Many thanks for suggestions & attention!

Ulf Mehlig    <umehlig at zmt.uni-bremen.de>
              Center for Tropical Marine Ecology/ZMT, Bremen, Germany

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list