diff --git a/action.yml b/action.yml index 0a0fb76..b6416bc 100644 --- a/action.yml +++ b/action.yml @@ -92,6 +92,7 @@ runs: echo "FC=${FC}" >> $GITHUB_ENV echo "CC=${CC}" >> $GITHUB_ENV echo "CXX=${CXX}" >> $GITHUB_ENV + echo "MKLLIB=${MKLLIB}" >> $GITHUB_ENV # save oneAPI cache and activate environment - name: Save cache @@ -134,6 +135,7 @@ runs: echo FC=$FC>>$GITHUB_ENV echo CC=$CC>>$GITHUB_ENV echo CXX=$CXX>>$GITHUB_ENV + echo "MKLLIB=$MKLLIB" >> $GITHUB_ENV # set fpm env vars echo FPM_FC=$FC>>$GITHUB_ENV @@ -144,6 +146,7 @@ runs: echo fc=$FC>>$GITHUB_OUTPUT echo cc=$CC>>$GITHUB_OUTPUT echo cxx=$CXX>>$GITHUB_OUTPUT + echo MKLLIB=$MKLLIB>>$GITHUB_OUTPUT # GitHub Actions prepends GNU linker to the PATH before all bash steps, hide it so MSVC linker is found - name: Hide GNU linker (Windows) diff --git a/install-mkl-macos.sh b/install-mkl-macos.sh new file mode 100644 index 0000000..e360b18 --- /dev/null +++ b/install-mkl-macos.sh @@ -0,0 +1,22 @@ +MACOS_BASEKIT_URL=$1 + +if [ "$MACOS_BASEKIT_URL" == "" ]; then + echo "ERROR: MACOS_BASEKIT_URL is empty - please check the version mapping for MKL" + echo "SKIPPING MKL installation..." +elif [ "$MACOS_BASEKIT_URL" == "2021.5" ]; then + echo "ERROR: MKL not available for this intel compiler version" + echo "SKIPPING MKL installation..." +else + require_fetch + $fetch $MACOS_BASEKIT_URL > m_BASEKit.dmg + ls -lh + hdiutil verify m_BASEKit.dmg + hdiutil attach m_BASEKit.dmg + sudo /Volumes/"$(basename "$MACOS_BASEKIT_URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s \ + --action install \ + --eula=accept \ + --continue-with-optional-error=yes \ + --log-dir=. + hdiutil detach /Volumes/"$(basename "$MACOS_BASEKIT_URL" .dmg)" -quiet + rm m_BASEKit.dmg +fi \ No newline at end of file diff --git a/setup-fortran.sh b/setup-fortran.sh index bb2f787..c009582 100755 --- a/setup-fortran.sh +++ b/setup-fortran.sh @@ -171,10 +171,9 @@ LD_LIBRARY_PATH=$LD_LIBRARY_PATH LIBRARY_PATH=$LIBRARY_PATH INFOPATH=$INFOPATH MANPATH=$MANPATH -MKLLIB=$MKLLIB MKLROOT=$MKLROOT -DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH ONEAPI_ROOT=$ONEAPI_ROOT +MKLLIB=$MKLLIB CLASSPATH=$CLASSPATH CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH OCL_ICD_FILENAMES=$OCL_ICD_FILENAMES @@ -397,21 +396,6 @@ install_intel_apt() fi source /opt/intel/oneapi/setvars.sh - # these exports have been removed in later versions of the action? - if $classic; then - export FC="ifort" - export CC="icc" - export CXX="icpc" - else - export FC="ifx" - export CC="icx" - export CXX="icpx" - fi - if $install_mkl; then - export MKLLIB="$ONEAPI_ROOT/mkl/latest/lib/intel64" - export MKLROOT="$ONEAPI_ROOT/mkl/latest" - fi - export_intel_vars } @@ -480,23 +464,7 @@ install_intel_dmg() esac if $install_mkl; then - if [ "$MACOS_BASEKIT_URL" == "" ]; then - echo "ERROR: MACOS_BASEKIT_URL is empty - please check the version mapping for MKL" - echo "SKIPPING MKL installation..." - else - require_fetch - $fetch $MACOS_BASEKIT_URL > m_BASEKit.dmg - ls -lh - hdiutil verify m_BASEKit.dmg - hdiutil attach m_BASEKit.dmg - sudo /Volumes/"$(basename "$MACOS_BASEKIT_URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s \ - --action install \ - --eula=accept \ - --continue-with-optional-error=yes \ - --log-dir=. - hdiutil detach /Volumes/"$(basename "$MACOS_BASEKIT_URL" .dmg)" -quiet - rm m_BASEKit.dmg - fi + source "$GITHUB_ACTION_PATH/install-mkl-macos.sh" $MACOS_BASEKIT_URL fi require_fetch @@ -512,18 +480,6 @@ install_intel_dmg() rm m_HPCKit.dmg source /opt/intel/oneapi/setvars.sh - - # these exports have been removed in later versions of the action? - export FC="ifort" - export CC="icc" - export CXX="icpc" - - if $install_mkl; then - export MKLLIB="$ONEAPI_ROOT/mkl/latest/lib" - export MKLROOT="$ONEAPI_ROOT/mkl/latest" - export DYLD_LIBRARY_PATH="$MKLLIB":$DYLD_LIBRARY_PATH - fi - export_intel_vars } @@ -579,9 +535,11 @@ install_intel() local platform=$1 local classic=$2 local install_mkl=$3 + mkl_subdir="" case $platform in linux*) install_intel_apt $version $classic $install_mkl + mkl_subdir="intel64" ;; darwin*) install_intel_dmg $version $install_mkl @@ -610,6 +568,11 @@ install_intel() export CC="icx" export CXX="icpx" fi + + if $install_mkl; then + export MKLLIB="$ONEAPI_ROOT/mkl/latest/lib/$mkl_subdir" + export MKLROOT="$ONEAPI_ROOT/mkl/latest" + fi } export_nvidiahpc_vars()