$Header$ -*-Fundamental-*-

Purpose(s):
Track status of autobuild features for NCO
Develop recommended ./configure invocations for each architecture

GNU autotools rely on ~/nco/autobld/config.[guess,sub]
Auto-configuration fails if these routines cannot detect your machine type
This happens periodically as newer machines are introduced
Notify the NCO project if configuration fails in either file
and we will update the config files from the upstream source,
ftp://ftp.gnu.org/pub/gnu/config/config.[guess,sub]

NCO successfully builds (e.g., with bld/Makefile) and runs on virtually all OSs.
This table tracks how well NCO _autobuilds_ (./configure's) on various OSs.
GNU Autotools seem to require a lot of hand tuning on non-LINUX platforms...
Architecture	ABI32	ABI64	DAP	I18N	OpenMP	nco_c++	check
AIX		Y	Y                       Y       Y	Y
ALPHA		Y					Y	Y
CRAY
FREEBSD		N(10)
HPPA
LINUX como	N(11)
LINUX gcc/g++	Y	N/A	Y			Y	Y
LINUX icc	Y	N/A				Y	Y
LINUXALPHA	Y					Y	Y
LINUXAMD64		Y				Y	Y
LINUXPPC	Y					Y	N(9)
LINUXSPARC64	Y					Y	Y
MACOS		Y					Y	Y
NECSX
SGIMP64 cc/CC	Y	Y				Y	N(6)
SGIMP64 gcc/g++	N(7)					Y
SUNMP cc/CC	Y	Y				Y	Y
SUNMP gcc/g++	N(13)
WIN32
-----------------------------------------------------------------------
Key: Y: feature works, N feature broken, N/A not-applicable, blank: not tested (send us your results!)
-----------------------------------------------------------------------
Table footnotes:
06. CC unable to link tst.o because -LANG:std flag not passed to crucial link CC
07. Error making ncap_yacc.c
09. tst fails to find in.nc
10. Major problems with configure script and permissions on installed files
11. Comeau (correctly) insists strdup(), strcasecmp() are not ANSI standard (this should now be fixed, retry)
13. gcc 3.2.1 problem with /usr/include/sys/stat.h in nco_fl_utl.h
17.
-----------------------------------------------------------------------

There are three basic ways to build/install NCO with the GNU autotools:
Method 1. Default installation procedure for system-wide installation.

   cd ~/nco;cvs update -kk;make distclean;./configure;make;sudo make install

   This simplest default method works if the required libraries
   (e.g., libnetcdf.a) are in normal places (e.g., /usr/local/lib).
   No special optimizations or features are activated.

Method 2. Optimized installation procedure for system-wide installation.

   cd ~/nco;cvs update -kk;make distclean;./configure --enable-optimize-custom;make;sudo make install

   Activating --enable-optimize-custom causes NCO to attempt to build with
   a set of compiler switches customized for speed.
   This will only work if Method 1 worked, so give it a whirl.

Method 3. Recommended/current custom ./configure invocation
   System administrators like to install multiple compilers, and
   have libraries in weird places.
   Serious users of NCO are encouraged to try the configurations below.
   The suggestions are alphabetized by (pvmgetarch) machine type.

************************************************************************
To build NCO versions > 2.9.9 with netCDF versions < 3.6, define the
pre-processor token NC_64BIT_OFFSET to '0', e.g., CPPFLAGS='-DNC_64BIT_OFFSET=0'
************************************************************************
Start AIX
status: Appears to work
On AIX, shared libraries and static libraries use the same namespace
Hence, probably safer to either disable-shared or disable-static
hjm: until DODS/DAP and the above mentioned shared/static problem is resolved,
AIX configure string should be:  ./configure --disable-dods --disable-shared
************************************************************************
zender@bs1201en:~/nco$ pvmgetarch;uname -a;~/nco/autobld/config.guess
AIX
AIX bs1201en 1 5 0023F7EA4C00
powerpc-ibm-aix5.1.0.0

For ABI=64:
# blueice, bluevista, dave, esmf
# Enable OpenMP with CFLAGS and LDFLAGS ='-qsmp=omp'
# C_INC is a directory guaranteed to be searched first
# C_INC is useful on AIX platforms that have alternative C-headers (e.g., gcc) installed in a directory (e.g., /usr/local/include) searched for other (e.g., antlr) headers
# Specifying both C_INC and ANTLR_INC would cause the pre-processor to grab 
# C-headers from C_INC and antlr headers from ANTLR_INC
# C_INC disambiguates native C-headers (/usr/include) from antlr headers (/usr/local/include) on UCI's ESMF
# 
export GNU_TRP=`~/nco/autobld/config.guess`
export OBJECT_MODE='64' # AIX-specific hack
cd ~/nco;/bin/rm -f *.foo;make distclean
ANTLR_INC='/usr/local/include' C_INC='/usr/include' CC='xlc_r' CFLAGS='-qsmp=omp' CXX='xlC_r' LDFLAGS='-brtl -qsmp=omp' NETCDF_INC='/usr/local/include' NETCDF_LIB=${NETCDF_LIB} ./configure --disable-gsl --disable-shared --enable-optimize-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

# bluefire 20120718 not tested yet
export GNU_TRP=`~/nco/autobld/config.guess`
export OBJECT_MODE='64' # AIX-specific hack
cd ~/nco;/bin/rm -f *.foo;make distclean
ANTLR_INC='/contrib/antlr-2.7.7/include' C_INC='/usr/include' CC='xlc_r' CXX='xlC_r' LDFLAGS='-brtl' GSL_ROOT='/contrib/gsl-1.12' NETCDF_INC='/contrib/netcdf/4.1.3_seq/include' NETCDF_LIB='/contrib/netcdf/4.1.3_seq/include' ./configure --disable-shared --enable-optimize-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.make.foo zender@dust.ess.uci.edu:/var/ftp/pub/zender/nco/rgr

# bluefire
export GNU_TRP=`~/nco/autobld/config.guess`
export OBJECT_MODE='64' # AIX-specific hack
cd ~/nco;/bin/rm -f *.foo;make distclean
ANTLR_INC='/usr/local/include' C_INC='/usr/include' CC='xlc_r' CXX='xlC_r' LDFLAGS='-brtl' GSL_ROOT='/contrib/gsl-1.12' NETCDF_INC='/usr/local/include' NETCDF_LIB=${NETCDF_LIB} ./configure --disable-shared --enable-optimize-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.make.foo zender@dust.ess.uci.edu:/var/ftp/pub/zender/nco/rgr

For ABI=32:
export GNU_TRP=`~/nco/autobld/config.guess`
export OBJECT_MODE='32' # AIX-specific hack
cd ~/nco;/bin/rm -f *.foo;make distclean
ANTLR_INC='/usr/local/include' C_INC='/usr/include' CC='xlc_r' CXX='xlC_r' LDFLAGS='-brtl' NETCDF_INC='/usr/local/include' NETCDF_LIB='/usr/local/lib32/r4i4' ./configure --disable-shared --enable-optimize-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

************************************************************************
End AIX
************************************************************************

************************************************************************
Start ALPHA
Status: Does not work
************************************************************************
spe171.testdrive.hp.com

CC=/bin/c89
CPPFLAGS=-D_HPUX_SOURCE
FC=/opt/fortran/bin/fort77
FFLAGS=-w
FLIBS=-lU77
CXX=aCC

zender@spe171.testdrive.hp.com> ./pvmgetarch;uname -a;${HOME}/nco/autobld/config.guess
ALPHA
OSF1 spe171.testdrive.hp.com V5.1 2650 alpha
alpha-dec-osf5.1

gcc/g++:
export GNU_TRP=`~/nco/autobld/config.guess`
cd ~/nco;/bin/rm -f *.foo;make distclean
NETCDF_INC=${HOME}/include NETCDF_LIB=${HOME}/lib/${GNU_TRP} ./configure --enable-optimize-custom --prefix=${HOME} --bindir=${HOME}/bin/${GNU_TRP} --datadir=${HOME}/nco/data --libdir=${HOME}/lib/${GNU_TRP} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr
************************************************************************
End ALPHA
************************************************************************

************************************************************************
Start FREEBSD
Status:
************************************************************************
bash-2.05a$ ./pvmgetarch;uname -a;~/nco/autobld/config.guess
FREEBSD
FreeBSD usf-cf-x86-freebsd-1 4.6-STABLE FreeBSD 4.6-STABLE #9: Tue Aug 20 12:33:16 PDT 2002     root@usf-cf-x86-freebsd-1:/usr/obj/usr/src/sys/GENERIC  i386

gcc/g++:
export GNU_TRP=`~/nco/autobld/config.guess`
cd ~/nco;/bin/rm -f *.foo;make distclean
NETCDF_INC=${HOME}/include NETCDF_LIB=${HOME}/lib/${GNU_TRP} ./configure --enable-optimize-custom --prefix=${HOME} --bindir=${HOME}/bin/${GNU_TRP} --datadir=${HOME}/nco/data --libdir=${HOME}/lib/${GNU_TRP} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f config.status config.status.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.make.foo config.status.foo dust.ess.uci.edu:Sites/nco/rgr
************************************************************************
End FREEBSD
************************************************************************

************************************************************************
Start HPPA
Status: Does not work
************************************************************************
CC=/bin/c89
CPPFLAGS=-D_HPUX_SOURCE
FC=/opt/fortran/bin/fort77
FFLAGS=-w
FLIBS=-lU77
CXX=aCC

spe169> ./pvmgetarch;uname -a;~/nco/autobld/config.guess
HPPA
HP-UX spe169 B.11.11 U 9000/800 1939057856 unlimited-user license
hppa2.0w-hp-hpux11.11

gcc/g++:
export GNU_TRP=`~/nco/autobld/config.guess`
cd ~/nco;/bin/rm -f *.foo;make distclean
NETCDF_INC=${HOME}/include NETCDF_LIB=${HOME}/lib/${GNU_TRP} ./configure --enable-optimize-custom --prefix=${HOME} --bindir=${HOME}/bin/${GNU_TRP} --datadir=${HOME}/nco/data --libdir=${HOME}/lib/${GNU_TRP} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr
************************************************************************
End HPPA
************************************************************************

************************************************************************
Start LINUX
Status: Works
Commands for LINUX are the only ones "regularly" used after ~2010
************************************************************************
# Post upgrade requests to sysadmins at ALCF, LCRC, LLNL, NCAR, NCSA, NERSC, OLCF
# support@alcf.anl.gov # ALCF Maintainer = Robert Scott <scott@alcf.anl.gov> 
# conda update nco # Anaconda Maintainer = Filipe Fernandes (github: ocefpaf)
# support@lcrc.anl.gov # LCRC Maintainer = Adam
# Tony Hoang <hoang1@llnl.gov> # LLNL
# cislhelp@ucar.edu # NCAR
# Yan Liu <yanliu@illinois.edu> # NCSA Maintainer = Yan Liu (github: yanliu-chn)
# https://nersc.service-now.com/navpage.do # NERSC Maintainer = Yun (Helen) He
# https://www.olcf.ornl.gov/support/submit-ticket # OLCF
# rc-support@pnnl.gov # PNNL Maintainer = Silvia.Hoisie@pnnl.gov ?
# Subject: Please upgrade to netCDF 4.6.1 and to NCO 4.7.4
# Request: NCO 4.7.4 was released 4/6 and contains many features of interest to your ACME users. Please upgrade the system NCO module to 4.7.4 and make that the default NCO module. Thanks!

zender@dust:~/nco$ pvmgetarch;uname -a;~/nco/autobld/config.guess
LINUX
Linux dust.ess.uci.edu 2.4.19-pre8 #1 SMP Wed May 8 10:16:29 PDT 2002 i686 unknown
i686-pc-linux-gnu

# gcc/g++ Install/update NCO in personal directories using all configure defaults:
cd ~/nco;/bin/rm -f *.foo;make distclean
CC='gcc' CXX='g++' ./configure --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

# gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories:
cd ~/nco;/bin/rm -f *.foo;make distclean
CC='gcc' CXX='g++' ./configure --disable-shared --enable-optimize-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

# gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories with CMake:
# Generic when netCDF is in /usr (Ubuntu glace)
# Personal recipe last modified: 20170814
# Personal recipe last used successfully: 20171218
cd ~/nco;/bin/rm -f *.foo;make distclean
cd ~/nco;cmake/clean
cd ~/nco/cmake;cmake .. -DCMAKE_INSTALL_PREFIX=${HOME}
make install

# clang Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories with CMake:
# Generic when netCDF is in ~/anaconda (MacOS katabatic)
cd ~/nco;/bin/rm -f *.foo;make distclean
unset NETCDF_ROOT
export NETCDF_INC='/usr/local/opt/netcdf/include'
export NETCDF_LIB='/usr/local/opt/netcdf/lib'
cd ~/nco;cmake/clean.sh
cd ~/nco/cmake;cmake .. -DCMAKE_INSTALL_PREFIX=${HOME} -DNETCDF_INCLUDE:PATH=${NETCDF_INC} -DNETCDF_LIBRARY:FILE=${NETCDF_LIB}/libnetcdf.a -DHDF5_LIBRARY:FILE=${NETCDF_LIB}/libhdf5.a -DHDF5_HL_LIBRARY:FILE=${NETCDF_LIB}/libhdf5.a
make install

# gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in system directories with CMake:
# Generic when netCDF is in /usr (Ubuntu glace)
# Personal recipe last modified: 20170814
# Personal recipe last used successfully: 20200601
cd ~/nco/cmake
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local
make
sudo make install

# gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories with CMake, when build requirements are in unusual directories:
# netCDF4/HDF5 in /usr/local
cd ~/nco/cmake
cmake .. -DCMAKE_INSTALL_PREFIX=${HOME} -DNETCDF_INCLUDE:PATH=${NETCDF_INC} -DNETCDF_LIBRARY:FILE=${NETCDF_LIB}/libnetcdf.a -DHDF5_LIBRARY:FILE=${NETCDF_LIB}/libhdf5.a -DHDF5_HL_LIBRARY:FILE=${NETCDF_LIB}/libhdf5.a # Skyglow (Fedora does not supply szip packages)
make install

# netCDF4/HDF5 in /usr/local
cd ~/nco/cmake
cmake .. -DCMAKE_INSTALL_PREFIX=${HOME} -DNETCDF_INCLUDE:PATH=${NETCDF_INC} -DNETCDF_LIBRARY:FILE=${NETCDF_LIB}/libnetcdf.a -DHDF5_LIBRARY:FILE=${NETCDF_LIB}/libhdf5.a -DHDF5_HL_LIBRARY:FILE=${NETCDF_LIB}/libhdf5.a # Glace
make install				

# gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on acme1:
# Sysadmin upgrade request: 
# Latest sysadmin-compiled module usage: 
# Personal recipe last modified: 20221214 (search new location of e3sm-u_latest)
# Personal recipe last used successfully: 20221128 (borken as of 20221214)
# NB: aims4 and acme1 only accept connections from whitelisted domains (e.g., uci.edu)
cd ~/nco;/bin/rm -f *.foo;make distclean
export PATH=${MY_BIN_DIR}:'/p/user_pub/e3sm_unified/envs/base/envs/e3sm_unified_latest/bin':${PATH}
#export LD_LIBRARY_PATH=${MY_LIB_DIR}:'/p/user_pub/e3sm_unified/envs/base/envs/e3sm_unified_latest/lib':${LD_LIBRARY_PATH}
# NB: Necessary to explicitly specify NETCDF_BIN and NETCDF_LIB. NETCDF_ROOT may be borken.
# 20220104 NB: ANTLR_ROOT in ${HOME} is only used at compile-time, not run-time
ANTLR_ROOT=${HOME} CC='gcc' CXX='g++' NETCDF_ROOT='/p/user_pub/e3sm_unified/envs/base/envs/e3sm_unified_latest' NETCDF_INC='/p/user_pub/e3sm_unified/envs/base/envs/e3sm_unified_latest/include' NETCDF_LIB='/p/user_pub/e3sm_unified/envs/base/envs/e3sm_unified_latest/lib' UDUNITS2_PATH='/p/user_pub/e3sm_unified/envs/base/envs/e3sm_unified_latest' ./configure --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

# gcc/g++ 20201208 Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on andes:
# Sysadmin upgrade request: https://www.olcf.ornl.gov/support/submit-ticket
# Latest ticket to build NCO: 381695 on 20180413
# Latest sysadmin-compiled module usage: module load netcdf-c/4.7.4 nco/4.9.3 # 20201208
# Personal recipe last modified: 20221019 (link -lantlr from MY_LIB_DIR not HOME/lib)
# Personal recipe last used successfully: 20221128
export LINUX_CC='gcc -std=c99 -pedantic -D_DEFAULT_SOURCE'
export LINUX_CXX='g++ -std=c++11'
export LINUX_FC='gfortran'
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/gpfs/alpine/proj-shared/cli115/e3sm-unified/base/envs/e3sm_unified_latest/lib
export NETCDF_ROOT=/gpfs/alpine/proj-shared/cli115/e3sm-unified/base/envs/e3sm_unified_latest
export PATH=${PATH}:/gpfs/alpine/proj-shared/cli115/e3sm-unified/base/envs/e3sm_unified_latest/bin
cd ~/nco;git reset --hard origin/master
cd ~/nco/bld;make ANTLR_ROOT=${HOME} ANTLR_LIB=${MY_LIB_DIR} NETCDF_ROOT='/gpfs/alpine/proj-shared/cli115/e3sm-unified/base/envs/e3sm_unified_latest' OPTS=D OMP=Y allinone;cd -

# gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on blues/anvil
# LCRC uses Spack module written and tested by Adam Stewart: https://github.com/LLNL/spack/pull/4370/files
# spack install --run-tests nco%gcc ^netcdf@4.4.0
# Sysadmin upgrade request: support@lcrc.anl.gov
# Latest ticket to build NCO: AREQ0215917 on 20180413
# Latest sysadmin-compiled module usage: 
# Personal recipe last modified: 20200618
# Personal recipe last used successfully: 20200905
# Fails to link to system-installed udunits...why?
# nm -a /soft/udunits/2.1.21/lib/libudunits2.a | grep ut_read_xml
cd ~/nco;/bin/rm -f *.foo;make distclean
ANTLR_ROOT=${HOME} CC='gcc' CXX='g++' NETCDF_ROOT='/soft/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-5.3.0/netcdf-4.4.1.1-2dtwbu4ojkwj5tqd4uqvomnu6ecmh6tx' UDUNITS2_PATH=${HOME} ./configure --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

# gcc/g++ 20171013 Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on cheyenne:
# Sysadmin upgrade request: cislhelp@ucar.edu # NCAR Maintainer = Pat Nichols
# Latest ticket to build NCO: 216373 on 20180413
# Latest sysadmin-compiled module usage: module load netcdf/4.6.1 module load nco/4.7.4 # 20180417
# Personal recipe last modified: 20190813
# Personal recipe last used successfully: 20221118
# Personal recipe last failed: 20190812 (antlr needed GCC 9.1.0 recompile)
# Cheyenne GNU:
module purge
module load ncarenv gnu/9.1.0 ncarcompilers mpt netcdf/4.6.3
module add gnu/9.1.0
module add netcdf/4.6.3
module add mpt
export LINUX_CXX='g++ -std=c++11'
export PATH=${PATH}:/opt/pbs/bin # needed for qsub
export PATH=${PATH}:/glade/u/apps/ch/opt/netcdf/4.6.3/gnu/9.1.0/bin # needed for ncgen
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/glade/u/apps/ch/opt/netcdf/4.6.3/gnu/9.1.0/lib:/glade/u/apps/ch/opt/udunits/2.2.26/gnu/9.1.0/lib:/glade/u/apps/ch/opt/gsl/2.4/gnu/6.3.0/lib # needed to run NCO
cd ~/nco;/bin/rm -f *.foo;make distclean
cd ~/nco;git reset --hard origin/master
cd ~/nco/bld;make ANTLR_ROOT=${HOME} GSL_ROOT='/glade/u/apps/ch/opt/gsl/2.4/gnu/6.3.0' GSL_INC='/glade/u/apps/ch/opt/gsl/2.4/gnu/6.3.0/include' SL_LIB='/glade/u/apps/ch/opt/gsl/2.4/gnu/6.3.0/lib' NETCDF_ROOT='/glade/u/apps/ch/opt/netcdf/4.6.3/gnu/9.1.0' UDUNITS_INC='/glade/u/apps/ch/opt/udunits/2.2.26/gnu/9.1.0/include' UDUNITS_LIB='/glade/u/apps/ch/opt/udunits/2.2.26/gnu/9.1.0/lib' OPTS=D allinone;cd -

# gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on chrysalis
# LCRC uses Spack module written and tested by Adam Stewart: https://github.com/LLNL/spack/pull/4370/files
# spack install --run-tests nco%gcc ^netcdf@4.4.0
# Sysadmin upgrade request: support@lcrc.anl.gov
# Latest ticket to build NCO: AREQ0215917 on 20180413
# Latest sysadmin-compiled module usage: module load netcdf-c/4.7.4-a4uk6zy # gcc netCDF 4.7.4
# Personal recipe last modified: 20221004 (use Anaconda)
# Personal recipe last used successfully: 20221128
cd ~/nco;/bin/rm -f *.foo;make distclean
module load gcc/9.2.0-ugetvbp
module load openmpi/4.0.4-hpcx-hghvhj5
# Default as of 20210924 is to build with Anaconda
# This works until ncap2 fails to link to -lantlr because link path does not use MY_LIB_DIR for some reason
ANTLR_ROOT=${HOME} ANTLR_LIB=${MY_LIB_DIR} CC='gcc' CXX='g++' NETCDF_ROOT="${HOME}/anaconda" UDUNITS2_PATH="${HOME}/anaconda" ./configure --disable-ccr --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
# Older method:
# module load netcdf-c/4.7.4-a4uk6zy (only for non-anaconda builds)
# ANTLR_ROOT=${HOME} CC='gcc' CXX='g++' NETCDF_ROOT='/gpfs/fs1/soft/chrysalis/spack/opt/spack/linux-centos8-x86_64/gcc-9.2.0/netcdf-c-4.7.4-a4uk6zy' UDUNITS2_PATH=${HOME} ./configure --disable-ccr --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

# Compy with GNU compilers (default from 20221216--present)
# gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on compy using GCC
# https://acme-climate.atlassian.net/wiki/spaces/ED/pages/928973795/CompyMcNodeFace+-+E3SM+RGMA+ESMD+dedicated+system+at+PNNL
# Sysadmin upgrade request: rc-support@pnnl.gov # PNNL Maintainer = Tim Carlson ?
# Latest ticket to build NCO: 20190525 ICS-40n99 (closed in 1 day!)
# Latest sysadmin-compiled module usage: module add nco # 20190524 default version is 4.7.9
# Personal recipe last modified: 20221222 (remove UDUNITS2_PATH)
# Personal recipe last used successfully: 20221222
module purge
module load gcc/10.2.0
#module load mvapich2/2.3.7 # Required for ncclimo/ncremap in MPI-mode
ANTLR_ROOT=${HOME} CC='gcc' CXX='g++' NETCDF_ROOT="${HOME}/anaconda" ./configure --disable-ccr --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

# Compy with Intel compilers (default from 20210104--20221215)
# Personal recipe last modified: 20220919
# Personal recipe last used successfully: 20221128
source /share/apps/intel/2020/compilers_and_libraries_2020.0.166/linux/bin/compilervars.sh intel64 # Compy
module purge
module load intel/20.0.0
module load intelmpi/2020 # Required for ncclimo/ncremap in MPI-mode
module load netcdf/4.6.3
#module load mkl/2020 # Does not hurt but not necessary?
cd ~/nco;/bin/rm -f *.foo;make distclean
ANTLR_ROOT=${HOME} CC='icc' CXX='icpc' LDFLAGS='-L/lib64 -limf -lirc' NETCDF_INC='/share/apps/netcdf/4.6.3/intel/20.0.0/include' NETCDF_LIB='/share/apps/netcdf/4.6.3/intel/20.0.0/lib' UDUNITS2_PATH='/share/apps/udunits/2.2.26' ./configure --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1 # works
ANTLR_ROOT=${HOME} CC='icx -static-intel -qopenmp-link=static' CXX='icx -static-intel -qopenmp-link=static' LDFLAGS='-L/usr/lib64 -L/lib64' NETCDF_INC='/share/apps/netcdf/4.6.3/intel/20.0.0/include' NETCDF_LIB='/share/apps/netcdf/4.6.3/intel/20.0.0/lib' UDUNITS2_PATH='/share/apps/udunits/2.2.26' ./configure --disable-shared --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1 # fails with ld: cannot find -lm but -lm is not necessary and removing it fixes the issue
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1

# 20150901: gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on cooley:
# Sysadmin upgrade request: support@alcf.anl.gov # ALCF Maintainer = 
# Latest ticket to build NCO: alcf-support #367012 on 20180413
# Latest sysadmin-compiled module usage: soft add +nco-4.6.8, soft add +netcdf-4.4.1.1
# Personal recipe last modified: 20170825
# Personal recipe last used successfully: 20190420
cd ~/nco;/bin/rm -f *.foo;make distclean
cd ~/nco;git reset --hard origin/master
ANTLR_ROOT=${HOME} CC='gcc' CXX='g++' NETCDF_ROOT='/soft/libraries/unsupported/netcdf-4.4.1.1' UDUNITS2_PATH=${HOME} ./configure --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

# gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on cori with Intel:
# Sysadmin upgrade request: https://nersc.service-now.com/navpage.do # NERSC Maintainer = Yun (Helen) He
# Latest ticket to build NCO: INC0118469 on 20180413
# Latest sysadmin-compiled module usage: module load nco/5.0.1 # 20220701
# Personal recipe last modified: 20221222 (deprecate UDUNITS_PATH)
# Personal recipe last used successfully: 20221222
module purge # After login, purge before load or risk this: "error while loading shared libraries: libiomp5.so: cannot open shared object file: No such file or directory"
module load PrgEnv-intel
module load cray-netcdf
module load gsl/2.7
module load antlr/2.7.7-intel
module load udunits
cd ~/nco;/bin/rm -f *.foo;make distclean
CPPFLAGS="-I ${UDUNITS_DIR}/include" LDFLAGS="-L${UDUNITS_DIR}/lib -ludunits2" ANTLR_ROOT='/global/common/software/nersc/cori-2022q1/spack/cray-cnl7-haswell/antlr-2.7.7-qqi5ofz' CC='icc' CXX='icpc' NETCDF_ROOT="${CRAY_NETCDF_PREFIX}" ./configure --prefix=${HOME} --bindir=${HOME}/bin_cori --datadir=${HOME}/nco/data --libdir=${HOME}/lib_cori --mandir=${HOME}/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

# 20200105 Try NERSC-recommended procedures:
# https://www.nersc.gov/assets/Uploads/04-PE-Compilations-NewUserTraining-20190621.pdf
module swap PrgEnv-Intel PrgEnv-cray
unset NETCDF4_ROOT
unset NETCDF_INC
unset NETCDF_LIB
unset NETCDF_ROOT
module load cray-netcdf/4.7.4.0
ANTLR_ROOT=${HOME} ANTLR_LIB=${HOME}/lib_cori CC='cc' CXX='CC' GSL_ROOT='/global/common/sw/cray/cnl7/haswell/gsl/2.5/gcc/8.3.0/yfdt2hw' UDUNITS2_PATH='/global/common/sw/cray/cnl7/haswell/udunits2/2.2.24/gcc/8.2.0/y4j6eez' ./configure --prefix=${HOME} --bindir=${HOME}/bin_cori --datadir=${HOME}/nco/data --libdir=${HOME}/lib_cori --mandir=${HOME}/man 

# gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on cori with GNU:
# Sysadmin upgrade request: https://nersc.service-now.com/navpage.do # NERSC Maintainer = Yun (Helen) He
# Latest ticket to build NCO: INC0118469 on 20180413
# Latest sysadmin-compiled module usage: module load nco/5.0.1 # 20220701
# Personal recipe last modified: 20220320 (updated to netCDF 4.8.1)
# Personal recipe last used successfully: 20220202 (currently not linking ncap2 because needs -L${HOME}/lib_cori to find -lantlr. Moreover, ldd cannot find system libraries. also issues with HDF library mismatch)
module load gcc
export HDF5_DISABLE_VERSION_CHECK=1
export HDF5_USE_FILE_LOCKING=FALSE
#module load udunits
cd ~/nco;/bin/rm -f *.foo;make distclean
ANTLR_ROOT=${HOME} ANTLR_LIB=${HOME}/lib_cori CC='gcc' CXX='g++' GSL_ROOT='/global/common/sw/cray/cnl7/haswell/gsl/2.5/gcc/8.3.0/yfdt2hw' NETCDF_ROOT='/opt/cray/pe/netcdf/4.8.1.1/gnu/8.2' NETCDF_INC='/opt/cray/pe/netcdf/4.8.1.1/gnu/8.2/include' NETCDF_LIB='/opt/cray/pe/netcdf/4.8.1.1/gnu/8.2/lib' NETCDF_ROOT='/opt/cray/pe/netcdf/4.8.1.1' UDUNITS2_PATH='/global/common/sw/cray/cnl7/haswell/udunits2/2.2.24/gcc/8.2.0/y4j6eez' ./configure --prefix=${HOME} --bindir=${HOME}/bin_cori --datadir=${HOME}/nco/data --libdir=${HOME}/lib_cori --mandir=${HOME}/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr
# 20200131 Optimize build for Cori KNL (use NERSC compiler wrappers)
# This "works" yet shows no weight-generation speed advantages compared to Haswell
# 20200203: KNL-optimized binaries on login nodes (Haswell) cause "Illegal Instruction" errors
# However, default (Haswell-optimized) binaries on compute nodes (KNL) do not cause "Illegal Instruction" errors
# Until/unless speed advantage is demonstrated, avoid KNL-optimized environment for compilation
module swap craype-haswell craype-mic-knl
module swap PrgEnv-intel PrgEnv-gnu
module load gcc # Activate GCC8
cd ~/nco;/bin/rm -f *.foo;make distclean
ANTLR_ROOT=${HOME} ANTLR_LIB=${HOME}/lib_cori CC='cc' CXX='CC' GSL_ROOT='/global/common/sw/cray/cnl7/haswell/gsl/2.5/gcc/8.3.0/yfdt2hw' NETCDF_INC='/opt/cray/pe/netcdf/4.8.1.1/gnu/8.2/include' NETCDF_LIB='/opt/cray/pe/netcdf/4.8.1.1/gnu/8.2/lib' NETCDF_ROOT='/opt/cray/pe/netcdf/4.8.1.1' UDUNITS2_PATH='/global/common/sw/cray/cnl7/haswell/udunits2/2.2.24/gcc/8.2.0/y4j6eez' ./configure --prefix=${HOME} --bindir=${HOME}/bin_cori --datadir=${HOME}/nco/data --libdir=${HOME}/lib_cori --mandir=${HOME}/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

# gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on cori with NVidia:
# Sysadmin upgrade request: https://nersc.service-now.com/navpage.do # NERSC Maintainer = Yun (Helen) He
# Latest ticket to build NCO: INC0118469 on 20180413
# Latest sysadmin-compiled module usage: module load nco/5.0.1 # 20220701
# Personal recipe last modified: 20201210 (attempting nvidia)
# Personal recipe last used successfully: fxm 
cd ~/nco;/bin/rm -f *.foo;make distclean
#export rch_sfx='cori' 
bsrc
export rch_sfx='cgpu' 
export MY_BIN_DIR=${HOME}/bin_${rch_sfx}
export MY_LIB_DIR=${HOME}/lib_${rch_sfx}
export MY_OBJ_DIR=${HOME}/obj_${rch_sfx}
export PATH=${MY_BIN_DIR}:${PATH}
export LD_LIBRARY_PATH=${MY_LIB_DIR}:${LD_LIBRARY_PATH}
module purge && module load cgpu
module load hpcsdk/20.11
ANTLR_ROOT=${HOME} ANTLR_LIB=${HOME}/lib_cori CC='nvc' CXX='nvc++' GSL_ROOT='/usr/common/software/gsl/2.1/intel' NETCDF_INC='/opt/cray/pe/netcdf/4.8.1.1/gnu/8.2/include' NETCDF_LIB='/opt/cray/pe/netcdf/4.8.1.1/gnu/8.2/lib' NETCDF_ROOT='/opt/cray/pe/netcdf/4.8.1.1' UDUNITS2_PATH='/usr/common/software/udunits/2.2.19/hsw/intel' ./configure --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

# gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on perlmutter with GNU:
# Sysadmin upgrade request: https://nersc.service-now.com/navpage.do # NERSC Maintainer = Yun (Helen) He
# Latest ticket to build NCO: INC0118469 on 20180413
# Latest sysadmin-compiled module usage: 
# Personal recipe last modified: 20221223
# Personal recipe last used successfully: 20221223
module load PrgEnv-gnu
module load gcc/11.2.0
module load cray-hdf5/1.12.2.1
module load cray-netcdf/4.9.0.1
export HDF5_DISABLE_VERSION_CHECK=1
export HDF5_USE_FILE_LOCKING=FALSE
#module load gsl/2.7 (need to make private build)
#module load udunits
cd ~/nco;/bin/rm -f *.foo;make distclean
ANTLR_ROOT=${HOME} ANTLR_LIB=${HOME}/lib_perlmutter CC='gcc' CXX='g++' NETCDF_DIR='/opt/cray/pe/netcdf/4.9.0.1/gnu/9.1' NETCDF_INC='/opt/cray/pe/netcdf/4.9.0.1/gnu/9.1/include' NETCDF_LIB='/opt/cray/pe/netcdf/4.9.0.1/gnu/9.1/lib' NETCDF_ROOT='/opt/cray/pe/netcdf/4.9.0.1' UDUNITS2_PATH=${HOME} ./configure --prefix=${HOME} --bindir=${HOME}/bin_perlmutter --datadir=${HOME}/nco/data --libdir=${HOME}/lib_perlmutter --mandir=${HOME}/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

# gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on greenplanet
# Personal recipe last modified: 20190526
# Personal recipe last used successfully: 20190526 (no antlr or ncap2)
cd ~/nco;/bin/rm -f *.foo;make distclean
CC='gcc' CXX='g++' LDFLAGS='-L/lib64' ./configure --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

# gcc/g++ 20210215 Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on hpc3:
# Sysadmin upgrade request: 
# Latest ticket to build NCO: never
# Latest sysadmin-compiled module usage: module load nco/4.9.6/gcc.8.4.0 # 20210215
# Personal recipe last modified: 20210215
# Personal recipe last used successfully: 20210215
cd ~/nco;git reset --hard origin/master
module load gcc/8.4.0
CC='gcc' CFLAGS='-Wall -DNCO_ABORT_ON_ERROR' CXX='g++' CXXFLAGS='-Wall' NETCDF_INC="${HOME}/anaconda/include" NETCDF_LIB="${HOME}/anaconda/lib" ./configure --enable-debug-symbols --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1

# 20160421: gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on roger:
# Sysadmin upgrade request: Yan Liu <yanliu@illinois.edu>
# Latest sysadmin-compiled module usage: module load nco/4.6.5 # 20170315
# Personal recipe last modified: 20170424
# Personal recipe last used successfully: 20170424
module load netcdf/4.4.0
module load udunits
cd ~/nco;/bin/rm -f *.foo;make distclean
ANTLR_ROOT=${HOME} ANTLR_LIB=${HOME}/lib CC='gcc' CXX='g++' UDUNITS2_PATH='/sw/udunits-2.1.24' ./configure --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

# gcc/g++ Sysadmins: use this to install/update NCO in /opt/nco
cd ~/nco;/bin/rm -f *.foo;make distclean
./configure --disable-shared --enable-optimize-custom --prefix=/opt/nco > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
sudo make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

# gcc/g++ Sysadmins: use this to install/update NCO in /usr/local
cd ~/nco;/bin/rm -f *.foo;make distclean
./configure --disable-shared --enable-optimize-custom --prefix=/usr/local > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
sudo make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

# g++/g++ Zender uses this to compile NCO with g++ (not recommended!) instead of gcc
cd ~/nco;/bin/rm -f *.foo;make distclean
CC='g++' CXX='g++' ./configure --disable-shared --disable-udunits --enable-optimize-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

# gcc/g++ Zender uses this to compile NCO with GCC and netCDF4
# --enable-optimize-custom fails with netCDF4 which shadows "access" variable
cd ~/nco;/bin/rm -f *.foo;make distclean
CC='gcc' CXX='g++' NETCDF4_ROOT='/usr/local/netcdf4' ./configure --enable-netcdf4 --enable-dap-netcdf --disable-shared --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

gcc/g++ Developers use --enable-maintainer-mode to verify auto-tools work correctly, and to mandate rebuilding of "special files" (ncap_yacc.c, ncap_lex.c) correctly:
(requires complete, up-to-date, GNU development toolchain):
cd ~/nco;/bin/rm -f *.foo;make distclean
aclocal # Create aclocal.m4 from acinclude.m4
autoheader # Create config.h.in from configure.ac
automake --foreign # Create Makefile.in from Makefile.am
autoconf # Create ./configure from ./configure.ac
# Debugging
./configure --disable-shared --enable-debug-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
# Production
./configure --disable-shared --enable-maintainer-mode --enable-optimize-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

como:
cd ~/nco;/bin/rm -f *.foo;make distclean
CC='como --c99' CXX='como' ./configure --disable-shared --enable-optimize-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

icc:
cd ~/nco;/bin/rm -f *.foo;make distclean
CC='icc' CPPFLAGS="-I${IA32ROOT}/include -I${IA32ROOT}/include/c++" CXX='icpc' LDFLAGS="-L${IA32ROOT}/lib" ./configure --disable-shared --enable-optimize-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

pathcc:
cd ~/nco;/bin/rm -f *.foo;make distclean
CC='pathcc' CXX='pathCC' ./configure --disable-shared --enable-optimize-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

pgcc:
cd ~/nco;/bin/rm -f *.foo;make distclean
CC='pgcc' CXX='pgCC' ./configure --disable-shared --enable-optimize-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

pgcc on mpc64.nacs.uci.edu (C-shell environment):
cd ${HOME}/nco;/bin/rm -f *.foo;make distclean
# Bash
ANTLR_ROOT='/software/antlr' CC='pgcc' CXX='pgCC' UDUNITS2_PATH='/software/udunits' ./configure --disable-shared --enable-optimize-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man >&! nco.configure.foo 
# Csh
setenv ANTLR_ROOT '/software/antlr';setenv CC 'pgcc';setenv CXX 'pgCC';setenv UDUNITS2_PATH '/software/udunits';./configure --disable-shared --enable-optimize-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man >&! nco.configure.foo 
# env
env ANTLR_ROOT='/software/antlr' CC='pgcc' CXX='pgCC' PATH=${PATH}\:'/software/netcdf/bin'\:'/software/antlr/bin' UDUNITS2_PATH='/software/udunits' ./configure --disable-shared --enable-optimize-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man >&! nco.configure.foo 
/bin/cp -f config.log nco.config.log.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

# Old machines:
# gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on pileus:
cd ~/nco;/bin/rm -f *.foo;make distclean
ANTLR_ROOT=${HOME} CC='gcc' CXX='g++' NETCDF_ROOT='/opt/ACME/uvcdat-2.2-build/install/Externals' UDUNITS2_PATH='/opt/ACME/uvcdat-2.2-build/install/Externals' ./configure --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

# icc/icpc 20160217 Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on yellowstone:
# Sysadmin upgrade request: cislhelp@ucar.edu
# Latest ticket to build NCO: 172597 on 20170526
# Latest sysadmin-compiled module usage: module load nco/4.6.9 # 20171002
# Personal recipe last modified: 20170812
# Personal recipe last used successfully: 20171108
module add intel/16.0.3;module add gsl;module add netcdf/4.4.1;
export PATH=${PATH}:/glade/apps/opt/netcdf/4.4.1/intel/16.0.3/bin # needed for ncgen
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/glade/apps/opt/netcdf/4.4.1/intel/16.0.3/lib # needed to run NCO
cd ~/nco;git reset --hard origin/master
cd ~/nco/bld;make NETCDF_ROOT='/glade/apps/opt/netcdf/4.4.1/intel/16.0.3' UDUNITS_INC='/glade/apps/opt/udunits/2.1.24/intel/12.1.4/include' UDUNITS_LIB='/glade/apps/opt/udunits/2.1.24/intel/12.1.4/lib' OPTS=D allinone;cd -
************************************************************************
End LINUX
************************************************************************

************************************************************************
Begin NETCDF4
************************************************************************
To build NCO with netCDF4, we require changes from the default process:

- Build HDF5 libraries and install them as you normally would, e.g., in /usr/local

- Identify the installation (--prefix=) directory for netCDF4.
  Keep this separate from the netCDF3 installation because the netCDF4 
  library is still called libnetcdf.a and until netCDF4 is debugged, 
  you'll want both netCDF3 and netCDF4 around.  
  The configure options to use for netCDF4 are:

  ./configure --enable-netcdf4 --enable-dap-netcdf --disable-shared \
  NETCDF4_ROOT=/where/you/unpacked/netcdf4

  Alternatively, you can export an environment variable NETCDF4_ROOT to 
  the same value and the configure script will pick it up.

- As of 20051129, building NCO with netCDF4 and MPI does not work

************************************************************************
End NETCDF4
************************************************************************
cd
/bin/rm -r -f nco
git clone git@github.com:nco/nco.git
cd nco
<configure>
make install
cd ~/nco/data
make
cd ~/nco
************************************************************************
Start LINUXAMD64
Status: Appears to work. Make sure to compile netCDF and DAP with CFLAGS+='-fPIC'
************************************************************************
zender@sand:~/nco/bld$ ./pvmgetarch;uname -a;~/nco/autobld/config.guess
LINUXAMD64
Linux sand.ess.uci.edu 2.6.8.1-4-amd64-generic #1 Thu Dec 16 11:44:05 UTC 2004 x86_64 GNU/Linux
x86_64-unknown-linux-gnu

# gcc/g++ Regular (non-root) users build NCO with system-supplied netCDF and install in your own directories
# Zender uses this on MACOS sastrugi/firn as well
cd ~/nco;/bin/rm -f *.foo;make distclean
# Pre-20180729 (antlr from macports seems to have stopped linking, so build it from scratch)
CC='gcc' CFLAGS='' CXX='g++' CXXFLAGS='' ./configure --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
# Firn 20180729 (works)
ANTLR_ROOT=${HOME} CC='gcc' CFLAGS='' CXX='g++' CXXFLAGS='' ./configure --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
# Sastrugi 20180729 (works with gcc, clang, and icc)
ANTLR_ROOT=${HOME} CC=${LINUX_CC} CFLAGS='-g -Wall -DNCO_ABORT_ON_ERROR' CXX=${LINUX_CXX} CXXFLAGS='-g -Wall -DNCO_ABORT_ON_ERROR' ./configure --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
# Sastrugi 20201215 with CCR, 20210608 update: works with Hombrew, not with MacPorts
ANTLR_ROOT=${HOME} CC=${LINUX_CC} CFLAGS='-g -Wall -DNCO_ABORT_ON_ERROR' CXX=${LINUX_CXX} CXXFLAGS='-g -Wall -DNCO_ABORT_ON_ERROR' ./configure --enable-ccr --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
# Spectral 20220617 with netCDF-dev and no CCR
ANTLR_ROOT=${HOME} CC=${LINUX_CC} CFLAGS='-g -Wall -DNCO_ABORT_ON_ERROR' CPPFLAGS='-I/opt/netcdf/include -I/opt/homebrew/include' CXX=${LINUX_CXX} CXXFLAGS='-g -Wall -DNCO_ABORT_ON_ERROR' LDFLAGS='-L/opt/netcdf/lib -L/opt/homebrew/lib' NETCDF_ROOT=/opt/netcdf ./configure --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
# Spectral 20220624 with netCDF-dev and CCR
ANTLR_ROOT=${HOME} CC=${LINUX_CC} CFLAGS='-g -Wall -DNCO_ABORT_ON_ERROR' CPPFLAGS='-I/opt/netcdf/include -I/opt/homebrew/include' CXX=${LINUX_CXX} CXX=${LINUX_CXX} CXXFLAGS='-g -Wall -DNCO_ABORT_ON_ERROR' LDFLAGS='-L/opt/netcdf/lib -L/opt/homebrew/lib' NETCDF_ROOT=/opt/netcdf ./configure --enable-ccr --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
# Spectral 20220713 old netCDF, no CCR
ANTLR_ROOT=${HOME} CC=${LINUX_CC} CFLAGS='-g -Wall -DNCO_ABORT_ON_ERROR' CXX=${LINUX_CXX} CXXFLAGS='-g -Wall -DNCO_ABORT_ON_ERROR' ./configure --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
# Rigb 20190912 (fxm)
ANTLR_ROOT=${HOME} CC=${LINUX_CC} CFLAGS='' CXX=${LINUX_CXX} CXXFLAGS='' ./configure --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

# gcc/g++ Sysadmins use/modify this to install/update NCO in /usr/local, based on netCDF4 also in /usr/local (works on givre 20100727):
cd ~/nco;/bin/rm -f *.foo;make distclean
CPPFLAGS='-DHAVE_NETCDF4_H -I/usr/local/include' LDFLAGS='-L/usr/local/lib' ./configure --prefix='/usr/local' --enable-ncap2 --enable-netcdf4 > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
sudo make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

# gcc/g++ Zender uses this to debug NCO with pre-built (i.e., yum/dnf install'd or aptitude install'd) netCDF in /usr (glace)
cd ~/nco;/bin/rm -f *.foo;make distclean
CC='gcc' CFLAGS='' CXX='g++' CXXFLAGS='' NETCDF_INC='/usr/include' NETCDF_LIB='/usr/lib' ./configure --enable-debug-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

# gcc/g++ Zender uses this to debug NCO with custom-install netCDF (and ESMF) binaries in /usr/local (grele)
# Personal recipe last modified: 20200601
# Personal recipe last used successfully: 20200601
# cd ~/nco/bld;make GSL=Y OMP=Y OPTS=D UDUNITS=Y allinone

# gcc/g++ Zender uses this to debug NCO with pre-built netCDF binaries in /usr (skyglow, e3sm.ess.uci.edu)
cd ~/nco;/bin/rm -f *.foo;make distclean
# Pre-20170810 GCC7 dies on nco_yyget_leng() prototype with --enable-debug-custom option
#CC='gcc' CFLAGS='' CXX='g++' CXXFLAGS='' NETCDF_INC='/usr/include' NETCDF_LIB='/usr/lib' ./configure --enable-debug-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
# 20170810 Produce core dumps and symbols, turn-on -Wall, without using --enable-debug-custom
#CC='gcc' CFLAGS='-Wall -DNCO_ABORT_ON_ERROR' CXX='g++' CXXFLAGS='-Wall' NETCDF_INC='/usr/include' NETCDF_LIB='/usr/lib' ./configure --enable-debug-symbols --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
# 20191217 Produce core dumps and symbols, turn-on -Wall, without using --enable-debug-custom
CC='gcc' CFLAGS='-Wall -DNCO_ABORT_ON_ERROR' CXX='g++' CXXFLAGS='-Wall' NETCDF_INC='/usr/local/include' NETCDF_LIB='/usr/local/lib' ./configure --enable-debug-symbols --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
# 20210511 Use updated netCDF from Anaconda (failed to find UDUNITS then broke when upgrading anaconda from gcc 9.3 to 11.2, because system still stuck at 9.3?)
CC=${LINUX_CC} CFLAGS='-Wall -DNCO_ABORT_ON_ERROR' CXX=${LINUX_CXX} CXXFLAGS='-Wall' NETCDF_ROOT="${HOME}/anaconda" UDUNITS2_PATH="${HOME}/anaconda/include" ./configure --enable-debug-symbols --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
# 20210511 with CCR: borken due to missing ccr.h
CC=${LINUX_CC} CFLAGS='-Wall -DNCO_ABORT_ON_ERROR' CXX=${LINUX_CXX} CXXFLAGS='-Wall' NETCDF_ROOT="${HOME}/anaconda" UDUNITS2_PATH="${HOME}/anaconda/include" ./configure --enable-ccr --enable-debug-symbols --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
# 20210520 with CCR: borken due to unresolved -lhdf5 -lhdf5_hl -lnetcdff which must be manually linked
CC=${LINUX_CC} CFLAGS="-Wall -DNCO_ABORT_ON_ERROR -I${HOME}/include" CXX=${LINUX_CXX} CXXFLAGS="-Wall -I${HOME}/include" LDFLAGS="-lhdf5 -lhdf5_hl -lnetcdff" NETCDF_ROOT="${HOME}/anaconda" UDUNITS2_PATH="${HOME}/anaconda/include" ./configure --enable-ccr --enable-debug-symbols --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

# gcc/g++ Zender uses this to debug NCO with custom-built netCDF binaries in /usr/local with clang (frazil)
cd ~/nco;/bin/rm -f *.foo;make distclean
# 20170810 Produce core dumps and symbols, turn-on -Wall, without using --enable-debug-custom
CC=${LINUX_CC} CFLAGS='-Wall -DNCO_ABORT_ON_ERROR' CXX=${LINUX_CXX} CXXFLAGS='-Wall' NETCDF_INC='/usr/local/include' NETCDF_LIB='/usr/local/lib' ./configure --enable-debug-symbols --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

# gcc/g++ Zender uses this to debug NCO with system netCDF binaries with clang (frazil)
cd ~/nco;/bin/rm -f *.foo;make distclean
CC=${LINUX_CC} CFLAGS='-Wall -DNCO_ABORT_ON_ERROR' CXX=${LINUX_CXX} CXXFLAGS='-Wall' NETCDF_INC='/usr/include' NETCDF_LIB='/usr/lib64' ./configure --enable-debug-symbols --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

# g++/g++ Zender uses this to compile NCO with _g++_ (not recommended for normal use)
cd ~/nco;/bin/rm -f *.foo;make distclean
CC='g++' CFLAGS='-Wall -DNCO_ABORT_ON_ERROR' CXX='g++' CXXFLAGS='-Wall' NETCDF_INC="${HOME}/anaconda/include" NETCDF_LIB="${HOME}/anaconda/lib" ./configure --enable-ccr --enable-debug-symbols --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

pgcc/pgCC:
cd ~/nco;/bin/rm -f *.foo;make distclean
CC='pgcc' CFLAGS='-fast -fPIC' CXX='pgCC' CXXFLAGS='-fast -fPIC' ./configure --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr
************************************************************************
End LINUXAMD64
************************************************************************

************************************************************************
Start LINUXALPHA
Status: Appears to work (of course C++ compiler requires valarray)
************************************************************************
zender@ess1:/usr/home/zender/nco$ pvmgetarch;uname -a;~/nco/autobld/config.guess
LINUXALPHA
Linux ess1.ess.uci.edu 2.2.15 #1 Thu May 18 17:22:29 EDT 2000 alpha unknown

export GNU_TRP=`~/nco/autobld/config.guess`
cd ~/nco;/bin/rm -f *.foo;make distclean
./configure --enable-optimize-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

zender@usf-cf-alpha-linux-1:~/nco/bld$ ./pvmgetarch;uname -a;~/nco/autobld/config.guess
LINUXALPHA
Linux usf-cf-alpha-linux-1 2.4.17 #1 SMP Fri Jan 4 13:37:30 PST 2002 alpha unknown

export GNU_TRP=`~/nco/autobld/config.guess`
cd ~/nco;/bin/rm -f *.foo;make distclean
NETCDF_INC=${HOME}/include NETCDF_LIB=${HOME}/lib/${GNU_TRP} ./configure --enable-optimize-custom --prefix=${HOME} --bindir=${HOME}/bin/${GNU_TRP} --datadir=${HOME}/nco/data --libdir=${HOME}/lib/${GNU_TRP} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr
************************************************************************
End LINUXALPHA
************************************************************************

************************************************************************
Start LINUXPPC
Status: tst fails to find in.nc
************************************************************************
zender@usf-cf-ppc-linux-1:~/nco/bld$ ./pvmgetarch;uname -a;~/nco/autobld/config.guess
UNKNOWN
Linux usf-cf-ppc-linux-1 2.2.17-pre1 #2 SMP Fri Jun 16 12:39:25 MDT 2000 ppc unknown

gcc/g++:
export GNU_TRP=`~/nco/autobld/config.guess`
cd ~/nco;/bin/rm -f *.foo;make distclean
NETCDF_INC=${HOME}/include NETCDF_LIB=${HOME}/lib/${GNU_TRP} ./configure --enable-optimize-custom --prefix=${HOME} --bindir=${HOME}/bin/${GNU_TRP} --datadir=${HOME}/nco/data --libdir=${HOME}/lib/${GNU_TRP} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr
************************************************************************
End LINUXPPC
************************************************************************

************************************************************************
Start LINUXSPARC64
Status: Appears to build correctly
************************************************************************
zender@usf-cf-sparc-linux-1:~/nco/bld$ ./pvmgetarch;uname -a;~/nco/autobld/config.guess
UNKNOWN
Linux usf-cf-sparc-linux-1 2.4.18 #2 Thu Apr 11 14:37:17 EDT 2002 sparc64 unknown

gcc/g++:
export GNU_TRP=`~/nco/autobld/config.guess`
cd ~/nco;/bin/rm -f *.foo;make distclean
NETCDF_INC=${HOME}/include NETCDF_LIB=${HOME}/lib/${GNU_TRP} ./configure --enable-optimize-custom --prefix=${HOME} --bindir=${HOME}/bin/${GNU_TRP} --datadir=${HOME}/nco/data --libdir=${HOME}/lib/${GNU_TRP} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr
************************************************************************
End LINUXSPARC64
************************************************************************

************************************************************************
Start MACOS
Status: works. rorik Thu Oct 30 12:09:15 AKST 2003
MACOS requires netCDF3.x be built with CFLAGS=-fno-common to link with NCO 
This may also be the case for netCDF4.
NCO's configure detects MACOS adds '-fno-common' automatically to CFLAGS
MACOS also requires '--disable-shared' on the configure line
************************************************************************
zender@cg1:~/nco/bld$ ~/sh/pvmgetarch;uname -a;~/nco/autobld/config.guess
MACOS
Darwin cg1.calit2.uci.edu 8.2.0 Darwin Kernel Version 8.2.0: Fri Jun 24 17:46:54 PDT 2005; root:xnu-792.2.4.obj~3/RELEASE_PPC Power Macintosh powerpc
powerpc-apple-darwin8.2.0

gcc/g++:
export PVM_ARCH=`~/nco/bld/pvmgetarch`
export GNU_TRP=`~/nco/autobld/config.guess`
cd ~/nco;/bin/rm -f *.foo;make distclean
NETCDF_INC=${HOME}/include NETCDF_LIB=${HOME}/lib ./configure --disable-regex --disable-shared --prefix=${HOME} --bindir=${HOME}/bin --datadir=${HOME}/nco/data --libdir=${HOME}/lib --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr
************************************************************************
End MACOS
************************************************************************

************************************************************************
Start SGIMP64
Status: -LANG:std not passed to final CC link command for tst.o
************************************************************************
zender@krein:~/nco$ pvmgetarch;uname -a;~/nco/autobld/config.guess
SGIMP64
IRIX64 tempest 6.5 07080049 IP35 mips
mips-sgi-irix6.5

cc/CC ABI64:
export GNU_TRP=`~/nco/autobld/config.guess`
cd ~/nco;/bin/rm -f *.foo;make distclean
CC='cc -c99' CFLAGS='-64 -mips4' CXX='CC -64 -LANG:std' CXXFLAGS='-64 -mips4 -LANG:std' LDFLAGS='-64 -LANG:std' NETCDF_INC='/usr/local/include' UDUNITS2_PATH='/contrib/udunits-1.12.4' ./configure --disable-ncoxx --enable-optimize-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

cc/CC ABI32:
export GNU_TRP=`~/nco/autobld/config.guess`
cd ~/nco;/bin/rm -f *.foo;make distclean
CC='cc -c99' CXX='CC' CXXFLAGS='-LANG:std' LDFLAGS='-LANG:std' NETCDF_INC='/usr/local/include' NETCDF_LIB='/usr/local/lib32/r4i4' UDUNITS2_PATH='/contrib' ./configure --disable-ncoxx --enable-optimize-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

gcc/g++ ABI32:
export GNU_TRP=`~/nco/autobld/config.guess`
cd ~/nco;/bin/rm -f *.foo;make distclean
CC='gcc' CXX='g++' NETCDF_INC='/usr/local/include' ./configure --disable-ncoxx --enable-optimize-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr
************************************************************************
End SGIMP64
************************************************************************

************************************************************************
Start SUNMP
Status:
Works fine with native compilers
************************************************************************
zender@flagstaff:~/nco$ pvmgetarch;uname -a;~/nco/autobld/config.guess
SUNMP
SunOS goldhill 5.9 Generic_117171-12 sun4u sparc SUNW,Ultra-60
sparc-sun-solaris2.9

For ABI=64:
cc/CC:
export GNU_TRP=`~/nco/autobld/config.guess`
cd ~/nco;/bin/rm -f *.foo;make distclean
CC='/opt/SUNWspro/bin/cc' CPPFLAGS='-DNC_64BIT_OFFSET=0' CXX='/opt/SUNWspro/bin/CC' ./configure --enable-optimize-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

For ABI=32:
cc/CC:
export GNU_TRP=`~/nco/autobld/config.guess`
cd ~/nco;/bin/rm -f *.foo;make distclean
CC='/opt/SUNWspro/bin/cc' CPPFLAGS='-DNC_64BIT_OFFSET=0' CXX='/opt/SUNWspro/bin/CC' LD='/usr/ccs/bin/ld -z muldefs' LDFLAGS='-z muldefs -L/opt/SUNWspro/lib' ./configure --enable-optimize-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr

gcc/g++:
export GNU_TRP=`~/nco/autobld/config.guess`
cd ~/nco;/bin/rm -f *.foo;make distclean
CC='gcc' CPPFLAGS='-DNC_64BIT_OFFSET=0' CXX='g++' ./configure --enable-optimize-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr
************************************************************************
End SUNMP
************************************************************************

