[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 970421: Compiling and linking under MSDOS
- Subject: Re: 970421: Compiling and linking under MSDOS
- Date: Mon, 21 Apr 1997 12:15:34 -0600
> Subject: 970421: Compiling and linking under MSDOS
> >To: NetCDF Support <address@hidden>
> >From: Mike Lucas <"address@hidden"@erols.com>
> >Subject: Compiling and linking under MSDOS
> >Organization: Wyle Laboratories
> >Keywords: 199704211541.JAA00258
Michael:
As I mentioned on the phone, I'm going to recommend you use netcdf-3 even
though it is not fully released yet. (It likes this is what you have been
trying to use.) We have not fully integrated the fortran portion of this, so
that part may take a couple of iterations. We don't have a Microsoft FORTRAN
compiler, so some of the experimentation will have to take place on your end.
I will try to keep your frustration to a minumum.
First a little background. The last full release of netcdf which was built
using
Microsoft compilers was 2.3.2 in June 1993. This used Microsoft C 6.0 and
Microsoft Fortran 5.1.
Later full releases were built using a version of the GNU compiler, and
a utility called f2c. These produced 32 bit objects.
The C library portion of netcdf-3 has been built using the Microsoft Visual C++
environment, version 4.1 (which is the current release). The netcdf-3.3a
release
has essentially the "old" netcdf-2 fortran subdirectory. Netcdf-3 has planned a
new fortran interface which is not yet available.
> Glen -
>
> I have made several unsuccesful attempts at compiling and linking my sample
FORTRAN program. Following is
> a summary of my efforts:
>
> 1.) Version 3.3a under /src/librc tried to compile with MSDEV C++ 4.0
compiler. No luck.
You need Tom Hondo's contributed modifications (which I see you already have).
The reason I didn't answer you last Friday was that Tom's site was unreachable
and I could not determine what work he had done already. I've copied
his stuff into our contrib directory to avoid this problem in the future.
ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/win32/netcdf-3.3a-win32dll.tar.gz
As you know, this contains prebuilt netcdf.dll and netcdf.lib in the
netcdf-3.3a/bin directory, plus a few changes made by the contributor
in src/libsrc. If you use his msvc42.mak, his netcdf.h (netcdf.h-msvc42) and
his ncconfig.h (ncconfig.h-msvc42), presumebly the C library will build.
> 2.) Version 3.3a under /src/FORTRAN/MSOFT32 tried to link and compile with
example program. No luck.
>
> Question. - I assume MSOFT32 means Microsoft FORTRAN 32 bit compiler. Is this
a fair assumption?
Frankly, I don't know the "lineage" of this. Neither it nor the dj32f2c
directory should have been included in netcdf-3.3a.
> Question. - Does the linking process require a JACKETS file. If so, why can
I not compile the Jackets
> program using MicroSoft C++ 4.0 compiler?
The module jackets.c provides fortran entry points to the netcdf library.
It is only required for fortran support. You can't compile the one in
netcdf-3.3a/src/fortran/msoft32 because it has not been upgraded to netcdf-3.
> Question. - Should I include NETCDF.LIB and XDR.LIB in the FORTRAN library
structure? If so, where do I
> find the appropriate version?
For fortran support, jackets.o must be in NETCDF.LIB and/or NETCDF.DLL
and you need to link in one of these when you link your fortran program.
Netcdf-3 elminates the need for XDR.LIB.
>
> 3.) Located on the net you have a a directory called MSDOS. I downloaded
these files and attempted to
> compile and link. I am assuming that the library and object files are for
MS-DOS 16 bit, so I copied the
> library NETCDF.LIB and XDR.LIB into MicroSoft FORTRAN version 5.1 library
directory. The link syntax I
> used follows
>
> ==> link example jackets,,,;
>
> The result gave 48 unresolved external errors traced to the jacket object
file. Sample unresolved
> external names are _nccreate, _ncclose, _ncerr, _ncabort and so on.
This directory is really old stuff I mentioned in above,
and probably should be deleted. For the moment, I've added notes to the README
and moved it to keep folks from getting confused.
> 4.) Repeat step 3 using the 32 bit FORTRAN. The link step produced a fatal
error LNK1181 which means
> the linker could not open the jackets file. Which is no surprise if Jackets
is 16 bit.
>
> 5.) Downloaded the WIN32 directory developed by Toshinobu Hondo.
Discovered > that this directory does not contain a Jackets object file. It
appears that
> I need a jackets file? Where do I get the appropriate
> version of Jackets for the WIN32 directory?
So, you have all everything you need.
The work that remains is coming up with a jackets.o.
At this point I'm assuming you have netcdf-3.3a, and have Mr. Hondo's
mods applied. You have netcdf.lib and netcdf.dll which lack jackets.o.
Since their is an msoft32 directory in what you have gotten,
let's use that as a working directory.
I'll send on some more info in a subsequent message.
-glenn