Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: xlf and netcdf



Try this installer script named "macosx-xlf.sh":

#!/bin/sh
#################################################################
# This UNIX script builds the NetCDF (network Common Data Form) #
# library -- a machine-independent format for the creation,     #
# access, and sharing of scientific data -- under Mac OS X.     #
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
# http://my.unidata.ucar.edu/content/software/netcdf/index.html #
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
# Notes:                                                        #
#    1. Make this script executable:  "chmod +x macosx-xlf.sh"  #
#    2. Build as root:  "sudo ./macosx-xlf.sh"                  #
#    3. Tested on:  Mac OS X Panther 10.3.6,                    #
#       IBM xlf Fortran compilers,                              #
#       GCC version 3.3 C/C++ compilers                         #
#    4. Last modified:  Dec. 8, 2004                            #
#################################################################

#####################################
# Set trap to allow abort on signal #
#####################################
trap 'echo "Ouch. Dude! Ya fragged me." 1>&2; exit' 1 2 3 15

########################
# Specify source name: #
########################
export SOURCE="netcdf-3.6.0"

########################################
# Specify top-level install directory: #
########################################
export NETCDFHOME="/usr/local/netcdf"	# Change?
if test ! -d ${NETCDFHOME}; then
	mkdir -p ${NETCDFHOME}
fi

###################################
# Specify location for man pages: #
###################################
export MANPAGES="/usr/share/man"	# Change?
# export MANPAGES=${NETCDFHOME}/man

if test ! -d ${MANPAGES}; then
	mkdir -p ${MANPAGES}
fi
n=1
while [ $n -le 9 ]
do
	if test ! -d ${MANPAGES}/man$n; then
		mkdir -p ${MANPAGES}/man$n
	fi
	if test ! -d ${MANPAGES}/cat$n; then
		mkdir -p ${MANPAGES}/cat$n
	fi
	n=`expr $n + 1`
done

#############
# Greetings #
#############
echo "============================="
echo "NetCDF installer for Mac OS X"
echo "============================="
echo "USAGE: sudo ./macosx-xlf.sh"

##################
# Rock 'n' roll! #
##################
echo "---------------------------------------------"
echo "1. Downloading NetCDF source from the Unidata"
echo " Program Center in Boulder, Colorado ... "
echo "---------------------------------------------"
curl ftp://ftp.unidata.ucar.edu/pub/netcdf/${SOURCE}.tar.gz -o ${SOURCE}.tar.gz
echo "... done."


echo "----------------------------------"
echo "2. Uncompressing NetCDF source ..."
echo "----------------------------------"
gnutar -xzvf ${SOURCE}.tar.gz
echo "... done."

echo "----------------------------------"
echo "3. Configuring the environment ..."
echo "----------------------------------"
export MAKE=/usr/bin/gnumake # gnumake supports "include" syntax in makefiles


export CC=/usr/bin/cc
export CPPFLAGS="-O -DNDEBUG -DIBMR2Fortran"
export CFLAGS="-O"
export CXX=/usr/bin/c++
export CXXFLAGS="-O"

export FC=xlf
export F77=xlf
export F90=xlf90
export FFLAGS="-O5 -qtune=auto -qarch=auto -qhot -qinitauto -qsave"
export F90FLAGS=-qsuffix=f=f90:cpp=F90

cd $SOURCE/src/
./configure --prefix=$NETCDFHOME

echo "... done.  See config.log file for details."

echo "---------------------------------------------"
echo "4. Preparing Makefile for building NetCDF ..."
echo "---------------------------------------------"
mv macros.make macros.orig
sed 's/$(prefix)\/man/$(MANPAGES)/' macros.orig > macros.make
echo "... done."

echo "----------------------"
echo "5. Building NetCDF ..."
echo "----------------------"
make
echo "... done."

echo "---------------------"
echo "6. Testing NetCDF ..."
echo "---------------------"
make test
echo "... done."

echo "------------------------"
echo "7. Installing NetCDF ..."
echo "------------------------"
make install
echo "... done."

echo "------------------"
echo "8. Cleaning up ..."
echo "------------------"
make clean
cd ..
echo "... All done!"

exit

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Fortran-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/fortran-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.