From 7e8dc5b2aeffe98a6a7fd91dbb8e93ced1e3369c Mon Sep 17 00:00:00 2001 From: Tony Craig Date: Thu, 10 Aug 2023 13:06:41 -0700 Subject: [PATCH] Update conda_macos to fix problems with Github Actions testing (#853) * test ghactions * update master to main in github actions --- .github/workflows/test-cice.yml | 43 +++++++++++++++---- .../scripts/machines/Macros.conda_macos | 10 +++-- 2 files changed, 41 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test-cice.yml b/.github/workflows/test-cice.yml index 70fdc4c14..b04ca1714 100644 --- a/.github/workflows/test-cice.yml +++ b/.github/workflows/test-cice.yml @@ -7,7 +7,7 @@ name: GHActions on: push: branches: - - master + - main - 'CICE*' - 'ghactions*' pull_request: @@ -27,8 +27,12 @@ jobs: matrix: # os: [macos-latest, ubuntu-latest] os: [macos-latest] +# os: [macos-13] # os: [ubuntu-latest] include: +# - os: macos-13 +# envdef: macos +# minicond: Miniconda3-latest-MacOSX-x86_64.sh - os: macos-latest envdef: macos minicond: Miniconda3-latest-MacOSX-x86_64.sh @@ -98,10 +102,26 @@ jobs: conda env create -f configuration/scripts/machines/environment.yml - name: check conda env run: | - conda activate cice && which mpicc && which mpifort && which make + conda activate cice && which clang && which gfortran && which mpicc && which mpifort && which make + clang --version + gfortran --version mpifort --version mpicc --version make --version +# echo "mpifort -v:" +# mpifort -v +# echo "mpifort --showme:compile:" +# mpifort --showme:compile +# echo "mpifort --showme:link:" +# mpifort --showme:link +# echo "mpifort --showme:command:" +# mpifort --showme:command +# echo "mpifort --showme:libdirs:" +# mpifort --showme:libdirs +# echo "mpifort --showme:libs:" +# mpifort --showme:libs +# echo "mpifort --showme:incdirs:" +# mpifort --showme:incdirs - name: check setup case run: | cd $HOME/cice @@ -110,12 +130,19 @@ jobs: run: | cd $HOME/cice ./cice.setup -m conda -e ${{ matrix.envdef }} --test smoke --testid c0 -# - name: compile case -# run: | -# cd $HOME/cice -# ./cice.setup -m conda -e ${{ matrix.envdef }} -c case1 -# cd case1 -# ./cice.build + - name: run hello world unit test + run: | + cd $HOME/cice + ./cice.setup -m conda -e ${{ matrix.envdef }} --test unittest --pes 2x1 -s helloworld --testid hw01 + cd *helloworld*hw01 + ./cice.build + ./cice.run + - name: check cice compile + run: | + cd $HOME/cice + ./cice.setup -m conda -e ${{ matrix.envdef }} -c case1 --pes 2x2 -s diag1 + cd case1 + ./cice.build - name: download input data run: | cd $HOME/cice-dirs/input diff --git a/configuration/scripts/machines/Macros.conda_macos b/configuration/scripts/machines/Macros.conda_macos index 9be1b9ab4..fad87507c 100644 --- a/configuration/scripts/machines/Macros.conda_macos +++ b/configuration/scripts/machines/Macros.conda_macos @@ -22,8 +22,10 @@ endif # C and Fortran compilers and MPI wrappers SCC := clang SFC := gfortran -MPICC := mpicc -MPIFC := mpifort +#MPICC := mpicc +#MPIFC := mpifort +MPICC := clang +MPIFC := gfortran ifeq ($(ICE_COMMDIR), mpi) FC := $(MPIFC) @@ -37,7 +39,7 @@ endif LD:= $(FC) # Location of the compiled Fortran modules (NetCDF) -MODDIR += -I$(CONDA_PREFIX)/include +MODDIR += -I$(CONDA_PREFIX)/include -I$(CONDA_PREFIX)/lib # Location of the system C header files (required on recent macOS to compile makdep) SDKPATH = $(shell xcrun --show-sdk-path) @@ -49,7 +51,7 @@ else endif # Libraries to be passed to the linker -SLIBS := -L$(CONDA_PREFIX)/lib -lnetcdf -lnetcdff -llapack +SLIBS := -L$(CONDA_PREFIX)/lib -lnetcdf -lnetcdff -llapack -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi # Necessary flag to compile with OpenMP support ifeq ($(ICE_THREADED), true)