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

Re: 960526: NetCDF 2.4.2 for Linux 1.2.13



>Keywords: 199605260944.AA07015

Hi Boonlert,

> Is netCDF 2.4.2 available for the Linux platform?
> If possible, How to install?

I don't know about Linux 1.2.13, but the latest version of the netCDF
sources apparently work fine for Linux 1.3.95.  I've appended a note about
how to build it that we received from one of our users.

______________________________________________________________________________

Russ Rew                                           UCAR Unidata Program
address@hidden                              http://www.unidata.ucar.edu

To: address@hidden
cc: address@hidden
From: Richard van Hees <address@hidden>
Subject: Linux - netCDF 2.4.2

Hi,

Congratulations! I have just installed the netCDF-library (version
2.4.2) on my Linux-PC, and it compiled just out of the box. THANKS.

I wrote you in an earlier e-mail that I could install netcdf-2.3,
without any real problems, but this is the first time that I could
install everything by just editing CUSTOMIZE and type: "make", 
"make test" and "make install". In addition I have (for the first
time) Fortran support. 

My Linux-PC:  kernel 1.3.95
              gcc 2.7.2
              g++ 2.7.2
              g77 0.5.18          <-- important 0.5.16 doesn't work!
              libc-5.3.12
              libm-5.0.6
              libg++.so.27.1.4

My CUSTOMIZE file (without comment):
CC=gcc
CFLAGS='-m486 -O2 -fomit-frame-pointer -pipe'   <-- faster ???
CXX=g++
CXXFLAGS=-O -I/usr/include/g++                  <-- Note the include-directory
FC=g77
FFLAGS=-O
prefix=/usr/local
OS=linux

It is possible (at least with the GNU compilers) to create shared-libraries 
(not only on Linux-machines!) using the appended script.

Best regards

Richard van Hees

     /================================================================\
     |   Richard M. van Hees    |   e-mail : address@hidden   |
     |   p/a IMAU               |   phone  : +31 (0)30 2532291        | 
     |   Princetonplein  5      |   fax    : +31 (0)30 2543164        |
     |   NL-3584 CC Utrecht     |                                     |
     |   The Netherlands        |                                     |
     \================================================================/


#------------------ CUT HERE ------------------------------------------------
#!/bin/sh -x
#
# Date:    04-May-96
#
# Purpose: 1) make a shared netCDF library using the gcc compiler
#          2) recompile ncdump and ncgen with the shared library
#
# Use:     Compile the netCDF software
#          I have used: - CC=gcc              (v2.7.2)
#                       - CFLAGS='-O2 -m486 -fomit-frame-pointer -pipe'
#                       - CXX=g++             (libg++.so.27.1.4)
#                       - CXXFLAGS=-O -I/usr/include/g++
#                       - FC=g77              (v0.5.18)
#                       - FCFLAGS=-O
#                       - OS=linux
#          Type "make_shared"
#          Install ncdump and ncgen by hand otherwise they are recompiled
#          which the static library!
#
# Note:    only tested on a Linux-PC, gcc 2.7.2, ELF
#          I haven't tried to get FORTRAN-support into the shared library, 
#          because I am not specially interested in FORTRAN 77.
#
# Author:  R.M. van Hees
#          email: address@hidden
# 
MAJOR_VERSION="2"
MINOR_VERSION=".4"
PATCH_VERSION=".2"

SH_NAME="libnetcdf.so"
SH_LIB="${SH_NAME}.${MAJOR_VERSION}${MINOR_VERSION}${PATCH_VERSION}"
SH_BUILD="-shared -Wl,-soname,${SH_NAME}.${MAJOR_VERSION}"
SH_OBJ='array.o attr.o cdf.o dim.o file.o iarray.o error.o globdef.o putget.o 
putgetg.o sharray.o string.o var.o xdrposix.o'

cd libsrc
rm ${SH_OBJ}
make CFLAGS='-O2 -m486 -fPIC -fomit-frame-pointer -pipe'
gcc ${SH_BUILD} -o ${SH_LIB} ${SH_OBJ}
ln -sf ${SH_LIB} ${SH_NAME}.${MAJOR_VERSION}
ln -sf ${SH_NAME}.${MAJOR_VERSION} ${SH_NAME}
cd ..

cd ncdump
rm ncdump
gcc -o ncdump ncdump.o vardata.o dumplib.o -L../libsrc -lnetcdf
strip ncdump
cd ..

cd ncgen
rm ncgen
gcc -o ncgen main.o load.o ncgentab.o escapes.o getfill.o init.o close.o 
genlib.o -L../libsrc -lnetcdf
strip ncgen
cd ..


------- End of Forwarded Message