R-alpha: NOT dyn.load problem

Paul Gilbert (jellis@uottawa.ca)
Wed, 04 Dec 1996 08:20:47 -0400


Date: Wed, 04 Dec 1996 08:20:47 -0400
From: Paul Gilbert <jellis@uottawa.ca>
To: Ross Ihaka <ihaka@stat.auckland.ac.nz>
Subject: R-alpha: NOT  dyn.load problem

Ross

The segmentation fault problem I reported as being caused by dyn.loaded
code was in fact the cbind problem. The second reproducable segmentation
fault problem I reported more recently was not fixed by the quick fix to
cbind but does seem to have been fixed by adding return ans; to SEXP
do_anydf. There are still occasional random segmentation fault problems.

After spending some time looking through the compile procedures I have
some questions.

You switched from F77=  to FC= (with nothing on the RHS of the =) in the
generated Makefiles. This does not work in the makefile for my library
unless I specify FC=f77. Since I don't have a fortran compiler f77
actually does f2c and then gcc.

I noticed that you do not use f77 but explicitly do the 2 step, so I
changed. Is it better to do this in two steps? My makefile is

CC=gcc
CFLAGS=-g -O -fpic
SHLIBLDFLAGS=-shared
LDCMD=gcc
DLLFLAGS=-rdynamic
# LIBS=-lf2c -ldl -ltermcap -lm 

all:         dsefor.so

dsefor.so:   dsefor.o 
             $(LDCMD) $(DLLFLAGS) $(SHLIBLDFLAGS) dsefor.o -o dsefor.so 

dsefor.o:    dsefor.c
             $(CC) $(CFLAGS) -c  dsefor.c

dsefor.c:
             f2c dsefor.f
clean:
             @rm -f *.o *.so dsefor.c
realclean:
             @rm -f Makefile *.o *.so dsefor.c


I think you previously used ld (at least I did and the Makefile in
demos/dynload does)and in most of your makefiles you have now changed to
using gcc for the load. ld complains about -share used with -rdynamic 
but gcc used in place of ld does not complain. However, I would guess
that either they mean something different to ld and gcc, or gcc is
ignoring one, or gcc has an error. Can you explain this? Also, in your
previous message you seemed to suggest using LIBS but I'm not sure if I
need it. Things seems to work without it, but that may be because I have
not yet run into the necessary circumstance.

Sometime when things settle down a bit it would be useful to have an
example of a good way to set up a makefile.in and configure for
application libraries to use on different platforms (but I need complex
numbers first).

I'm sorry my time series library was probably not working well enough
for your course, but it looks to be in very good shape now. Most of the
programs are working (except for the model root stuff which needs the
complex numbers, as does the research I'm trying to do now). In a
separate email I have outlined some problems and I am still trying to
clean up a few other things. I will circulate a summary sometime.

Paul Gilbert


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-testers mailing list -- For info or help, send "info" or "help",
To [un]subscribe, send "[un]subscribe"
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-