Path: utzoo!utgpu!attcan!uunet!husc6!uwvax!oddjob!uxc!uxc.cso.uiuc.edu!a.cs.uiuc.edu!m.cs.uiuc.edu!aslam From: aslam@m.cs.uiuc.edu Newsgroups: comp.sys.encore Subject: Re: Has NCAR package been ported? Message-ID: <37500003@m.cs.uiuc.edu> Date: 4 Aug 88 07:06:00 GMT References: <37500002@m.cs.uiuc.edu> Lines: 62 Nf-ID: #R:m.cs.uiuc.edu:37500002:m.cs.uiuc.edu:37500003:000:1969 Nf-From: m.cs.uiuc.edu!aslam Aug 4 02:06:00 1988 Well, I decided to dig in and find out what is causing problem with the NCAR graphics package. A number of routines take their default values from fortran blockdata. The files containing blockdata are compiled as other .f files and archived in .a libraries. For some reason, Fortran Blockdata doesn't work if loaded from a library. Could someone tell me if I need to do anything special? Here is an example of what I mean. Consider the following two tiny files: % % cat bd.f blockdata dummy common / A / ncp, mio data ncp, mio /10, 11/ end % % cat test.f c test whether block data works common/A/ ncp, mio print *, 'ncp =', ncp, ' mio = ', mio stop end First try compiling the files directly: % f77 -v test.f bd.f F77 release: 02.00.r051 test.f: /usr/lib/fcom test.f -X110 -X154 -X85 -X22 -X64 -X74 -X151 -X88 -X100 -X9 -X39 -X230 -X211 -Z54 -X183 -X80 -ga -X71 -X102 -X50 -X193 -X75 Fortran-32000 1.8.4 Copyright (C) 1983,1984,1985,1986,1987 Green Hills Software, Inc. All rights reserved. Release 2.0.r051 bd.f: /usr/lib/fcom bd.f -X110 -X154 -X85 -X22 -X64 -X74 -X151 -X88 -X100 -X9 -X39 -X230 -X211 -Z54 -X183 -X80 -ga -X71 -X102 -X50 -X193 -X75 Fortran-32000 1.8.4 Copyright (C) 1983,1984,1985,1986,1987 Green Hills Software, Inc. All rights reserved. Release 2.0.r051 /bin/ld /lib/crt0.o test.o bd.o -lF77 -lI77 -lU77 -ltermcap -lm -lc % % a.out ncp = 10 mio = 11 *** This is correct *** Put the blockdata containing file into a library and then use it. % ar rv bdlib.a bd.o a - bd.o ar: creating bdlib.a % ranlib bdlib.a % f77 test.o bdlib.a % a.out ncp = 0 mio = 0 *** What!!! *** % Is there something I need to specifiy on the f77 or the `ar' command to get to the block data and have it initialize the common area? Sohail Aslam Department of Computer Science University of Illinois arpa aslam@cs.uiuc.edu usenet uiucdcs!aslam bitnet aslam@uiucdcs.BITNET