#!/bin/sh # # This script builds and install all the optional and non-optional # external software packages needed for NCL. # # You will need to read through the notes below, to: # # - set environment variables for your compilers and options, # - indicate which packages you want to install, # - edit some files by hand before you run this script. # # Software packages to install: # # NCL/NCARG: # zlib-x.y.z NCL: required # NCARG: optional (needed for PNG, HDF4, # classic NetCDF-4) # # jpeg-xx NCL: required # NCARG: optional (needed for HDF4) # Note: jpeg-7 is being warned against by HDF4 folks # # libpng-x.y.z NCL: optional (needed for GRIB2 or PNG support) # NCARG: optional (needed for PNG) # # HDF-x.y.z NCL: required # NCARG: optional # # pkg-config-x.y NCL/NCARG: optional (needed for cairo support) # expat-x.y.z NCL/NCARG: optional (needed for cairo support) # freetype-x.y.z NCL/NCARG: optional (needed for cairo support) # fontconfig-x.y.z NCL/NCARG: optional (needed for cairo support) # pixman-x.y.z NCL/NCARG: optional (needed for cairo support) # cairo-x.y.z NCL/NCARG: optional (needed for cairo support) # # Note on cairo above: We've had problems with cairo-1.12.x (NCL-1860 # and NCL-1862), so we've decided to stick with cairo-1.10.2 for # V6.2.x. Also, Rick recommends using the system fontconfig to avoid # some quirky problems with that and the high-res map database (NCL-1210). # # NCL only: # hdf5-x.y.z Required if you want classic NetCDF-4 support # szip-x.y.z Required if you want classic NetCDF-4 support # curl-x.y.z Required if you want OPeNDAP support in NetCDF # jasper-x.y.z Required if you want GRIB2 support # g2clib-x.y.z Required if you want GRIB2 support # gdal-x.y.z Required if you want GDAL support # netcdf-x.y.z Required (classic NetCDF-4 support is optional) # proj-x.y.z Required if you want GDAL support # udunits-x.y.z Required if you want ut_calendar/ut_inv_calendar # hdfeos-x.y.z Required if you want HDF-EOS 2 support # hdfeos5-x.y.z Required if you want HDF-EOS 5 support # vis5d+-x.y.z Required if you want v5d* functions # esmf-x.y.z Required if you want ESMF regridding # #---------------------------------------------------------------------- # PREFIX is the parent location for installing external software. # # PREFIX_NODAP is the parent location for installing a version # of NetCDF that is not opendap-enabled. This is done because # the OPeNDAP version can have a lot of dependencies that make it # hard for a user who doesn't have the correct shared libraries on # their system. If you don't want to build the non-opendap version # of NetCDF (and ESMF), then set BUILD_NON_OPENDAP to 0. # PREFIX=/usr/local NCARG_ROOT=/usr/local PREFIX_NODAP=$PREFIX/nodap BUILD_NON_OPENDAP=1 # Get system information dd=`date +'%m%d%y'` un=`uname -n` um=`uname -m` os=`uname -s` # Get MacOS version if [ "$os" = "Darwin" ] ; then os_version=`sw_vers -productVersion` fi # Set environment variables for building software, depending on system. if [ "$os" = "Darwin" ] ; then export CC=/usr/local/bin/gcc export CXX=/usr/local/bin/g++ export FC=/usr/local/bin/gfortran export F77=/usr/local/bin/gfortran export F90=/usr/local/bin/gfortran elif [ "$un" = "yellowstone_gnu472" ] ; then export CC=/glade/u/apps/opt/gnu/4.7.2/bin/gcc export CXX=/glade/u/apps/opt/gnu/4.7.2/bin/g++ export FC=/glade/u/apps/opt/gnu/4.7.2/bin/gfortran export F77=/glade/u/apps/opt/gnu/4.7.2/bin/gfortran export F90=/glade/u/apps/opt/gnu/4.7.2/bin/gfortran elif [ "$un" = "yellowstone_gnu447" ] ; then export CC=/usr/bin/gcc export CXX=/usr/bin/g++ export FC=/usr/bin/gfortran export F77=/usr/bin/gfortran export F90=/usr/bin/gfortran elif [ "$un" = "yellowstone_intel1215" ] ; then export CC=icc export CXX=icpc export FC=ifort export F77=ifort export F90=ifort export CFLAGS= export FFLAGS= export F90FLAGS= export CXXFLAGS= else export CC=gcc export CXX=g++ export FC=gfortran export F77=gfortran export F90=gfortran fi if [ "$os" = "Darwin" ] ; then export CFLAGS='-fPIC -m64 -Df2cFortran' export FFLAGS='-m64 -fPIC' export F90FLAGS='-m64 -fPIC' export CXXFLAGS='-m64 -fPIC' else export CFLAGS=-fPIC export FFLAGS=-fPIC export F90FLAGS=-fPIC export CXXFLAGS=-fPIC fi if [ "$os" = "Linux" ] ; then if [ "$um" = "x86_64" ] ; then export LINUX_BRAND linux64 else export LINUX_BRAND linux32 fi fi echo "==================================================" echo "un is '$un'" echo "os is '$os'" echo "um is '$um'" echo "CC is $CC" echo "FC is $FC" echo "==================================================" #-------------------------------------------------------------------- # External software directories, sorted alphabetically #-------------------------------------------------------------------- CAIRO_DIR="cairo-1.12.18" CURL_DIR="curl-7.40.0" ESMF_DIR="esmf-6.3.0rp1" EXPAT_DIR="expat-2.1.0" FREETYPE_DIR="freetype-2.5.5" G2CLIB_DIR="g2clib-1.5.0-patch" GDAL_DIR="gdal-1.11.2" HDF4_DIR="hdf-4.2.11" HDF5_DIR="hdf5-1.8.14" HDFEOS_DIR="hdfeos-2.19" HDFEOS5_DIR="hdfeos5-1.15" JASPER_DIR="jasper-1.900.1" JPEG_DIR="jpeg-6b" NETCDF4_DIR="netcdf-4.3.3.1" NETCDF4_FORTRAN_DIR="netcdf-fortran-4.4.2" PIXMAN_DIR="pixman-0.32.6" PKGCONFIG_DIR="pkg-config-0.28" PNG_DIR="libpng-1.2.52" PROJ4_DIR="proj-4.8.0" SZIP_DIR="szip-2.1" UDUNITS_DIR="udunits-2.2.18" VIS5DPLUS_DIR="vis5d+-1.3.0-beta" ZLIB_DIR="zlib-1.2.8" #FONTCONFIG_DIR="fontconfig-2.10.93" # Indicate which packages you want. These are listed in the order # they should generally be built in. INSTALL_PKGCONFIG=1 INSTALL_ZLIB=1 INSTALL_PNG=1 INSTALL_JPEG=1 INSTALL_JASPER=1 INSTALL_SZIP=1 INSTALL_CURL=1 INSTALL_HDF5=1 INSTALL_HDFEOS5=1 INSTALL_HDF4=1 INSTALL_HDFEOS=1 INSTALL_NETCDF4=1 INSTALL_NETCDF4_FORTRAN=1 INSTALL_PROJ4=1 INSTALL_GDAL=1 INSTALL_G2CLIB=1 INSTALL_UDUNITS=1 INSTALL_EXPAT=1 INSTALL_FREETYPE=1 INSTALL_PIXMAN=1 INSTALL_CAIRO=1 INSTALL_ESMF=1 # These are ones we probably don't want to do any more #INSTALL_VIS5DPLUS=1 #INSTALL_FONTCONFIG=1 # Needed for cairo stuff. export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" export PATH="$PREFIX/bin:$PATH" # This setting for CPPFLAGS may be needed for some systems (Linux 32-bit # was one). Only set it if the large file stuff doesn't work with NetCDF4. # export CPPFLAGS='-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE'. CLEAN_BEFORE=1 # Whether to clean before making #CLEAN_AFTER=1 # Whether to clean after making #---------------------------------------------------------------------- # End of user modification section. #---------------------------------------------------------------------- if [ $BUILD_NON_OPENDAP ] ; then if [ ! -d "$PREFIX_NODAP" ] ; then mkdir $PREFIX_NODAP fi fi if [ ! -d "$PREFIX/lib" ] ; then mkdir $PREFIX/lib fi if [ ! -d "$PREFIX/include" ] ; then mkdir $PREFIX/include fi if [ ! -d "$PREFIX/bin" ] ; then mkdir $PREFIX/bin fi if [ ! -d "$PREFIX/man" ] ; then mkdir $PREFIX/man fi if [ ! -d "$PREFIX/man/man1" ] ; then mkdir $PREFIX/man/man1 fi if [ $INSTALL_PKGCONFIG ] && [ ! -d $PKGCONFIG_DIR ] ; then echo "$PKGCONFIG_DIR does not exist" exit fi if [ $INSTALL_ZLIB ] && [ ! -d $ZLIB_DIR ] ; then echo "$ZLIB_DIR does not exist" exit fi if [ $INSTALL_PNG ] && [ ! -d $PNG_DIR ] ; then echo "$PNG_DIR does not exist" exit fi if [ $INSTALL_JPEG ] && [ ! -d $JPEG_DIR ] ; then echo "$JPEG_DIR does not exist" exit fi if [ $INSTALL_JASPER ] && [ ! -d $JASPER_DIR ] ; then echo "$JASPER_DIR does not exist" exit fi if [ $INSTALL_SZIP ] && [ ! -d $SZIP_DIR ] ; then echo "$SZIP_DIR does not exist" exit fi if [ $INSTALL_CURL ] && [ ! -d $CURL_DIR ] ; then echo "$CURL_DIR does not exist" exit fi if [ $INSTALL_HDF5 ] && [ ! -d $HDF5_DIR ] ; then echo "$HDF5_DIR does not exist" exit fi if [ $INSTALL_HDFEOS5 ] && [ ! -d $HDFEOS5_DIR ] ; then echo "$HDFEOS5_DIR does not exist" exit fi if [ $INSTALL_HDF4 ] && [ ! -d $HDF4_DIR ] ; then echo "$HDF4_DIR does not exist" exit fi if [ $INSTALL_HDFEOS ] && [ ! -d $HDFEOS_DIR ] ; then echo "$HDFEOS_DIR does not exist" exit fi if [ $INSTALL_NETCDF4 ] && [ ! -d $NETCDF4_DIR ] ; then echo "$NETCDF4_DIR does not exist" exit fi if [ $INSTALL_NETCDF4_FORTRAN ] && [ ! -d $NETCDF4_FORTRAN_DIR ] ; then echo "$NETCDF4_FORTRAN_DIR does not exist" exit fi if [ $INSTALL_PROJ4 ] && [ ! -d $PROJ4_DIR ] ; then echo "$PROJ4_DIR does not exist" exit fi if [ $INSTALL_GDAL ] && [ ! -d $GDAL_DIR ] ; then echo "$GDAL_DIR does not exist" exit fi if [ $INSTALL_G2CLIB ] && [ ! -d $G2CLIB_DIR ] ; then echo "$G2CLIB_DIR does not exist" exit fi if [ $INSTALL_UDUNITS ] && [ ! -d $UDUNITS_DIR ] ; then echo "$UDUNITS_DIR does not exist" exit fi if [ $INSTALL_VIS5DPLUS ] && [ ! -d $VIS5DPLUS_DIR ] ; then echo "$VIS5DPLUS_DIR does not exist" exit fi if [ $INSTALL_EXPAT ] && [ ! -d $EXPAT_DIR ] ; then echo "$EXPAT_DIR does not exist" exit fi if [ $INSTALL_FREETYPE ] && [ ! -d $FREETYPE_DIR ] ; then echo "$FREETYPE_DIR does not exist" exit fi if [ $INSTALL_FONTCONFIG ] && [ ! -d $FONTCONFIG_DIR ] ; then echo "$FONTCONFIG_DIR does not exist" exit fi if [ $INSTALL_PIXMAN ] && [ ! -d $PIXMAN_DIR ] ; then echo "$PIXMAN_DIR does not exist" exit fi if [ $INSTALL_CAIRO ] && [ ! -d $CAIRO_DIR ] ; then echo "$CAIRO_DIR does not exist" exit fi if [ $INSTALL_ESMF ] && [ ! -d $ESMF_DIR ] ; then echo "$ESMF_DIR does not exist" exit fi # # The following section should not need any modification by # the user, unless there is a problem in the script. # #-------------------------------------------------------------------- # pkg-config #-------------------------------------------------------------------- if [ $INSTALL_PKGCONFIG ] ; then if [ -d "$PKGCONFIG_DIR" ] ; then cd $PKGCONFIG_DIR if [ $CLEAN_BEFORE ] ; then echo "Cleaning $PKGCONFIG_DIR before making..." make distclean make clean fi echo "Building $PKGCONFIG_DIR..." ./configure --prefix\=$PREFIX make all install if [ $? ] ; then echo "$PKGCONFIG_DIR build successful." export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" export PATH="$PREFIX/bin:$PATH" if [ $CLEAN_AFTER ] ; then echo "Cleaning $PKGCONFIG_DIR after making..." make distclean make clean fi else echo "$PKGCONFIG_DIR build NOT successful." fi cd .. else echo "Directory $PKGCONFIG_DIR doesn't exist" fi else echo "Not building pkgconfig..." fi #-------------------------------------------------------------------- # zlib #-------------------------------------------------------------------- if [ $INSTALL_ZLIB ] ; then if [ -d "$ZLIB_DIR" ] ; then cd $ZLIB_DIR if [ $CLEAN_BEFORE ] ; then echo "Cleaning $ZLIB_DIR before making..." make distclean make clean fi echo "Building $ZLIB_DIR..." ./configure --prefix\=$PREFIX --static make all install if [ $? ] ; then echo "$ZLIB_DIR build successful." if [ $CLEAN_AFTER ] ; then echo "Cleaning $ZLIB_DIR after making..." make distclean make clean fi else echo "$ZLIB_DIR build NOT successful." fi cd .. else echo "Directory $ZLIB_DIR doesn't exist" fi else echo "Not building zlib..." fi #-------------------------------------------------------------------- # png #-------------------------------------------------------------------- if [ $INSTALL_PNG ] ; then if [ -d "$PNG_DIR" ] ; then cd $PNG_DIR if [ $CLEAN_BEFORE ] ; then echo "Cleaning $PNG_DIR before making..." make distclean make clean fi cp $PREFIX/include/zlib.h . cp $PREFIX/include/zconf.h . export LIBS="-L$PREFIX/lib" echo "Building $PNG_DIR..." ./configure --with-pic --disable-shared --prefix\=$PREFIX make all install unset LIBS if [ $? ] ; then echo "$PNG_DIR build successful." if [ $CLEAN_AFTER ] ; then echo "Cleaning $PNG_DIR after making..." make distclean make clean fi else echo "$PNG_DIR build NOT successful." fi cd .. else echo "Directory $PNG_DIR doesn't exist" fi else echo "Not building png..." fi #-------------------------------------------------------------------- # jpeg #-------------------------------------------------------------------- if [ $INSTALL_JPEG ] ; then if [ -d "$JPEG_DIR" ] ; then cd $JPEG_DIR if [ $CLEAN_BEFORE ] ; then echo "Cleaning $JPEG_DIR before making..." make distclean make clean fi echo "Building $JPEG_DIR..." ./configure --disable-shared --prefix\=$PREFIX make all install # Need this for jpeg-6b make install-lib make install-headers if [ $? ] ; then echo "$JPEG_DIR build successful." if [ $CLEAN_AFTER ] ; then echo "Cleaning $JPEG_DIR after making..." make distclean make clean fi else echo "$JPEG_DIR build NOT successful." fi cd .. else echo "Directory $JPEG_DIR doesn't exist" fi else echo "Not building jpeg..." fi #-------------------------------------------------------------------- # Jasper #-------------------------------------------------------------------- if [ $INSTALL_JASPER ] ; then if [ -d "$JASPER_DIR" ] ; then cd $JASPER_DIR if [ $CLEAN_BEFORE ] ; then echo "Cleaning $JASPER_DIR before making..." make distclean make clean fi echo "Building $JASPER_DIR..." # Need --includedir to point to jpeg include files. ./configure --prefix\=$PREFIX --includedir\=$PREFIX/include make all install if [ $? ] ; then echo "$JASPER_DIR build successful." if [ $CLEAN_AFTER ] ; then echo "Cleaning $JASPER_DIR after making..." make distclean make clean fi else echo "$JASPER_DIR build NOT successful." fi cd .. else echo "Directory $JASPER_DIR doesn't exist" fi else echo "Not building Jasper..." fi #-------------------------------------------------------------------- # szip #-------------------------------------------------------------------- if [ $INSTALL_SZIP ] ; then if [ -d "$SZIP_DIR" ] ; then cd $SZIP_DIR if [ $CLEAN_BEFORE ] ; then echo "Cleaning $SZIP_DIR before making..." make distclean make clean fi echo "Building $SZIP_DIR..." ./configure --disable-shared --prefix\=$PREFIX make all install if [ $? ] ; then echo "$SZIP_DIR build successful." if [ $CLEAN_AFTER ] ; then echo "Cleaning $SZIP_DIR after making..." make distclean make clean fi else echo "$SZIP_DIR build NOT successful." fi cd .. else echo "Directory $SZIP_DIR doesn't exist" fi else echo "Not building szip..." fi #-------------------------------------------------------------------- # libcurl (needed for opendap-enabled netcdf) and may be picked up # by other packages like GDAL and cairo. #-------------------------------------------------------------------- if [ $INSTALL_CURL ] ; then if [ -d "$CURL_DIR" ] ; then cd $CURL_DIR if [ $CLEAN_BEFORE ] ; then echo "Cleaning $CURL_DIR before making..." make distclean make clean fi echo "Building $CURL_DIR..." ./configure --prefix\=$PREFIX --with-zlib\=$PREFIX --with-pic --disable-shared make all install if [ $? ] ; then echo "$CURL_DIR build successful." if [ $CLEAN_AFTER ] ; then echo "Cleaning $CURL_DIR after making..." make distclean make clean fi else echo "$CURL_DIR build NOT successful." fi cd .. else echo "Directory $CURL_DIR doesn't exist" fi else echo "Not building libcurl..." fi #-------------------------------------------------------------------- # HDF-5 #-------------------------------------------------------------------- if [ $INSTALL_HDF5 ] ; then if [ -d "$HDF5_DIR" ] ; then cd $HDF5_DIR if [ $CLEAN_BEFORE ] ; then echo "Cleaning $HDF5_DIR before making..." make distclean make clean fi echo "Building $HDF5_DIR..." ./configure --disable-shared --with-zlib\=$PREFIX --with-szlib\=$PREFIX --prefix\=$PREFIX make all install if [ $? ] ; then echo "$HDF5_DIR build successful." if [ $CLEAN_AFTER ] ; then echo "Cleaning $HDF5_DIR after making..." make distclean make clean fi else echo "$HDF5_DIR build NOT successful." fi cd .. else echo "Directory $HDF5_DIR doesn't exist" fi else echo "Not building HDF5..." fi #-------------------------------------------------------------------- # HDF-EOS 5 #-------------------------------------------------------------------- if [ $INSTALL_HDFEOS5 ] ; then if [ -d "$HDFEOS5_DIR" ] ; then cd $HDFEOS5_DIR if [ $CLEAN_BEFORE ] ; then echo "Cleaning $HDFEOS5_DIR before making..." make distclean make clean fi echo "Building $HDFEOS5_DIR..." # Might need this on a Mac and other systems? # ./configure --enable-static --with-hdf\=$PREFIX --with-zlib\=$PREFIX --with-szlib\=$PREFIX --prefix\=$PREFIX # ./configure --with-hdf5\=$PREFIX CFLAGS\=$CFLAGS_HE5 --with-zlib\=$PREFIX --with-szlib\=$PREFIX --prefix\=$PREFIX # export CFLAGS_HE5="$CFLAGS -DH5_USE_16_API" ./configure CC\=$PREFIX/bin/h5cc --with-hdf5\=$PREFIX --with-zlib\=$PREFIX --with-szlib\=$PREFIX --prefix\=$PREFIX make all install /bin/rm -rf $PREFIX/include/HE5_HdfEosDef.h $PREFIX/include/HE5_GctpFunc.h cp include/HE5_HdfEosDef.h include/HE5_GctpFunc.h $PREFIX/include/. if [ $? ] ; then echo "$HDFEOS5_DIR build successful." if [ $CLEAN_AFTER ] ; then echo "Cleaning $HDFEOS5_DIR after making..." make distclean make clean fi else echo "$HDFEOS5_DIR build NOT successful." fi cd .. else echo "Directory $HDFEOS5_DIR doesn't exist" fi else echo "Not building HDFEOS5..." fi #-------------------------------------------------------------------- # HDF-4 #-------------------------------------------------------------------- if [ $INSTALL_HDF4 ] ; then if [ -d "$HDF4_DIR" ] ; then cd $HDF4_DIR if [ $CLEAN_BEFORE ] ; then echo "Cleaning $HDF4_DIR before making..." make distclean make clean fi echo "Building $HDF4_DIR..." if [ "$os" = "Darwin" ] ; then ./configure --disable-netcdf --disable-dependency-tracking --with-zlib\=$PREFIX --with-jpeg\=$PREFIX --prefix\=$PREFIX else ./configure --disable-netcdf --with-zlib\=$PREFIX --with-jpeg\=$PREFIX --prefix\=$PREFIX fi make all install if [ $? ] ; then echo "$HDF4_DIR build successful." if [ $CLEAN_AFTER ] ; then echo "Cleaning $HDF4_DIR after making..." make distclean make clean fi else echo "$HDF4_DIR build NOT successful." fi cd .. else echo "Directory $HDF4_DIR doesn't exist" fi else echo "Not building HDF4..." fi #-------------------------------------------------------------------- # HDF-EOS 2 #-------------------------------------------------------------------- if [ $INSTALL_HDFEOS ] ; then if [ -d "$HDFEOS_DIR" ] ; then cd $HDFEOS_DIR if [ $CLEAN_BEFORE ] ; then echo "Cleaning $HDFEOS_DIR before making..." make distclean make clean fi echo "Building $HDFEOS_DIR..." ./configure CC\=$PREFIX/bin/h4cc --with-hdf4\=$PREFIX --with-zlib\=$PREFIX --with-jpeg\=$PREFIX --prefix\=$PREFIX make all install /bin/rm -rf $PREFIX/include/HdfEosDef.h $PREFIX/include/ease.h $PREFIX/include/cfortHdf.h cp include/HdfEosDef.h include/ease.h include/cfortHdf.h $PREFIX/include/. if [ $? ] ; then echo "$HDFEOS_DIR build successful." if [ $CLEAN_AFTER ] ; then echo "Cleaning $HDFEOS_DIR after making..." make distclean make clean fi else echo "$HDFEOS_DIR build NOT successful." fi cd .. else echo "Directory $HDFEOS_DIR doesn't exist" fi else echo "Not building HDFEOS..." fi #-------------------------------------------------------------------- # NetCDF C interface (this section handles regular NetCDF or # classic NetCDF-4). This section makes the non-OPeNDAP version # first, then the OPeNDAP version #-------------------------------------------------------------------- if [ "$INSTALL_NETCDF4" ] then if [ -d "$NETCDF4_DIR" ] ; then cd $NETCDF4_DIR if [ $CLEAN_BEFORE ] ; then echo "Cleaning $NETCDF4_DIR before making..." make distclean make clean fi echo "Building $NETCDF4_DIR..." export LDFLAGS="-L$PREFIX/lib" export CPPFLAGS="-I$PREFIX/include" echo "Cleaning $NETCDF4_DIR to do non-OPeNDAP build" make distclean make clean if [ "$os" = "Darwin" ] ; then if [ $BUILD_NON_OPENDAP ] ; then export LIBS="-lhdf5_hl -lhdf5 -lsz -lz" ./configure --enable-netcdf-4 --disable-dap --disable-dispatch --disable-shared --prefix\=$PREFIX_NODAP make all install make distclean make clean fi echo "Cleaning $NETCDF4_DIR to do OPeNDAP build" if [ "$os_version" = "10.8.4" ] ; then export LIBS="-lhdf5_hl -lhdf5 -lcurl -lcrypto -lldap -lssl -lsz -lz -lquadmath" elif [ "$un" = "cisl-denton.local" ] || [ "$un" = "cisl-denton.scd.ucar.edu" ] || [ "$un" = "riley.local" ] || [ "$os_version" = "10.9.2" ] || [ "$os_version" = "10.9.4" ] || [ "$os_version" = "10.9.5" ]; then export LIBS="-lhdf5_hl -lhdf5 -lsz -lm -lz -lcurl -lssl -lcrypto -llber" else export LIBS="-lhdf5_hl -lhdf5 -lsz -lm -lz -lcurl -lcrypto -lldap -lssl" fi ./configure --enable-netcdf-4 --enable-dap --disable-dispatch --disable-shared --prefix\=$PREFIX --enable-large-file-tests --enable-dap-remote-tests make all install else if [ "$un" = "yellowstone_gnu472" ] || [ "$un" = "yellowstone_gnu447" ] || [ "$un" = "k9" ] ; then export LIBS="-lhdf5_hl -lhdf5 -lsz -lz -ldl" else export LIBS="-lhdf5_hl -lhdf5 -lsz -lz" fi if [ $BUILD_NON_OPENDAP ] ; then ./configure --enable-netcdf-4 --disable-dap --disable-shared --prefix\=$PREFIX_NODAP make all install mv config.log config.log.nodap make distclean make clean fi echo "Cleaning $NETCDF4_DIR to do OPeNDAP build" if [ "$un" = "k5" ] || [ "$un" = "k6" ] || [ "$un" = "k7" ] || [ "$un" = "k8" ] ; then export LIBS="-lhdf5_hl -lhdf5 -lsz -lm -lz -lcurl -lcrypto -lidn -lldap -lrt -lssl" elif [ "$un" = "k9" ] ; then export LIBS="-lhdf5_hl -lhdf5 -lsz -lm -lz -lcurl -lcrypto -lidn -lssl -lldap -lrt -lssh2 -lrtmp" elif [ "$un" = "logan.cgd.ucar.edu" ] ; then export LIBS="-lhdf5_hl -lhdf5 -lsz -lz -lrt -lcurl -lz -lidn -lrt -ldl" elif [ "$un" = "yellowstone_gnu472" ] || [ "$un" = "yellowstone_gnu447" ] ; then export LIBS="-lhdf5_hl -lhdf5 -lsz -lcurl -lidn -lssl -lcrypto -lz -lrt" elif [ "$un" = "yellowstone_intel1215" ] ; then export LIBS="-lhdf5_hl -lhdf5 -lsz -lz -lrt -lcurl -lssl -lidn -lrt -ldl" else export LIBS="-lhdf5_hl -lhdf5 -lsz -lz -lcurl -ldl" fi ./configure --enable-netcdf-4 --enable-dap --disable-shared --prefix\=$PREFIX --enable-large-file-tests --enable-dap-remote-tests make all install unset LIBS fi if [ $? ] ; then echo "$NETCDF4_DIR build successful." if [ $CLEAN_AFTER ] ; then echo "Cleaning $NETCDF4_DIR after making..." make distclean make clean fi else echo "$NETCDF4_DIR build NOT successful." fi cd .. else echo "Directory $NETCDF4_DIR doesn't exist" fi else echo "Not building NetCDF C interface..." fi #-------------------------------------------------------------------- # NetCDF-fortran (this is for the Fortran interface only, for ESMF) #-------------------------------------------------------------------- if [ "$INSTALL_NETCDF4_FORTRAN" ] then if [ -d "$NETCDF4_FORTRAN_DIR" ] ; then cd $NETCDF4_FORTRAN_DIR if [ $CLEAN_BEFORE ] ; then echo "Cleaning $NETCDF4_FORTRAN_DIR before making..." make distclean make clean fi echo "Building $NETCDF4_FORTRAN_DIR..." export CPPFLAGS="-I$PREFIX/include" export LDFLAGS="-L$PREFIX/lib" export LIBS="-lnetcdf -lhdf5_hl -lhdf5 -lz -lcurl -ldl" ./configure --disable-shared --prefix\=$PREFIX make all install if [ $? ] ; then echo "$NETCDF4_FORTRAN_DIR build successful." if [ $CLEAN_AFTER ] ; then echo "Cleaning $NETCDF4_FORTRAN_DIR after making..." make distclean make clean fi else echo "$NETCDF4_FORTRAN_DIR build NOT successful." fi cd .. else echo "Directory $NETCDF4_FORTRAN_DIR doesn't exist" fi else echo "Not building NetCDF Fortran interface..." fi #-------------------------------------------------------------------- # g2clib (GRIB2) # # For 64-bit systems, you need to edit the Makefile and add # -D__64BIT__ on the DEFS line #-------------------------------------------------------------------- if [ $INSTALL_G2CLIB ] ; then if [ -d "$G2CLIB_DIR" ] ; then export EXTRA_INC="-I$PREFIX/include" # # No clean check needed; this software is automatically # cleaned after each build. # echo "Building $G2CLIB_DIR..." cd $G2CLIB_DIR make all if [ $? ] ; then mv libgrib2c.a $PREFIX/lib cp grib2.h $PREFIX/include echo "$G2CLIB_DIR build successful." # # No clean check needed; this software is automatically # cleaned after each build. # else echo "$G2CLIB_DIR build NOT successful." fi cd .. else echo "Directory $G2CLIB_DIR doesn't exist" fi else echo "Not building G2CLIB..." fi #-------------------------------------------------------------------- # PROJ.4 #-------------------------------------------------------------------- if [ $INSTALL_PROJ4 ] ; then if [ -d "$PROJ4_DIR" ] ; then cd $PROJ4_DIR if [ $CLEAN_BEFORE ] ; then echo "Cleaning $PROJ4_DIR before making..." make distclean make clean fi echo "Building $PROJ4_DIR..." ./configure --enable-static=yes --enable-shared=no --without-jni --prefix\=$PREFIX make all install if [ $? ] ; then echo "$PROJ4_DIR build successful." if [ $CLEAN_AFTER ] ; then echo "Cleaning $PROJ4_DIR after making..." make distclean make clean fi else echo "$PROJ4_DIR build NOT successful." fi cd .. else echo "Directory $PROJ4_DIR doesn't exist" fi else echo "Not building PROJ4..." fi #-------------------------------------------------------------------- # GDAL #-------------------------------------------------------------------- if [ $INSTALL_GDAL ] ; then if [ -d "$GDAL_DIR" ] ; then cd $GDAL_DIR if [ $CLEAN_BEFORE ] ; then echo "Cleaning $GDAL_DIR before making..." make distclean make clean fi echo "Building $GDAL_DIR..." # Dave said you might also need --with-avx=no ./configure --with-static-proj4\=$PREFIX --prefix\=$PREFIX --without-pam --with-png\=$PREFIX --with-gif=internal --with-libtiff=internal --with-geotiff=internal --with-jpeg\=$PREFIX --with-libz\=$PREFIX --with-sqlite3=no --with-expat=no --with-curl=no --without-ld-shared --with-hdf4=no --with-hdf5=no --with-pg=no --without-grib --disable-shared --with-freexl=no --with-geos=no --with-openjpeg=no --with-mysql=no --with-ecw=no --with-fgdb=no --with-odbc=no --with-xml2=no --with-ogdi=no --with-pcraster=no make all install make install if [ $? ] ; then echo "$GDAL_DIR build successful." if [ $CLEAN_AFTER ] ; then echo "Cleaning $GDAL_DIR after making..." make distclean make clean fi else echo "$GDAL_DIR build NOT successful." fi cd .. else echo "Directory $GDAL_DIR doesn't exist" fi else echo "Not building GDAL..." fi #-------------------------------------------------------------------- # Udunits # NOT NEEDED B/C PART OF NETCDF-4.1 #-------------------------------------------------------------------- if [ $INSTALL_UDUNITS ] ; then if [ -d "$UDUNITS_DIR" ] ; then export PERL="" cd $UDUNITS_DIR if [ $CLEAN_BEFORE ] ; then echo "Cleaning $UDUNITS_DIR before making..." make distclean make clean fi echo "Building $UDUNITS_DIR..." ./configure --prefix\=$PREFIX --disable-shared make all install if [ $? ] ; then echo "$UDUNITS_DIR build successful." if [ $CLEAN_AFTER ] ; then echo "Cleaning $UDUNITS_DIR after making..." make distclean make clean fi else echo "$UDUNITS_DIR build NOT successful." fi cd .. else echo "Directory $UDUNITS_DIR doesn't exist" fi else echo "Not building UDUNITS..." fi #-------------------------------------------------------------------- # Vis5D+ #-------------------------------------------------------------------- if [ $INSTALL_VIS5DPLUS ] ; then if [ -d "$VIS5DPLUS_DIR" ] ; then cd $VIS5DPLUS_DIR if [ $CLEAN_BEFORE ] ; then echo "Cleaning $VIS5DPLUS_DIR before making..." make distclean make clean fi echo "Building $VIS5DPLUS_DIR..." ./configure --prefix\=$PREFIX --with-netcdf\=$PREFIX/lib/libnetcdf.a make all install if [ $? ] ; then echo "$VIS5DPLUS_DIR build successful." if [ $CLEAN_AFTER ] ; then echo "Cleaning $VIS5DPLUS_DIR after making..." make distclean make clean fi else echo "$VIS5DPLUS_DIR build NOT successful." fi cd .. else echo "Directory $VIS5DPLUS_DIR doesn't exist" fi else echo "Not building VIS5DPLUS..." fi #-------------------------------------------------------------------- # Expat #-------------------------------------------------------------------- if [ $INSTALL_EXPAT ] ; then if [ -d "$EXPAT_DIR" ] ; then cd $EXPAT_DIR if [ $CLEAN_BEFORE ] ; then echo "Cleaning $EXPAT_DIR before making..." make distclean make clean fi echo "Building $EXPAT_DIR..." ./configure --disable-shared --prefix\=$PREFIX make all install if [ $? ] ; then echo "$EXPAT_DIR build successful." if [ $CLEAN_AFTER ] ; then echo "Cleaning $EXPAT_DIR after making..." make distclean make clean fi else echo "$EXPAT_DIR build NOT successful." fi cd .. else echo "Directory $EXPAT_DIR doesn't exist" fi else echo "Not building expat..." fi #-------------------------------------------------------------------- # FreeType #-------------------------------------------------------------------- if [ $INSTALL_FREETYPE ] ; then if [ -d "$FREETYPE_DIR" ] ; then cd $FREETYPE_DIR if [ $CLEAN_BEFORE ] ; then echo "Cleaning $FREETYPE_DIR before making..." make distclean make clean fi echo "Building $FREETYPE_DIR..." ./configure --prefix\=$PREFIX --disable-shared make all install if [ $? ] ; then echo "$FREETYPE_DIR build successful." if [ $CLEAN_AFTER ] ; then echo "Cleaning $FREETYPE_DIR after making..." make distclean make clean fi else echo "$FREETYPE_DIR build NOT successful." fi cd .. else echo "Directory $FREETYPE_DIR doesn't exist" fi else echo "Not building FreeType..." fi #-------------------------------------------------------------------- # fontconfig #-------------------------------------------------------------------- if [ $INSTALL_FONTCONFIG ] ; then if [ -d "$FONTCONFIG_DIR" ] ; then cd $FONTCONFIG_DIR if [ $CLEAN_BEFORE ] ; then echo "Cleaning $FONTCONFIG_DIR before making..." make distclean make clean fi echo "Building $FONTCONFIG_DIR..." # You might need these two settings. export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" export PATH="$PREFIX/bin:$PATH" ./configure --prefix\=$PREFIX --disable-shared make all install if [ $? ] ; then echo "$FONTCONFIG_DIR build successful." if [ $CLEAN_AFTER ] ; then echo "Cleaning $FONTCONFIG_DIR after making..." make distclean make clean fi else echo "$FONTCONFIG_DIR build NOT successful." fi cd .. else echo "Directory $FONTCONFIG_DIR doesn't exist" fi else echo "Not building fontconfig..." fi #-------------------------------------------------------------------- # pixman #-------------------------------------------------------------------- if [ $INSTALL_PIXMAN ] ; then if [ -d "$PIXMAN_DIR" ] ; then cd $PIXMAN_DIR if [ $CLEAN_BEFORE ] ; then echo "Cleaning $PIXMAN_DIR before making..." make distclean make clean fi echo "Building $PIXMAN_DIR..." ./configure --prefix\=$PREFIX --disable-shared --disable-openmp --disable-arm-iwmmxt --disable-dependency-tracking make all install # Need this because some test fails with undefined "_lgc_seed" make install if [ $? ] ; then echo "$PIXMAN_DIR build successful." if [ $CLEAN_AFTER ] ; then echo "Cleaning $PIXMAN_DIR after making..." make distclean make clean fi else echo "$PIXMAN_DIR build NOT successful." fi cd .. else echo "Directory $PIXMAN_DIR doesn't exist" fi else echo "Not building pixman..." fi #-------------------------------------------------------------------- # cairo #-------------------------------------------------------------------- if [ $INSTALL_CAIRO ] ; then export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" if [ -d "$CAIRO_DIR" ] ; then cd $CAIRO_DIR if [ $CLEAN_BEFORE ] ; then echo "Cleaning $CAIRO_DIR before making..." make distclean make clean fi echo "Building $CAIRO_DIR..." # Needed the quartz disabled on GNU 4.1.2 system, so make it default for all systems? ./configure --prefix\=$PREFIX --enable-quartz-font=no --enable-quartz=no --enable-shared=no --enable-static=yes # Needed for k5? disable-gobject?? # ./configure --prefix\=$PREFIX --enable-quartz-font=no --enable-quartz=no --enable-shared=no --enable-static=yes --disable-gobject # if [ "$os" = "Darwin" ] ; then # ./configure --prefix\=$PREFIX --enable-quartz-font=no --enable-quartz=no --enable-shared=no --enable-static=yes # else # ./configure --prefix\=$PREFIX --disable-shared # fi make all install if [ $? ] ; then echo "$CAIRO_DIR build successful." if [ $CLEAN_AFTER ] ; then echo "Cleaning $CAIRO_DIR after making..." make distclean make clean fi else echo "$CAIRO_DIR build NOT successful." fi cd .. else echo "Directory $CAIRO_DIR doesn't exist" fi else echo "Not building cairo..." fi #-------------------------------------------------------------------- # Open SSL # Should not be needed because OPeNDAP now part of NetCDF-4.1 #-------------------------------------------------------------------- if [ $INSTALL_OPENSSL ] ; then if [ -d "$OPENSSL_DIR" ] ; then cd $OPENSSL_DIR if [ $CLEAN_BEFORE ] ; then echo "Cleaning $OPENSSL_DIR before making..." make distclean make clean fi echo "Building $OPENSSL_DIR..." ./configure --prefix\=$PREFIX make all install if [ $? ] ; then echo "$OPENSSL_DIR build successful." if [ $CLEAN_AFTER ] ; then echo "Cleaning $OPENSSL_DIR after making..." make distclean make clean fi else echo "$OPENSSL_DIR build NOT successful." fi cd .. else echo "Directory $OPENSSL_DIR doesn't exist" fi else echo "Not building Open SSL..." fi #-------------------------------------------------------------------- # ESMF (needed for ESMF regridding) # This section builds two versions of ESMF_RegridWeightGen: one # linked against OPenDAP-enabled libraries, and one not. # # The non-OPeNDAP version is built first. #-------------------------------------------------------------------- if [ $INSTALL_ESMF ] ; then if [ -d "$ESMF_DIR" ] ; then cd $ESMF_DIR # Do this before cleaning! export ESMF_DIR=`pwd` # # This group of env vars will need to be changed before OPeNDAP build. # # We have to get the non-OPeNDAP path on the load line first. The # only way to do this seems to be by setting the # ESMF_LAPACK_LIBPATH to the non-OPeNDAP NetCDF path, and setting # ESMF_NETCDF_LIBPATH to the LAPACK path. # # The order of -L paths seems to be: # -L$ESMF_LAPACK_LIBPATH -L$ESMF_NETCDF_LIBPATH ESMF_CXXLINKPATHS # if [ $BUILD_NON_OPENDAP ] ; then echo "Cleaning $ESMF_DIR before building non-OPeNDAP version..." export ESMF_INSTALL_PREFIX=$PREFIX_NODAP export ESMF_LAPACK_LIBPATH=$PREFIX_NODAP/lib export ESMF_CXXLINKPATHS="-L$NCARG_ROOT/lib" export ESMF_CXXCOMPILEPATHS="-I$PREFIX_NODAP/include" export ESMF_NETCDF_LIBS="-lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lsz -lz" make distclean make clean fi # The rest of the env vars should stay the same for both builds export ESMF_NETCDF_LIBPATH=$PREFIX/lib export ESMF_NETCDF_INCLUDE=$PREFIX/include export ESMF_LAPACK_LIBS="-llapack_ncl -lblas_ncl" export ESMF_F90LINKPATHS="-L$NCARG_ROOT/lib" export ESMF_NETCDF="split" export ESMF_LAPACK="netlib" export ESMF_COMM=mpiuni # # k6/7/9.rap.ucar.edu need extra hand-holding for some reason. # The ESMF build system doesn't see them as being Linux systems. # if [ "$un" = "k6" ] || [ "$un" = "k7" ] || [ "$un" = "k9" ] ; then export ESMF_COMPILER=gfortran export ESMF_OS=Linux export ESMF_CXXCOMPILER=/usr/bin/g++ export ESMF_F90COMPILER=/usr/bin/gfortran elif [ "$un" = "yellowstone_gnu472" ] ; then export ESMF_COMPILER=gfortran export ESMF_OS=Linux elif [ "$un" = "yellowstone_intel1215" ] ; then export ESMF_COMPILER=intel export ESMF_OS=Linux else export ESMF_COMPILER=gfortran fi if [ "$um" = "x86_64" ] ; then export ESMF_ABI=64 else export ESMF_ABI=32 fi # Don't use ESMF_BUILD_DIR here export ESMFBUILDDIR="$os.$ESMF_COMPILER.$ESMF_ABI.$ESMF_COMM.default" export ESMFREGRIDFILE="$ESMF_INSTALL_PREFIX/bin/binO/$ESMFBUILDDIR/ESMF_RegridWeightGen" if [ "$os" = "Darwin" ] ; then export ESMFSHAREDLIB="lib/libO/$ESMFBUILDDIR/libesmf.dylib" else export ESMFSHAREDLIB="lib/libO/$ESMFBUILDDIR/libesmf.so" fi # Here's the non-OPeNDAP build if [ $BUILD_NON_OPENDAP ] ; then echo "Building non-OPeNDAP version of $ESMF_DIR..." make all install # This is to get rid of libesmf shared library dependency. /bin/rm -rf $ESMF_DIR/$ESMFSHAREDLIB $ESMF_INSTALL_PREFIX/$ESMFSHAREDLIB make install # If successful, move ESMF_RegridWeightGen to appropriate location. if [ -f $ESMFREGRIDFILE ] ; then echo "Moving $ESMFREGRIDFILE to $PREFIX/bin/ESMF_RegridWeightGen.nodap" /bin/mv $ESMFREGRIDFILE $PREFIX/bin/ESMF_RegridWeightGen.nodap /bin/rm -rf $ESMF_INSTALL_PREFIX/bin/binO /bin/rm -rf $ESMF_INSTALL_PREFIX/lib/libO /bin/rm -rf $ESMF_INSTALL_PREFIX/include/ESMC* else echo "$ESMFREGRIDFILE doesn't exist" fi fi #-------------------------------------------------- # Now build OPeNDAP version #-------------------------------------------------- echo "Cleaning $ESMF_DIR before building OPeNDAP version..." make distclean make clean # Change these ESMF env vars before OPeNDAP build. export ESMF_INSTALL_PREFIX=$PREFIX export ESMF_LAPACK_LIBPATH=$NCARG_ROOT/lib export ESMF_CXXCOMPILEPATHS="-I$PREFIX/include" export ESMFREGRIDFILE="$ESMF_INSTALL_PREFIX/bin/binO/$ESMFBUILDDIR/ESMF_RegridWeightGen" unset ESMF_CXXLINKPATHS if [ "$os_version" = "10.8.4" ] ; then export ESMF_NETCDF_LIBS="-lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lcrypto -lldap -lssl -lsz -lz -lquadmath" elif [ "$un" = "yellowstone_gnu472" ] || [ "$un" = "yellowstone_gnu447" ] ; then export ESMF_NETCDF_LIBS="-lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lcrypto -lz -lrt -ldl -lssl -lidn -lsz -lz" elif [ "$un" = "yellowstone_intel1215" ] ; then export ESMF_NETCDF_LIBS="-lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lsz -lz -lrt -lcurl -lssl -lidn -lrt -ldl" elif [ "$un" = "cisl-denton.local" ] || [ "$un" = "cisl-denton.scd.ucar.edu" ] || [ "$un" = "riley.local" ] || [ "$os_version" = "10.9.2" ] || [ "$os_version" = "10.9.4" ] || [ "$os_version" = "10.9.5" ] ; then export ESMF_NETCDF_LIBS="-lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lsz -lm -lz -lcurl -lssl -lcrypto -llber" elif [ "$un" = "k5" ] || [ "$un" = "k6" ] || [ "$un" = "k7" ] ; then export ESMF_NETCDF_LIBS="-lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lsz -lm -lz -lcurl -lcrypto -lidn -lldap -lrt -lssl" elif [ "$un" = "k9" ] ; then export ESMF_NETCDF_LIBS="-lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lsz -lm -lz -lcurl -lcrypto -lidn -lldap -lrt -lssl" elif [ "$un" = "logan.cgd.ucar.edu" ] ; then export ESMF_NETCDF_LIBS="-lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lz -lidn -lrt -ldl -lsz -lz" else export ESMF_NETCDF_LIBS="-lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lsz -lz" fi echo "Building OPeNDAP version of $ESMF_DIR..." make all install # This is to get rid of libesmf shared library dependency. /bin/rm -rf $ESMF_DIR/$ESMFSHAREDLIB $ESMF_INSTALL_PREFIX/$ESMFSHAREDLIB make install # If successful, move ESMF_RegridWeightGen to appropriate location and clean up. if [ -f $ESMFREGRIDFILE ] ; then echo "Moving $ESMFREGRIDFILE to $PREFIX/bin/ESMF_RegridWeightGen.dap" /bin/mv $ESMFREGRIDFILE $PREFIX/bin/ESMF_RegridWeightGen.dap /bin/rm -rf $ESMF_INSTALL_PREFIX/bin/binO /bin/rm -rf $ESMF_INSTALL_PREFIX/lib/libO /bin/rm -rf $ESMF_INSTALL_PREFIX/include/ESMC* else echo "$ESMFREGRIDFILE doesn't exist" fi if [ $CLEAN_AFTER ] ; then echo "Cleaning $ESMF_DIR after making..." make distclean make clean fi cd .. else echo "Directory $ESMF_DIR doesn't exist" fi else echo "Not building ESMF..." fi