NorESMhub / BLOM

Bergen Layered Ocean Model
GNU Lesser General Public License v3.0
16 stars 25 forks source link

macos CI build with openmp breaks after BLOM code refactorization #358

Closed TomasTorsvik closed 5 days ago

TomasTorsvik commented 6 days ago

Testing PR #317 results in an error in mod_diapfl.F90 when compiling with openmp enabled. The error is triggerede by the first block of !$omp parallel do private on line 96, and is seemingly caused by issues internal to (or a combination of) macos-latest/gcc12/openmp.

Error message:

[274/306] Compiling Fortran object blom.p/phy_mod_diapfl.F90.o
FAILED: blom.p/phy_mod_diapfl.F90.o blom.p/mod_diapfl.mod 
gfortran-12 -Iblom.p -I. -I.. -Iphy -I../phy -I/opt/homebrew/Cellar/netcdf-fortran/4.6.1/include -I -I/opt/homebrew/Cellar/netcdf/4.9.2_1/include -fdiagnostics-color=always -Wall -Wextra -O2 -g -fdefault-real-8 -fconvert=big-endian -fbacktrace -fcheck=all -finit-real=snan -ffpe-trap=invalid,zero,overflow -DMKS -DTRC -DTKE -DTKEADV -DIDLAGE -DLEVITUS2X -fopenmp -Jblom.p -o blom.p/phy_mod_diapfl.F90.o -c ../phy/mod_diapfl.F90
f951: Warning: Nonexistent include directory '-I/opt/homebrew/Cellar/netcdf/4.9.2_1/include' [-Wmissing-include-dirs]
/var/folders/b3/2xm02wpd21qgrpkck5q1c6k40000gn/T//ccW0lzAM.s:627196:29: error: unexpected token in '.section' directive
        .section .data.rel.ro.local

Possibly relevant github issue: https://github.com/iains/gcc-darwin-arm64/issues/107

As it does not seem to be a code error, and it is apparent that this test will fail under the current configuration, I suggest to disable this test. I would make a PR on this after the BLOM code refactorization has been merged, as to make the CI change distinct from other code changes.