From 257298291f6e79f274557ccba13576411f87bb51 Mon Sep 17 00:00:00 2001 From: Aidan Heerdegen Date: Mon, 3 Sep 2018 10:25:41 +1000 Subject: [PATCH] Fix ACCESS-CM test build (#245) * Added CM2 compilation config files * Include OASIS build in travis * Convert OASIS github to https URL * Travis: Don't allow ACCESS-CM build to fail * Travis: prepend travis build directory to OASIS_ROOT * Travis: removed some warnings to reduce console output * Travis: fixed OASIS include paths * Travis: add back in other tests --- .travis.yml | 7 +- bin/environs.access-cm2-188 | 12 +++ bin/mkmf.template.access-cm2-188 | 157 +++++++++++++++++++++++++++++++ bin/mkmf.template.travis | 14 ++- 4 files changed, 185 insertions(+), 5 deletions(-) create mode 100644 bin/environs.access-cm2-188 create mode 100644 bin/mkmf.template.access-cm2-188 diff --git a/.travis.yml b/.travis.yml index 78ac7794b2..ff1072d466 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,17 +20,22 @@ env: global: - FC=gfortran-4.8 - OMPI_FC=${FC} + - OASIS_ROOT=$TRAVIS_BUILD_DIR/oasis3-mct/Linux matrix: allow_failures: - env: TYPE=ACCESS-OM - - env: TYPE=ACCESS-CM + # - env: TYPE=ACCESS-CM install: - sudo apt-add-repository --yes ppa:ubuntu-toolchain-r/test - sudo apt-get update - sudo apt-get install csh gcc-4.8 gfortran-4.8 libgomp1 openmpi-bin libopenmpi-dev libnetcdf-dev netcdf-bin +before_script: + - git clone --depth=1 https://github.com/OceansAus/oasis3-mct.git + - (cd oasis3-mct && make ubuntu) + script: - cd exp && ./MOM_compile.csh --type $TYPE --platform travis --use_netcdf4 diff --git a/bin/environs.access-cm2-188 b/bin/environs.access-cm2-188 new file mode 100644 index 0000000000..9d51f816a7 --- /dev/null +++ b/bin/environs.access-cm2-188 @@ -0,0 +1,12 @@ +source /etc/profile.d/nf_csh_modules +module purge +module load intel-fc/15.0.3.187 +module load intel-cc/15.0.3.187 +module load intel-mkl/15.0.3.187 +module load openmpi/1.8.8 +module load netcdf/4.3.2 +#module load hdf5/1.8.13 + +# Use prebuild Oasis3-mct library for ACCESS-CM2/nci +#setenv OASIS_ROOT ~access/access-cm2/prebuild/oasis3-mct/Linux-182 +setenv OASIS_ROOT /short/p66/hxy599/ACCESS/submodels/oasis3-mct_local/Linux-188 diff --git a/bin/mkmf.template.access-cm2-188 b/bin/mkmf.template.access-cm2-188 new file mode 100644 index 0000000000..83fe0919ed --- /dev/null +++ b/bin/mkmf.template.access-cm2-188 @@ -0,0 +1,157 @@ +# Template for the NCI (nf.nci.org.au) machines. Uses intel compiler and OpenMPI. +# typical use with mkmf +# mkmf -t template.ifc -c"-Duse_libMPI -Duse_netCDF" path_names /usr/local/include +############ +# commands # +############ +ifeq ($(VTRACE), yes) + FC = mpifort-vt + LD = mpifort-vt +else + FC = mpifort + LD = mpifort +endif + +CC = mpicc + +######### +# flags # +######### +REPRO = +VERBOSE = +OPT = on + +MAKEFLAGS += --jobs=4 + +INCLUDE = -I$(NETCDF_ROOT)/include \ + -I$(OASIS_ROOT)/include/psmile.MPI1 \ + -I$(OASIS_ROOT)/include/pio \ + -I$(OASIS_ROOT)/include/mct + +FPPFLAGS := -fpp -Wp,-w $(INCLUDE) +FFLAGS := -fno-alias -safe-cray-ptr -fpe0 -ftz -assume byterecl -i4 -r8 -traceback -nowarn -check noarg_temp_created -assume buffered_io -convert big_endian +FFLAGS_OPT = -O3 -debug minimal -xHost +FFLAGS_DEBUG = -g -O0 -debug all -check -check noarg_temp_created -check nopointer -warn -warn noerrors -ftrapuv +FFLAGS_REPRO = -O2 -debug minimal -no-vec -fp-model precise +FFLAGS_VERBOSE = -v -V -what + +CFLAGS := -D__IFC $(INCLUDE) +CFLAGS_OPT = -O2 -debug minimal -no-vec +CFLAGS_DEBUG = -O0 -g -ftrapuv -traceback + +LDFLAGS := +LDFLAGS_VERBOSE := -Wl,-V,--verbose,-cref,-M + +ifneq ($(REPRO),) +CFLAGS += $(CFLAGS_REPRO) +FFLAGS += $(FFLAGS_REPRO) +endif + +ifneq ($(DEBUG),) +CFLAGS += $(CFLAGS_DEBUG) +FFLAGS += $(FFLAGS_DEBUG) +else +CFLAGS += $(CFLAGS_OPT) +FFLAGS += $(FFLAGS_OPT) +endif + +ifneq ($(VERBOSE),) +CFLAGS += $(CFLAGS_VERBOSE) +FFLAGS += $(FFLAGS_VERBOSE) +LDFLAGS += $(LDFLAGS_VERBOSE) +endif + +LIBS := -L$(NETCDF_ROOT)/lib -lnetcdf -lnetcdff \ + -L$(OASIS_ROOT)/lib -lpsmile.MPI1 -lmct -lmpeu -lscrip \ + +LDFLAGS += $(LIBS) + +#--------------------------------------------------------------------------- +# you should never need to change any lines below. + +# see the MIPSPro F90 manual for more details on some of the file extensions +# discussed here. +# this makefile template recognizes fortran sourcefiles with extensions +# .f, .f90, .F, .F90. Given a sourcefile ., where is one of +# the above, this provides a number of default actions: + +# make .opt create an optimization report +# make .o create an object file +# make .s create an assembly listing +# make .x create an executable file, assuming standalone +# source +# make .i create a preprocessed file (for .F) +# make .i90 create a preprocessed file (for .F90) + +# The macro TMPFILES is provided to slate files like the above for removal. + +RM = rm -f +SHELL = /bin/csh -f +TMPFILES = .*.m *.B *.L *.i *.i90 *.l *.s *.mod *.opt + +.SUFFIXES: .F .F90 .H .L .T .f .f90 .h .i .i90 .l .o .s .opt .x + +.f.L: + $(FC) $(FFLAGS) -c -listing $*.f +.f.opt: + $(FC) $(FFLAGS) -c -opt_report_level max -opt_report_phase all -opt_report_file $*.opt $*.f +.f.l: + $(FC) $(FFLAGS) -c $(LIST) $*.f +.f.T: + $(FC) $(FFLAGS) -c -cif $*.f +.f.o: + $(FC) $(FFLAGS) -c $*.f +.f.s: + $(FC) $(FFLAGS) -S $*.f +.f.x: + $(FC) $(FFLAGS) -o $*.x $*.f *.o $(LDFLAGS) +.f90.L: + $(FC) $(FFLAGS) -c -listing $*.f90 +.f90.opt: + $(FC) $(FFLAGS) -c -opt_report_level max -opt_report_phase all -opt_report_file $*.opt $*.f90 +.f90.l: + $(FC) $(FFLAGS) -c $(LIST) $*.f90 +.f90.T: + $(FC) $(FFLAGS) -c -cif $*.f90 +.f90.o: + $(FC) $(FFLAGS) -c $*.f90 +.f90.s: + $(FC) $(FFLAGS) -c -S $*.f90 +.f90.x: + $(FC) $(FFLAGS) -o $*.x $*.f90 *.o $(LDFLAGS) +.F.L: + $(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c -listing $*.F +.F.opt: + $(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c -opt_report_level max -opt_report_phase all -opt_report_file $*.opt $*.F +.F.l: + $(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c $(LIST) $*.F +.F.T: + $(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c -cif $*.F +.F.f: + $(FC) $(CPPDEFS) $(FPPFLAGS) -EP $*.F > $*.f +.F.i: + $(FC) $(CPPDEFS) $(FPPFLAGS) -P $*.F +.F.o: + $(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c $*.F +.F.s: + $(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c -S $*.F +.F.x: + $(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -o $*.x $*.F *.o $(LDFLAGS) +.F90.L: + $(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c -listing $*.F90 +.F90.opt: + $(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c -opt_report_level max -opt_report_phase all -opt_report_file $*.opt $*.F90 +.F90.l: + $(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c $(LIST) $*.F90 +.F90.T: + $(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c -cif $*.F90 +.F90.f90: + $(FC) $(CPPDEFS) $(FPPFLAGS) -EP $*.F90 > $*.f90 +.F90.i90: + $(FC) $(CPPDEFS) $(FPPFLAGS) -P $*.F90 +.F90.o: + $(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c $*.F90 +.F90.s: + $(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c -S $*.F90 +.F90.x: + $(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -o $*.x $*.F90 *.o $(LDFLAGS) diff --git a/bin/mkmf.template.travis b/bin/mkmf.template.travis index 84c1390053..d947c767fe 100644 --- a/bin/mkmf.template.travis +++ b/bin/mkmf.template.travis @@ -16,13 +16,19 @@ LD = mpif90 $(MAIN_PROGRAM) MAKEFLAGS += --jobs=$(shell grep '^processor' /proc/cpuinfo | wc -l) -FPPFLAGS := +INCLUDE := -I$(shell nc-config --includedir) \ + -I$(OASIS_ROOT)/build/lib/psmile.MPI1 \ + -I$(OASIS_ROOT)/build/lib/scrip \ + -I$(OASIS_ROOT)/build/lib/scrip \ + -I$(OASIS_ROOT)/build/lib/mct -FFLAGS := -O2 -fcray-pointer -fdefault-real-8 -ffree-line-length-none -fno-range-check -Waliasing -Wampersand -Warray-bounds -Wcharacter-truncation -Wconversion -Wline-truncation -Wintrinsics-std -Wsurprising -Wno-tabs -Wunderflow -Wintrinsic-shadow -Wno-align-commons -I/usr/include/openmpi -I/usr/include -DGFORTRAN +FPPFLAGS := $(INCLUDE) -CFLAGS := -D__IFC -O2 $(shell nc-config --cflags) -I/usr/include/openmpi +FFLAGS := -O2 -fcray-pointer -fdefault-real-8 -ffree-line-length-none -fno-range-check -W -LIBS := $(shell nc-config --flibs) -lpthread +CFLAGS := -D__IFC -O2 $(shell nc-config --cflags) -I/usr/include/openmpi $(INCLUDE) + +LIBS := $(shell nc-config --flibs) -lpthread -L$(OASIS_ROOT)/lib -lpsmile.MPI1 -lmct -lmpeu -lscrip LDFLAGS += $(LIBS) #---------------------------------------------------------------------------