Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Shared library for Version 2.3 netCDF on AIX 3.2

The following script will convert a "libnetcdf.a" to a shared library
on AIX (ibm rs6000) 3.2 system.  After converting and installing the
library where you want it, you should recompile (or just relink)
ncdump and ncgen so that they will be smaller and use this library.
The install procedure will overwrite the shared library with a 
re-archived version so don't "make install" after modifying the
library to be shareable.  We assume that this is run in a directory
with the file "libnetcdf.a" in it.  After it is run, you will have
the file "libnetcdf_shr.a" in it as well.

-------
#! /bin/sh
# Make a shareable netcdf
mkdir tmp
cd tmp
echo -n 'extracting from libnetcdf.a '
ar x ../libnetcdf.a
echo ' done.'
echo 'getting exports lists'
for x in *.o
do
        /usr/ucb/nm -p $x
done | awk '(NF==3 && $2=="D") {print $3}' | grep -v '^#' > exports
echo 'linking shareable portion'
ld -o shr.o *.o -bloadmap:shr.map -bh:4 -H512 -T512 -bM:SRE -bE:exports -lX11 -l
xlf -lm -lc 2>&1
echo 'packaging shareable library'
ar cr ../libnetcdf_shr.a shr.o
cd ..
echo 'cleaning up'
rm -rf tmp

-------


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690