-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
212 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Test mkl | ||
description: Test installation of mkl libraries | ||
inputs: | ||
compiler: | ||
description: "Toolchain or compiler to install" | ||
required: true | ||
version: | ||
description: "Version of toolchain or compiler" | ||
required: true | ||
install_mkl: | ||
description: "If MKL should be installed along with the compiler" | ||
required: false | ||
default: "false" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Test compile and link mkl (bash) | ||
working-directory: test | ||
shell: bash | ||
run: | | ||
# check settings if mkl tests should be run | ||
# mkl cannot be installed for 2021.5 on macos; | ||
# and for macos-14 also not 2021.6-2021.9 | ||
mkl_tests=true | ||
echo "$RUNNER_OS" | ||
if [[ "${{ inputs.compiler }}" =~ "gcc" ]]; then mkl_tests=false; fi | ||
if [[ "${{ inputs.compiler }}" =~ "lfortran" ]]; then mkl_tests=false; fi | ||
if [[ "${{ inputs.compiler }}" =~ "nvidia" ]]; then mkl_tests=false; fi | ||
if [[ "${{ inputs.install_mkl }}" == "false" ]]; then mkl_tests=false; fi | ||
if [[ "${{ inputs.version }}" == "2021.5" ]] && [[ "$RUNNER_OS" == "macOS" ]]; then mkl_tests=false; fi | ||
if [[ "$RUNNER_OS" == "macOS" ]]; then | ||
macos_version=$(sw_vers | grep "ProductVersion") | ||
echo "$macos_version" | ||
if [[ "$macos_version" =~ "14." ]] && [[ "${{ inputs.version }}" == '2021.6' || "${{ inputs.version }}" == '2021.7' || "${{ inputs.version }}" == '2021.7.1' || "${{ inputs.version }}" == '2021.8' ]]; then | ||
mkl_tests=false | ||
fi | ||
fi | ||
# # now we know if we should, run the tests | ||
if $mkl_tests; then | ||
if [ "$RUNNER_OS" == "macOS" ]; then | ||
MKLLIB="$MKLROOT/lib" | ||
export DYLD_LIBRARY_PATH="$MKLLIB:$DYLD_LIBRARY_PATH" | ||
elif [ "$RUNNER_OS" == "Linux" ]; then | ||
MKLLIB="$MKLROOT/latest/lib/intel64" | ||
export LD_LIBRARY_PATH="$MKLLIB:$LD_LIBRARY_PATH" | ||
fi | ||
linking="-L$MKLLIB -lmkl_intel_lp64 -lmkl_sequential -lmkl_core" | ||
# hello world with blas call program | ||
${{ env.FC }} $args $linking -o hw_mkl hw_mkl.f90 | ||
output=$(./hw_mkl '2>&1') | ||
[[ "$output" == *"hello world 9.00000000000000"* ]] && echo "$output" || (echo "Unexpected Fortran program 'hw_mkl' output: $output"; exit 1) | ||
rm hw_mkl | ||
else | ||
echo "Skipping MKL tests" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
install_mkl=$1 | ||
MACOS_URL=$2 | ||
if [ "$MACOS_URL" == "" ]; then | ||
echo "ERROR: MACOS URL is empty - please check the version mapping for mkl/intel compiler" | ||
echo "SKIPPING MKL/intel installation..." | ||
elif [ "$MACOS_URL" == "2021.5" ] and $install_mkl; then | ||
echo "ERROR: MKL not available for this intel compiler version" | ||
echo "SKIPPING MKL installation..." | ||
else | ||
require_fetch | ||
$fetch $MACOS_URL > m_BASE_HPC_Kit.dmg | ||
hdiutil verify m_BASE_HPC_Kit.dmg | ||
hdiutil attach m_BASE_HPC_Kit.dmg | ||
sudo /Volumes/"$(basename "$MACOS_URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s \ | ||
--action install \ | ||
--eula=accept \ | ||
--continue-with-optional-error=yes \ | ||
--log-dir=. | ||
hdiutil detach /Volumes/"$(basename "$MACOS_URL" .dmg)" -quiet | ||
rm m_BASE_HPC_Kit.dmg | ||
fi |
Oops, something went wrong.