-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
include mkl libraries for intel on linux and MacOS #81
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense to fail, given we aim to support all intel versions and runner images barring a few exceptions. In general I think we should fail if we can't satisfy the user's selected configuration.
On the other hand, we don't fail with
compiler: intel
on mac, we just fall back tointel-classic
. Maybe there is an argument for changing this.There is also the question of what to do if the user requests MKL with a non-intel compiler. I would say fail in that case too?