Skip to content

run win src from channel input #65

run win src from channel input

run win src from channel input #65

name: ci-code-aster-src-win
# bump 1
on:
workflow_dispatch:
inputs:
manual:
description: 'Run workflow manually'
default: true
type: boolean
channel:
description: 'Conda channel'
default: 'code-aster-dev'
type: string
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.1'
- 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
condarc: |
channel_priority: strict
channels:
- ${{ secrets.QUETZ_URL }}/get/${{ inputs.channel }}
- conda-forge
create-args: >-
python=3.11
vswhere
libblas=*=*mkl
mfront=4.2.0
mgis=2.2
mkl-devel
libmed=4.1.1
mumps=5.6.2
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