Skip to content

Commit

Permalink
Merge pull request ESCOMP#13 from ESCOMP/add-github-actions
Browse files Browse the repository at this point in the history
Create extbuild.yml
  • Loading branch information
jedwards4b authored Aug 7, 2020
2 parents 32cb41d + fbb0e1e commit 2fa1125
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 2 deletions.
110 changes: 110 additions & 0 deletions .github/workflows/extbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# This is a basic workflow to help you get started with Actions
name: extbuild
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Build the ESMF library, if the cache contains a previous build it will be used instead
build-cdeps:
runs-on: ubuntu-latest
env:
CC: mpicc
FC: mpifort
CXX: mpicxx
CPPFLAGS: "-I/usr/include -I/usr/local/include"
steps:
- uses: actions/checkout@v2
- id: cache-esmf
uses: actions/cache@v2
with:
path: ~/ESMF
key: ${{ runner.os }}-ESMF
- id: load-env
run: sudo apt-get install gfortran wget openmpi-bin netcdf-bin libopenmpi-dev

- id: build-ESMF
if: steps.cache-esmf.outputs.cache-hit != 'true'
run: |
wget https://github.com/esmf-org/esmf/archive/ESMF_8_1_0_beta_snapshot_25.tar.gz
tar -xzvf ESMF_8_1_0_beta_snapshot_25.tar.gz
pushd esmf-ESMF_8_1_0_beta_snapshot_25
export ESMF_DIR=`pwd`
export ESMF_COMM=openmpi
export ESMF_YAMLCPP="internal"
export ESMF_INSTALL_PREFIX=$HOME/ESMF
export ESMF_BOPT=g
make
make install
popd
- id: cache-pnetcdf
uses: actions/cache@v2
with:
path: ~/pnetcdf
key: ${{ runner.os }}-pnetcdf
- name: pnetcdf build
if: steps.cache-pnetcdf.outputs.cache-hit != 'true'
run: |
wget https://parallel-netcdf.github.io/Release/pnetcdf-1.12.1.tar.gz
tar -xzvf pnetcdf-1.12.1.tar.gz
ls -l
pushd pnetcdf-1.12.1
./configure --prefix=$HOME/pnetcdf --enable-shared --disable-cxx
make
make install
popd
- name: Cache netcdf-fortran
id: cache-netcdf-fortran
uses: actions/cache@v2
with:
path: ~/netcdf-fortran
key: ${{ runner.os }}-netcdf-fortran
- name: netcdf fortran build
if: steps.cache-netcdf-fortran.outputs.cache-hit != 'true'
run: |
sudo apt-get install libnetcdf-dev
wget https://github.com/Unidata/netcdf-fortran/archive/v4.5.2.tar.gz
tar -xzvf v4.5.2.tar.gz
ls -l
pushd netcdf-fortran-4.5.2
./configure --prefix=$HOME/netcdf-fortran
make
make install
- name: Cache PIO
id: cache-PIO
uses: actions/cache@v2
with:
path: ~/pio
key: ${{ runner.os }}-pio
restore-keys: |
${{ runner.os }}-netcdf-fortran
${{ runner.os }}-pnetcdf
- name: Build PIO
if: steps.cache-PIO.outputs.cache-hit != 'true'
run: |
wget https://github.com/NCAR/ParallelIO/releases/download/pio_2_5_1/pio-2.5.1.tar.gz
tar -xzvf pio-2.5.1.tar.gz
mkdir build-pio
pushd build-pio
cmake -Wno-dev -DNetCDF_C_LIBRARY=/usr/lib/x86_64-linux-gnu/libnetcdf.so -DNetCDF_C_INCLUDE_DIR=/usr/include -DCMAKE_PREFIX_PATH=/usr -DCMAKE_INSTALL_PREFIX=$HOME/pio -DPIO_HDF5_LOGGING=On -DPIO_USE_MALLOC=On -DPIO_ENABLE_LOGGING=On -DPIO_ENABLE_TIMING=Off -DNetCDF_Fortran_PATH=$HOME/netcdf-fortran -DPnetCDF_PATH=$HOME/pnetcdf ../pio-2.5.1
make VERBOSE=1
make install
popd
- name: Build CDEPS
run: |
export ESMFMKFILE=$HOME/ESMF/lib/libg/Linux.gfortran.64.openmpi.default/esmf.mk
export PIO=$HOME/pio
git submodule init
git submodule update
mkdir build-cdeps
pushd build-cdeps
cmake -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_Fortran_FLAGS="-g -Wall -ffree-form -ffree-line-length-none" ../
make VERBOSE=1
popd
1 change: 0 additions & 1 deletion cime_config/buildlib
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ logger = logging.getLogger(__name__)
def buildlib(bldroot, libroot, case, compname=None):
if bldroot.endswith("obj") and not compname:
compname = os.path.basename(os.path.abspath(os.path.join(bldroot,os.pardir)))
print "HERE compname is {} libroot={} bldroot={}".format(compname, libroot, bldroot)

if case.get_value("DEBUG"):
strdebug = "debug"
Expand Down
2 changes: 1 addition & 1 deletion docn/ocn_comp_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ subroutine docn_comp_run(importState, exportState, clock, target_ymd, target_tod
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case('sst_aquap_analytic')
call docn_datamode_aquaplanet_advance(exportstate, model_mesh, sst_option=aquap_option, rc=rc)
if (chkerr(rc,__line__,u_file_u)) return
if (ChkErr(rc,__LINE__,u_file_u)) return
case('sst_aquap_constant')
call docn_datamode_aquaplanet_advance(exportState, model_mesh, sst_constant_value=sst_constant_value, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
Expand Down

0 comments on commit 2fa1125

Please sign in to comment.