@@ -4,44 +4,126 @@ on: [push, pull_request]
44
55jobs :
66 Build :
7- runs-on : [ubuntu-latest]
7+ name : ${{ matrix.compiler }}-${{ matrix.version }} (${{ matrix.os }})
8+ runs-on : ${{ matrix.os }}
9+ defaults :
10+ run :
11+ shell : bash
12+ strategy :
13+ fail-fast : false
14+ matrix :
15+ os : [ macos-14, macos-15, macos-15-intel, macos-26, ubuntu-24.04 ]
16+ compiler : [ gfortran ]
17+ version : [ 14 ]
18+ extra_flags : [ -g ]
19+ oc_version : [ 2.10.3 ]
20+
21+ include :
22+ - os : ubuntu-24.04
23+ compiler : gfortran
24+ version : 13
25+ extra_flags : -g -ffree-line-length-0
26+ oc_version : 2.10.3
827
928 env :
10- FC : gfortran
11- GCC_V : 14
29+ COMPILER_VERSION : ${{ matrix.version }}
30+ OC_VERSION : ${{ matrix.oc_version }}
31+ FC : ${{ matrix.compiler }}
32+ FFLAGS : ${{ matrix.extra_flags }}
33+ FPM_FLAGS : --profile release --verbose
1234
1335 steps :
1436 - name : Checkout code
1537 uses : actions/checkout@v4
1638
1739 - name : Install fpm
18- uses : fortran-lang/setup-fpm@v7
40+ uses : fortran-lang/setup-fpm@main
1941 with :
2042 github-token : ${{ secrets.GITHUB_TOKEN }}
43+ fpm-version : latest
2144
2245 - name : Get Time
2346 id : time
24- uses : nanzm/get-time-action@v1.1
47+ uses : nanzm/get-time-action@master
2548 with :
2649 format : ' YYYY-MM'
2750
28- - name : Setup cache for opencoarrays
51+ - name : Install macOS Dependencies
52+ if : ${{ contains(matrix.os, 'macos') && matrix.compiler == 'gfortran' && matrix.version == 14 }}
53+ run : |
54+ set -x
55+ brew update
56+ # fpm binary distribution for macOS requires gfortran shared libraries from gcc@12
57+ brew install -v gcc@12
58+ brew install -v opencoarrays gcc@14 open-mpi
59+ #brew --prefix
60+ #ls -alR $(brew --prefix)/bin
61+ echo "FC=gfortran-${COMPILER_VERSION}" >> "$GITHUB_ENV"
62+
63+ - name : Install Ubuntu Native Dependencies
64+ if : ${{ contains(matrix.os, 'ubuntu') && matrix.container == '' && matrix.compiler == 'gfortran' }}
65+ run : |
66+ set -x
67+ sudo apt update
68+ sudo apt install -y build-essential pkg-config make
69+ sudo apt install -y gfortran-${COMPILER_VERSION} g++-${COMPILER_VERSION}
70+
71+ - name : OpenCoarrays/MPICH Cache
72+ if : ${{ contains(matrix.os, 'ubuntu') && matrix.container == '' }}
2973 id : cache-opencoarrays
30- uses : actions/cache@v3
74+ uses : actions/cache@v4
3175 with :
32- path : " OpenCoarrays-2.10.2/ "
33- key : ${{ steps.time.outputs.time }}
76+ path : OpenCoarrays-${{ matrix.oc_version }}
77+ key : OpenCoarrays-${{ matrix.oc_version }}-${{ matrix.compiler }}-${{ matrix.version }}-${{ matrix.os }}- ${{ steps.time.outputs.time }}
3478
35- - name : Install GFortran, OpenCoarrays
79+ - name : OpenCoarrays/MPICH Build
80+ if : ${{ steps.cache-opencoarrays.outputs.cache-hit != 'true' && contains(matrix.os, 'ubuntu') && matrix.container == '' }}
3681 run : |
37- sudo apt update
38- sudo apt install -y build-essential gfortran-${GCC_V} g++-${GCC_V} pkg-config make
39- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
40- --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
41- --slave /usr/bin/g++ g++ /usr/bin/g++-${GCC_V}
42- if [ ! -d OpenCoarrays-2.10.2 ] ; then wget -P . https://github.com/sourceryinstitute/OpenCoarrays/releases/download/2.10.2/OpenCoarrays-2.10.2.tar.gz && tar -xf OpenCoarrays-2.10.2.tar.gz && cd OpenCoarrays-2.10.2 && TERM=xterm ./install.sh -y; fi
82+ set -x
83+ rm -Rf OpenCoarrays-${OC_VERSION}
84+ #OC_URL=https://github.com/sourceryinstitute/OpenCoarrays/releases/download/${OC_VERSION}/OpenCoarrays-${OC_VERSION}.tar.gz
85+ OC_URL=https://github.com/sourceryinstitute/OpenCoarrays/archive/refs/tags/${OC_VERSION}.tar.gz
86+ wget -P . ${OC_URL}
87+ tar -xf ${OC_VERSION}.tar.gz
88+ cd OpenCoarrays-${OC_VERSION}
89+ TERM=xterm ./install.sh --yes-to-all \
90+ --with-fortran gfortran-${COMPILER_VERSION} \
91+ --with-cxx g++-${COMPILER_VERSION} \
92+ --with-c gcc-${COMPILER_VERSION}
93+
94+ - name : Setup Ubuntu Compilers
95+ if : ${{ contains(matrix.os, 'ubuntu') && matrix.container == '' && matrix.compiler == 'gfortran' }}
96+ run : |
97+ set -x
98+ PREFIX="$PWD/OpenCoarrays-${OC_VERSION}/prerequisites/installations"
99+ OC_PATH="$PREFIX/opencoarrays/${OC_VERSION}"
100+ MPI_PATH=$(ls -d $PREFIX/mpich/*)
101+ #ls -alR ${PREFIX}
102+ cat ${OC_PATH}/setup.sh
103+ echo "PATH=${OC_PATH}/bin:${MPI_PATH}/bin:$PATH" >> "$GITHUB_ENV"
104+ echo "FC=gfortran-${COMPILER_VERSION}" >> "$GITHUB_ENV"
105+ echo "FPM_FFLAGS=${FFLAGS}" >> "$GITHUB_ENV"
106+ echo "FPM_CFLAGS=${CFLAGS}" >> "$GITHUB_ENV"
107+ echo "FPM_CXXFLAGS=${CXXFLAGS}" >> "$GITHUB_ENV"
108+ echo "FPM_LDFLAGS=${LDFLAGS}" >> "$GITHUB_ENV"
109+
110+ - name : Version info
111+ run : |
112+ echo == TOOL VERSIONS ==
113+ echo Platform version info:
114+ uname -a
115+ if test -r /etc/os-release ; then grep -e NAME -e VERSION /etc/os-release ; fi
116+ if test -x /usr/bin/sw_vers ; then /usr/bin/sw_vers ; fi
117+ echo
118+ echo PATH="$PATH"
119+ for tool in ${FC} caf mpicc mpif90 fpm ; do
120+ ( echo ; set -x ; w=$(which $tool) ; \
121+ if test -n "$w" ; then \
122+ ls -al $w ; ls -alhL $w ; $tool --version || echo ERROR=$? ; \
123+ fi )
124+ done
43125
44126 - name : Build, run, and test
45127 run : |
46- source OpenCoarrays-2.10.2 /prerequisites/installations/opencoarrays/2.10.2 /setup.sh
47- fpm test --compiler caf --runner "cafrun -n 2"
128+ # source OpenCoarrays-${OC_VERSION} /prerequisites/installations/opencoarrays/${OC_VERSION} /setup.sh
129+ fpm test --compiler caf --runner "cafrun -n 2" ${FPM_FLAGS}
0 commit comments