Skip to content

minpack compiled with LLVM flang (MSVC-like) on Windows #29

minpack compiled with LLVM flang (MSVC-like) on Windows

minpack compiled with LLVM flang (MSVC-like) on Windows #29

name: LLVM flang (MSVC-like) on Windows
run-name: minpack compiled with LLVM flang (MSVC-like) on Windows
on:
push:
paths-ignore:
- "**/*.md"
- "doc/**"
pull_request:
paths-ignore:
- "**/*.md"
- "doc/**"
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
USE_DOWNLOAD: ['OFF']
CMAKE_BUILD_TYPE: ['Release', 'Debug']
BUILD_SHARED_LIBS: ['ON']
BUILD_STATIC_LIBS: ['OFF']
C_COMPILER: ['clang-cl', 'cl']
steps:
- name: Restore assets
id: restore-assets
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: assets-cache
key: minpack-assets
enableCrossOsArchive: true
- name: Checkout assets
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
if: ${{ matrix.USE_DOWNLOAD=='OFF' && steps.restore-assets.outputs.cache-hit != 'true' }}
with:
ref: assets-ci-v1
path: assets
- name: Place minpack sources in the cache directory
if: ${{ matrix.USE_DOWNLOAD=='OFF' && steps.restore-assets.outputs.cache-hit != 'true' }}
shell: pwsh
run: |
New-Item "assets-cache" -ItemType Directory | Out-Null;
foreach ($current_file in "disclaimer", "chkder.f", "dogleg.f", "dpmpar.f", "enorm.f", "fdjac1.f", "fdjac2.f", "hybrd1.f", "hybrd.f", "hybrj1.f", "hybrj.f", "lmder1.f", "lmder.f", "lmdif1.f", "lmdif.f", "lmpar.f", "lmstr1.f", "lmstr.f", "qform.f", "qrfac.f", "qrsolv.f", "r1mpyq.f", "r1updt.f", "rwupdt.f")
{
$filePath = Join-Path -Path "assets" -ChildPath $current_file;
Copy-Item -Path $filePath -Destination "assets-cache";
}
- name: Save assets
if: ${{ matrix.USE_DOWNLOAD=='OFF' && steps.restore-assets.outputs.cache-hit != 'true' }}
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: assets-cache
key: minpack-assets
enableCrossOsArchive: true
- name: Checkout repository to minpack-builder directory
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
path: minpack-builder
- name: Place minpack sources in the correct directory for minpack-builder
if: ${{ matrix.USE_DOWNLOAD=='OFF' }}
shell: pwsh
run: |
foreach ($current_file in "disclaimer", "chkder.f", "dogleg.f", "dpmpar.f", "enorm.f", "fdjac1.f", "fdjac2.f", "hybrd1.f", "hybrd.f", "hybrj1.f", "hybrj.f", "lmder1.f", "lmder.f", "lmdif1.f", "lmdif.f", "lmpar.f", "lmstr1.f", "lmstr.f", "qform.f", "qrfac.f", "qrsolv.f", "r1mpyq.f", "r1updt.f", "rwupdt.f")
{
$filePath = Join-Path -Path "assets-cache" -ChildPath $current_file;
Copy-Item -Path $filePath -Destination "minpack-builder";
}
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
name: Setup MSVC
- name: Restore conda environment
id: restore-conda-env
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: minpack-builder-environment
key: flang
- name: Create conda environment
if: ${{ steps.restore-conda-env.outputs.cache-hit != 'true' }}
run: |
& "$env:CONDA\shell\condabin\conda-hook.ps1";
conda create --yes -c conda-forge -p minpack-builder-environment ninja flang_win-64 flang-rt_win-64;
- name: Save conda environment
if: ${{ steps.restore-conda-env.outputs.cache-hit != 'true' }}
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: minpack-builder-environment
key: flang
- name: Setup conda environment and set FC, CC and CXX environment variables.
run: |
& "$env:CONDA\shell\condabin\conda-hook.ps1";
conda activate "${{ github.workspace }}\minpack-builder-environment";
Get-ChildItem env: | Where-Object { $_.Name.ToLower().Contains("conda") -or $_.Value.ToLower().Contains("conda") } | ForEach-Object { Add-Content $env:GITHUB_ENV ($_.Name + "=" + $_.Value); }
Add-Content $env:GITHUB_ENV "FC=flang";
Add-Content $env:GITHUB_ENV "CC=${{ matrix.C_COMPILER }}";
Add-Content $env:GITHUB_ENV "CXX=${{ matrix.C_COMPILER }}";
- name: Set environment variables to build and install directories
run: |
Add-Content $env:GITHUB_ENV "BUILDDIR=$env:RUNNER_TEMP\build"
Add-Content $env:GITHUB_ENV "INSTALLDIR=$env:RUNNER_TEMP\install"
- name: Configure the build of minpack
run: cmake -G Ninja -DBUILD_SHARED_LIBS=${{ matrix.BUILD_SHARED_LIBS }} -DBUILD_STATIC_LIBS=${{ matrix.BUILD_STATIC_LIBS }} -DCMAKE_BUILD_TYPE=${{ matrix.CMAKE_BUILD_TYPE }} -DUSE_DOWNLOAD=${{ matrix.USE_DOWNLOAD }} --install-prefix $env:INSTALLDIR -S minpack-builder -B $env:BUILDDIR
- name: Build minpack
run: cmake --build $env:BUILDDIR --config ${{ matrix.CMAKE_BUILD_TYPE }}
- name: Install minpack
run: cmake --install $env:BUILDDIR --config ${{ matrix.CMAKE_BUILD_TYPE }}