-
Notifications
You must be signed in to change notification settings - Fork 0
217 lines (176 loc) · 6.47 KB
/
ci-code-aster-src-win.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
name: ci-code-aster-src-win
# bump 1
on:
workflow_dispatch:
inputs:
manual:
description: 'Run workflow manually'
default: true
type: boolean
push:
paths:
- '.github/workflows/ci-code-aster-src-win.yml'
env:
INTEL_VARS_PATH: C:\Program Files (x86)\Intel\oneAPI\compiler\latest\env
VS_VARS_PATH: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build
CONDA_ROOT: C:\Users\runneradmin\micromamba
PYTHON_ENV_NAME: codeaster-deps
BUILD_LOCATION: D:\a\condapackaging\condapackaging\build\std
jobs:
build:
runs-on: windows-latest
defaults:
run:
shell: cmd /C call {0}
steps:
- name: Checkout code-aster/src
run: |
git clone -b win-support https://gitlab.com/krande/src.git .
- uses: awvwgk/setup-fortran@v1 # https://github.com/awvwgk/setup-fortran
id: setup-fortran
with:
compiler: intel
version: '2024.0'
- uses: mamba-org/setup-micromamba@v1 # https://github.com/mamba-org/setup-micromamba
with:
#environment-file: conda/environment.win.yml
#cache-environment: true
environment-name: codeaster-deps
init-shell: >-
cmd.exe
bash
condarc: |
channel_priority: strict
channels:
- ${{ secrets.QUETZ_URL }}/get/code-aster-dev
- conda-forge
create-args: >-
python=3.11
vswhere
libblas=*=*mkl
mfront=4.2.0
mgis=2.2
mkl-devel
libmed=4.1.1
medcoupling=9.12.0
scotch=7.0.4
metis=5.1.0
waf=2.0.27
pyyaml
python-dotenv
clang=18.1.5
clangxx=18.1.5
lld=18.1.5
- name: print all env vars
run: |
where python
printenv
- name: write to .env file
shell: python
run: |
import os
conda_prefix = os.environ.get('CONDA_PREFIX')
intel_vars_path = os.environ.get('INTEL_VARS_PATH')
vs_vars_path = os.environ.get('VS_VARS_PATH')
python_env_name = os.environ.get('PYTHON_ENV_NAME')
with open('.env', 'w') as f:
f.write(f'CONDA_PREFIX={conda_prefix}\n')
f.write(f'INTEL_VARS_PATH={intel_vars_path}\n')
f.write(f'VS_VARS_PATH={vs_vars_path}\n')
f.write(f'PYTHON_ENV_NAME={python_env_name}\n')
- name: run conda_build.bat
continue-on-error: true
# if not input.manual then run conda_build.bat
if: ${{ !inputs.manual }}
run: |
call conda_build.bat
- name: run manually
continue-on-error: true
if: ${{ inputs.manual }}
run: |
set CLICOLOR_FORCE=1
echo "Setting compiler env vars"
set "CC=clang-cl.exe"
set "CXX=clang-cl.exe"
set "FC=ifx.exe"
where python
where cl
where ifx
set PREFIX=%CONDA_PREFIX%
set LIBRARY_PREFIX=%CONDA_PREFIX%/Library
SET PARENT_DIR=%~dp0
SET PARENT_DIR=%PARENT_DIR:\=/%
SET OUTPUT_DIR=%PARENT_DIR%/build/std
SET OUTPUT_DIR=%OUTPUT_DIR:\=/%
set ASTER_PLATFORM_MSVC=1
set ASTER_PLATFORM_WINDOWS=1
set MKLROOT=%LIBRARY_PREFIX%
SET MKLROOT=%MKLROOT:\=/%
SET LIB_PATH_ROOT=%LIBRARY_PREFIX:\=/%
SET PREF_ROOT=%PREFIX:\=/%
set LIBPATH_HDF5=%LIB_PATH_ROOT%/lib
set INCLUDES_HDF5=%LIB_PATH_ROOT%/include
set LIBPATH_MED=%LIB_PATH_ROOT%/lib
set INCLUDES_MED=%LIB_PATH_ROOT%/include
set LIBPATH_METIS=%LIB_PATH_ROOT%/lib
set INCLUDES_METIS=%LIB_PATH_ROOT%/include
set LIBPATH_MUMPS=%LIB_PATH_ROOT%/lib
set "INCLUDES_MUMPS=%LIB_PATH_ROOT%/include %LIB_PATH_ROOT%/include/mumps_seq"
set LIBPATH_SCOTCH=%LIB_PATH_ROOT%/lib
set INCLUDES_SCOTCH=%LIB_PATH_ROOT%/include
set TFELHOME=%LIB_PATH_ROOT%
set LIBPATH_MGIS=%LIB_PATH_ROOT%/bin
set INCLUDES_MGIS=%LIB_PATH_ROOT%/include
REM Compiler flags
REM /MD link with MSVCRT.lib. /FS allow for multithreaded c compiler calls to vc140.pdb (for cl.exe only)
set CFLAGS=%CFLAGS% /FS /MD
set CXXFLAGS=%CXXFLAGS% /MD
set FCFLAGS=%FCFLAGS% /fpp /MD
set FCFLAGS=%FCFLAGS% /names:lowercase /assume:underscore /assume:nobscc
set LDFLAGS=%LDFLAGS% /LIBPATH:%LIB_PATH_ROOT%/lib /LIBPATH:%LIB_PATH_ROOT%/bin /LIBPATH:%PREF_ROOT%/libs ^
pthread.lib libomp.lib medfwrap.lib hdf5.lib metis.lib ^
MFrontGenericInterface.lib scotch.lib scotcherr.lib ^
mkl_intel_lp64_dll.lib mkl_intel_thread_dll.lib mkl_core_dll.lib /FORCE:MULTIPLE
@REM set CCLINKFLAGS=%CCLINKFLAGS% /LIBPATH:%LIB_PATH_ROOT%/lib
set INCLUDES_BIBC=%PREF_ROOT%/include %PARENT_DIR%/bibfor/include %INCLUDES_BIBC%
set DEFINES=H5_BUILT_AS_DYNAMIC_LIB
REM Clean the build directory
waf distclean
REM Install for standard sequential
waf configure ^
--safe ^
--check-fortran-compiler=ifort ^
--use-config-dir=%PARENT_DIR%/config/ ^
--med-libs=medC ^
--prefix=%LIBRARY_PREFIX% ^
--out=%OUTPUT_DIR% ^
--disable-mpi ^
--disable-mumps ^
--install-tests ^
--maths-libs=auto ^
--without-hg
waf install_debug -v
- name: print bibfor log file
continue-on-error: true
run: |
REM try except
type ${{ env.BUILD_LOCATION }}\debug\asterbibfor.log
working-directory: build
- name: print bibc log file
continue-on-error: true
run: |
REM try except
type ${{ env.BUILD_LOCATION }}\debug\asterbibc.log
working-directory: build
- name: print bibcxx log file
continue-on-error: true
run: |
REM try except
type ${{ env.BUILD_LOCATION }}\debug\asterbibcxx.log
working-directory: build
- name: print config log file
continue-on-error: true
run: |
REM try except
type ${{ env.BUILD_LOCATION }}\config.log
working-directory: build