forked from damask-multiphysics/DAMASK
-
Notifications
You must be signed in to change notification settings - Fork 0
160 lines (131 loc) · 5.16 KB
/
Fortran.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Grid and Mesh Solver
on: [push]
env:
PETSC_VERSION: '3.18.4'
HOMEBREW_NO_ANALYTICS: 'ON' # Make Homebrew installation a little quicker
HOMEBREW_NO_AUTO_UPDATE: 'ON'
HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: 'ON'
HOMEBREW_NO_GITHUB_API: 'ON'
HOMEBREW_NO_INSTALL_CLEANUP: 'ON'
jobs:
gcc_ubuntu:
runs-on: ubuntu-22.04
strategy:
matrix:
gcc_v: [9, 10, 11, 12]
fail-fast: false
env:
GCC_V: ${{ matrix.gcc_v }}
steps:
- uses: actions/checkout@v3
- name: GCC - Install
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y gcc-${GCC_V} gfortran-${GCC_V} g++-${GCC_V}
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
--slave /usr/bin/g++ g++ /usr/bin/g++-${GCC_V} \
--slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}
- name: PETSc - Cache download
id: petsc-download
uses: actions/cache@v3
with:
path: download
key: petsc-${{ env.PETSC_VERSION }}.tar.gz
- name: PETSc - Download
if: steps.petsc-download.outputs.cache-hit != 'true'
run: |
wget -q https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-${PETSC_VERSION}.tar.gz -P download
- name: PETSc - Prepare
run: |
tar -xf download/petsc-${PETSC_VERSION}.tar.gz -C .
export PETSC_DIR=${PWD}/petsc-${PETSC_VERSION}
export PETSC_ARCH=gcc${GCC_V}
printenv >> $GITHUB_ENV
- name: PETSc - Cache Installation
id: petsc-install
uses: actions/cache@v3
with:
path: petsc-${{ env.PETSC_VERSION }}
key: petsc-${{ env.PETSC_VERSION }}-gcc${{ matrix.gcc_v }}-${{ hashFiles('**/petscversion.h') }}
- name: PETSc - Installation
run: |
cd petsc-${PETSC_VERSION}
./configure --with-fc=gfortran --with-cc=gcc --with-cxx=g++ \
--download-openmpi --download-fftw --download-hdf5 --download-hdf5-fortran-bindings=1 --download-zlib \
--with-mpi-f90module-visibility=1
make all
- name: DAMASK - Compile
run: |
cmake -B build/grid -DDAMASK_SOLVER=grid -DCMAKE_INSTALL_PREFIX=${PWD}
cmake --build build/grid --parallel
cmake --install build/grid
cmake -B build/mesh -DDAMASK_SOLVER=mesh -DCMAKE_INSTALL_PREFIX=${PWD}
cmake --build build/mesh --parallel
cmake --install build/mesh
- name: DAMASK - Run
run: |
./bin/DAMASK_grid -l tensionX.yaml -g 20grains16x16x16.vti -m material.yaml -w examples/grid
./bin/DAMASK_mesh -h
intel:
runs-on: ubuntu-22.04
container:
image: intel/oneapi-hpckit:latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Intel - Install
run: |
sudo apt-get update
sudo apt-get install \
cmake
printenv >> $GITHUB_ENV
- name: PETSc - Cache download
id: petsc-download
uses: actions/cache@v3
with:
path: download
key: petsc-${{ env.PETSC_VERSION }}.tar.gz
- name: PETSc - Download
if: steps.petsc-download.outputs.cache-hit != 'true'
run: |
wget -q https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-${PETSC_VERSION}.tar.gz -P download
- name: PETSc - Prepare
run: |
tar -xf download/petsc-${PETSC_VERSION}.tar.gz -C .
sed -i "1719s/if not os.path.isfile(os.path.join(self.packageDir,'configure')):/if True:/g" \
./petsc-${PETSC_VERSION}/config/BuildSystem/config/package.py
export PETSC_DIR=${PWD}/petsc-${PETSC_VERSION}
export PETSC_ARCH=intel
printenv >> $GITHUB_ENV
- name: PETSc - Cache installation
id: petsc-install
uses: actions/cache@v3
with:
path: petsc-${{ env.PETSC_VERSION }}
key: petsc-${{ env.PETSC_VERSION }}-intel-${{ hashFiles('**/petscversion.h') }}
- name: PETSc - Install
run: |
cd petsc-${PETSC_VERSION}
./configure \
--with-fc='mpiifort -fc=ifx' \
--with-cc='mpiicc -cc=icx' \
--with-cxx='mpiicpc -cxx=icpx' \
--download-fftw --download-hdf5 --download-hdf5-fortran-bindings=1 --download-zlib
make all
# ifx has issue with openMP
# https://community.intel.com/t5/Intel-Fortran-Compiler/ifx-ICE-and-SEGFAULT/m-p/1459877
- name: DAMASK - Compile
run: |
cmake -B build/grid -DDAMASK_SOLVER=grid -DCMAKE_INSTALL_PREFIX=${PWD} -DOPENMP=OFF
cmake --build build/grid --parallel
cmake --install build/grid
cmake -B build/mesh -DDAMASK_SOLVER=mesh -DCMAKE_INSTALL_PREFIX=${PWD} -DOPENMP=OFF
cmake --build build/mesh --parallel
cmake --install build/mesh
- name: DAMASK - Run
run: |
./bin/DAMASK_grid -l tensionX.yaml -g 20grains16x16x16.vti -m material.yaml -w examples/grid
./bin/DAMASK_mesh -h