On Thu, 10 Jun 1999, Friedrich Leisch wrote:> Yes, if I understood AIX workings correct you have to have a text file > of to-be-exported symbols at the time of linking a shared library, > i.e. the linker is called like (this is pasted from a mail by Arne) > > $(F77) -o module.so -bM:SRE -bE:module.exp -bnoentry $(OBJECTS) $(LIBDIR) $(LIBS) > > where module.exp is a text file containing the names of symbols to be > exported by module.soI think you can skip creating the text file by changing the command line options to $(F77) -o module.so -bM:SRE -bexpall -bnoentry $(OBJECTS) $(LIBDIR) $(LIBS) ie replacing the -bE:module.exp option by -bexpall. This option is only available in AIX 4.2 and later. I have just tried it and it appears to work for me. Maybe we are really getting somewhere!! Arne -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel 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-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
"Arne" == Arne Kovac <kovac@cauchy.mathematik.uni-essen.de> writes: Arne> I think you can skip creating the text file by changing the command line Arne> options to Arne> Arne> $(F77) -o module.so -bM:SRE -bexpall -bnoentry $(OBJECTS) $(LIBDIR) Arne> $(LIBS) Uh, works, kind of... | build/src/library/eda/src $ f77 -o eda.so -bM:SRE -bexpall -bnoentry line.o smooth.o | ld: 0711-317 ERROR: Undefined symbol: .rsort | ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more | information. The problem is that rsort is defined in sort.c. So I put all the R files in src/main into a library: | build/src/main $ ar cr libR.a *.o And run the linker again: | build/src/library/eda/src $ f77 -o eda.so -bM:SRE -bexpall -bnoentry | line.o smooth.o -L../../../main -lR -L../../../unix -lunix | -L../../../appl -lappl -L../../../nmath -lmath -lX11 -ldl -lblas No error messages this time, but eda.so is big: 3020844 bytes. Something ain't right here. There should be a way of telling the linker to not include the libs. It should verify that all functions that are referenced will be defined at runtime. Comments? -tom -- mailto:tov@ece.cmu.edu (Tom Vogels) Tel: (412) 268-6638 FAX: -3204 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel 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-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hi, since I've never used dlsym and friends before, I coded a test case last night to understand what's going on. I've put it at: http://www.ece.cmu.edu/~tov/public/dltest.tar.gz It should work out of the box for AIX 4.2 and Linux. It's a simple program that loads a shared object, uses it (with references back to the main program), and then discards it. Main point of the exercise is to find out how to compile this stuff with AIX. The "ugliness" that I encounter is that I need a file of the exported symbols in R and the libraries (libappl.a, libmath.a, etc.). Otherwise I get core dumps. Any suggestions for when to build it or where to patch the Makefiles? If you have a machine with AIX, would you mind downloading the dltest tarfile? Just unzip it, untar it. Then in the dltest directory, start "make test". Should print "OK" eventually... Thanks, -tom -- mailto:tov@ece.cmu.edu (Tom Vogels) Tel: (412) 268-6638 FAX: -3204 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel 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-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._