conliffe@CAEN.ENGIN.UMICH.EDU (Darryl C. Conliffe) (09/08/90)
Mark's explanation about 'pic' code is correct. The three commands that would handle your example are: cc -c hp_main.c cc -W0,-pic -c hp_foo.c ld -o hp hp_main.o -A inlib,hp_foo.o ___________________ Darryl C. Conliffe conliffe@caen.engin.umich.edu (313) 721-6069 -------------------
rees@pisa.ifs.umich.edu (Jim Rees) (09/10/90)
In article <4cac30987.000bdbe@caen.engin.umich.edu>, conliffe@CAEN.ENGIN.UMICH.EDU (Darryl C. Conliffe) writes:
Mark's explanation about 'pic' code is correct.
The three commands that would handle your example are:
cc -c hp_main.c
cc -W0,-pic -c hp_foo.c
ld -o hp hp_main.o -A inlib,hp_foo.o
Better yet:
cc -W0,-pic -c hp_foo.c
cc -c -W0,-inlib,hp_foo.o hp_main.c
ld -o hp hp_main.o -A inlib,hp_foo.o
The linker will warn you when the extra '-W0,-inlib' in the compile step is
necessary.
Unfortunately, there's a bug in /bin/cc and it doesn't pass the '-A inlib'
on to the compiler. That's why you have to use -W0 instead of -A in step
two above.
thomas@max.bnl.gov (Richard A. Thomas) (09/11/90)
Many of the people where I work use the Aegis environment, but as I am more familiar with Ultrix, I have been using the bsd4.3 environment. I have not been able to figure out what commands in the bsd4.3 environment correspond to binding with the inlib option in the Aegis environment. The following commands, when issued in the Aegis environment, correctly compile and link the Fortran program cplot.ftn. ftn cplot -dba bind cplot.bin@ -inlib /users/operations/com/controls.userlib@ -inlib /users/operations/com/gui.lib@ -inlib /users/operations/com/calcomp.gprlib@ -b cplot I tried copying the file cplot.ftn to cplt.f and issuing the commands: f77 -W0,-inlib,/users/operations/com/controls.userlib \ -W0,-inlib,/users/operations/com/gui.lib \ -W0,-inlib,/users/operations/com/calcomp.gprlib \ -c cplt.f ld -o cplt \ -A inlib,/users/operations/com/controls.userlib,/users/operations/com/gui.lib,/users/operations/com/calcomp.gprlib \ cplt.o But that resulted in undefined symbols: cplt.f: undefined first referenced symbol in file elips_ cplt.o symbol_ cplt.o poly_ cplt.o circl_ cplt.o rect_ cplt.o line_ cplt.o dashl_ cplt.o axis_ cplt.o rescale_ cplt.o terminate_gpr_ cplt.o release_ cplt.o acquire_ cplt.o erase_ cplt.o calcomp_set_backround_color_ftn_ cplt.o calcomp_set_pen_color_ftn_ cplt.o calinit_ cplt.o new_initialize_gpr_ cplt.o gui_load_color_map_ cplt.o ld warning: Output file cplt not executable If I execute esa on any of the symbols, I get % esa elips Symbol not found. So I issued inlib commands to my csh shell for the three libraries. That didn't change the results for compiling and linking using f77 and ld, but it did change the result of executing the esa command. % esa elips Symbol known but not loaded Do I have to recreate the *.lib files or process them in some special way to make them usable in the bsd4.3 environment? Any help is sincerely appreciated. Thank you. Richard Thomas Brookhaven National Laboratory
oliver@eros.ame.arizona.edu (Oliver Paschereit) (09/12/90)
internet: oliver@eros.ame.arizona.edu oliver@rvax.ccit.arizona.edu uucp: ...{allegra,seismo,hao!noao}!arizona!eros!oliver BITNET: oliver@arizrvax 1811@db0tuz01 (Berlin)
oliver@eros.ame.arizona.edu (Oliver Paschereit) (09/12/90)
In article <2115@bnlux0.bnl.gov> thomas@max.UUCP (Richard A. Thomas) writes: > > Many of the people where I work use the Aegis environment, but as I am >more familiar with Ultrix, I have been using the bsd4.3 environment. I have >not been able to figure out what commands in the bsd4.3 environment >correspond >to binding with the inlib option in the Aegis environment. > ... > ... > I tried copying the file cplot.ftn to cplt.f and issuing the commands: > > f77 -W0,-inlib,/users/operations/com/controls.userlib \ > ... > But that resulted in undefined symbols: > > cplt.f: > undefined first referenced > symbol in file > elips_ cplt.o > .... > Any help is sincerely appreciated. Thank you. > > Richard Thomas > Brookhaven National Laboratory > The ftn compiler used without options does not ad a trailing underscore to the object files. The f77 will look for object files with an underscore, like elips_ . You can give ftn the option to add an underscore to the object files, which means you have to recompile all your libraries. I believe though that f77 has not the option to ignore the underscore. I can't give more information because my Apollo is far away in Berlin and I don't remember all the compiler options for ftn. Still, you can invoke ftn from a unix environment. Hope this helps - Oliver internet: oliver@eros.ame.arizona.edu oliver@rvax.ccit.arizona.edu uucp: ...{allegra,seismo,hao!noao}!arizona!eros!oliver BITNET: oliver@arizrvax 1811@db0tuz01 (Berlin)