Skip to content

minpack compiled with GFortran on macOS #7

minpack compiled with GFortran on macOS

minpack compiled with GFortran on macOS #7

name: GFortran on macOS
run-name: minpack compiled with GFortran on macOS
on:
push:
paths-ignore:
- "**/*.md"
- "doc/**"
pull_request:
paths-ignore:
- "**/*.md"
- "doc/**"
jobs:
build:
runs-on: macos-latest
strategy:
matrix:
USE_DOWNLOAD: ['OFF']
CMAKE_BUILD_TYPE: ['Release', 'Debug']
BUILD_SHARED_LIBS: ['ON', 'OFF']
BUILD_STATIC_LIBS: ['ON', 'OFF']
exclude:
- BUILD_SHARED_LIBS: 'OFF'
BUILD_STATIC_LIBS: 'OFF'
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";
}
- name: Set shell variables to build and install directories
run: |
echo "BUILDDIR=$RUNNER_TEMP/build" >> $GITHUB_ENV
echo "INSTALLDIR=$RUNNER_TEMP/install-gfortran" >> $GITHUB_ENV
echo "FC=$(brew --prefix gcc)/bin/gfortran" >> $GITHUB_ENV
- name: Configure the build of minpack
run: cmake -G "Unix Makefiles" -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 $INSTALLDIR -S minpack-builder -B $BUILDDIR
- name: Build minpack
run: cmake --build $BUILDDIR --config ${{ matrix.CMAKE_BUILD_TYPE }}
- name: Install minpack
run: cmake --install $BUILDDIR --config ${{ matrix.CMAKE_BUILD_TYPE }}