This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
>Organization: University of Oklahoma >Keywords: 199412231532.AA15319 netCDF CRAY Unicos m4 Hi Adwait, > > > I was trying to link libnetcdf.a with my fortran source when I > > > got some errors. A little digging turned up that that Fortran to C calling > > > library had not been compiled properly. I tried stepping through the code > > > but I could not find the source of the error. I am sending you part of > > > the > > > make.log which shows the error Please let me know how I can fix it. > > > Thanks, > > > > ... > > > ./fortc -L . -O unicos common.inc > netcdf.inc > > > ./fortc -L . -O unicos jackets.src > jackets.c > > > > > > m4:-:529 can't open file > > > > This worked fine on our tests in building under UNICOS. > > > > To diagnose this problem, I will need a little more information. First, > > what version of UNICOS are you using, and which version of "m4" are you > > using. To get this information, it may suffice to run the following two > > commands: > > > > % uname -a > > % which m4 > > > > The diagnostic above is emitted by the m4 macroprocessor, invoked from the > > shell script netcdf/fortran/fortc. In the netcdf/fortran directory, please > > run the following commands and mail me back the output produced in files > > "tmp1" and "tmp2". > > > > % sed -f fortc1.sed jackets.src > tmp1 > > % m4 common.m4 unicos.m4 tmp1 > tmp2 > > > > Russ, > > This is what I got... > > mario% uname -a > mario mario 8.0.2 mor.130 CRAY C90 > mario% which m4 > /usr/bin/m4 > mario% sed -f fortc1.sed jackets.src > tmp1 > mario% m4 common.m4 unicos.m4 tmp1 > tmp2 > > m4:tmp1:529 can't open file > divert(1) > > tmp1 is quite big, so I will send it to you in another message. This is apparently a bug in the /usr/bin/m4 utility on your Cray, since I just tried m4 common.m4 unicos.m4 tmp1 > tmp2 with the version of the `tmp1' file you sent and two other versions of m4, and they both ran to completion with no errors, producing the expected output in `tmp2'. Here are three possible alternative workarounds: 1. You could run the following command from the netcdf/fortran/ directory on a different UNIX platform than UNICOS to produce the `jackets.c' file that is needed to complete the building of the Fortran netCDF interface for UNICOS: % m4 common.m4 unicos.m4 tmp1 | sed -f fortc2.sed > jackets.c Then copy the resulting `jackets.c' file to your UNICOS netcdf/fortran/ directory and proceed with the "make all test" from the top-level netcdf/ directory, which should now not try to use m4 to generate the jackets.c, since it has a later modification time than the sources from which it is derived. or 2. I could send you the `jackets.c' file that results from my running the above command here. I'm not positive such a large file will make it through the mail successfully to your mailbox, but the tmp1 file you sent made it here OK. Please let me know if you would prefer to try this. or 3. Build the GNU m4 on UNICOS and use that. It is available from ftp://prep.ai.mit.edu/pub/gnu/m4-1.4.tar.gz. Before the next release, we'll verify that the distribution builds OK on the current version of UNICOS, providing some other workaround if necessary. ______________________________________________________________________________ Russ Rew UCAR Unidata Program address@hidden P.O. Box 3000 http://www.unidata.ucar.edu/ Boulder, CO 80307-3000 ______________________________________________________________________________