[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 20000711: netCDF on 64-bits machine



>To: <address@hidden>
>From: "Mats Bentsen" <address@hidden>
>Subject: netCDF on 64-bits machine
>Organization: Nansen Environmental and Remote Sensing Center
>Keywords: 200007111506.e6BF6XT25114

Hi Mats,

> I installed the netCDF version 3.4 on my system and everything went
> smoothly. I'm working on a Cray Origin 2000 machine with IRIX 6.5 operating
> system. When I want to link the netCDF library into my 64-bit application I
> get the error message that the library is 32-bit. It is no problem to link
> the library if I specify 32-bit compilation and linking but want to be able
> to make use of the 64-bit architecture. I tried to edit the 'macros.make'
> file to compile and link the package as 64-bit but the 'make test' failed
> for tests with 'long' integers. Everything else looked OK. Do you have any
> suggestions?

You can compile a 64-bit version of the netCDF library for IRIX by
specifying the right compilation environment (through environment
variables CFLAGS, FFLAGS, and CXXFLAGS) before running the "configure"
script, rather than by trying to edit the "macros.make" file.  How you
set the environment variables depends on what shell you are using.  If
you need help with that, see the section on setting environment
variables for different shells in

  http://www.unidata.ucar.edu/packages/netcdf/INSTALL

An example of specifying a compilation environment that creates 64-bit
libraries (using sh or ksh) is:

    export CC=/bin/cc
    export CPPFLAGS=-DNDEBUG
    export CFLAGS='-O -64'
    export FC=/bin/f90
    export FFLAGS='-O -64'
    export CXX='/bin/CC -64'
    export CXXFLAGS=-64

Before running the "configure" script, you should delete the file
"config.cache".  You may want to set the --prefix option to configure
to tell it where things should be installed.  After running
"configure", just run "make all test install".

This may result in harmless warnings like the following:

    "load.c", line 187: warning(1178): argument is incompatible with ...
    "ncgen.y", line 1127: warning(1172): subscript out of range

Note that there is no particular advantage to using -64 for the netCDF
library over the default "-n32", since the on disk representation of
integers, 'sizes', and file offsets is 32 bits. Using -64 introduces
an additional conversion in the netCDF library for these types. Of
course, if you have a program which needs -64 for other reasons, there
is no harm in using a version of the netCDF library which was
configured and built using -64.

--Russ