Skip to content

Instantly share code, notes, and snippets.

@massich
Last active February 22, 2021 07:01
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save massich/caa7d8806ac08282f93cea00f247b8e0 to your computer and use it in GitHub Desktop.
Save massich/caa7d8806ac08282f93cea00f247b8e0 to your computer and use it in GitHub Desktop.
This script is used to install Intel MKL
#!/bin/sh
# This script installs Intel's Math Kernel Library (MKL) on Travis (both Linux and Mac)
#
# In .travis.yml, add this:
#
# - curl -fsSkL https://gist.githubusercontent.com/massich/caa7d8806ac08282f93cea00f247b8e0/raw > install_mkl.sh && source ./install_mkl.sh
#
# Note:
# This script requires the openmeeg's travis tools from https://gist.github.com/massich/f382ec0181ce6603b38208f9dec3e4d4
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
export MKL_INSTALL_DIR=$(pwd)/intel
export ARCH_FNAME=l_mkl_2018.0.128.tgz
travis_wait 30 download http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/12070/${ARCH_FNAME}
tar -xzf $DL_DIR/${ARCH_FNAME}
cat l_mkl_2018.0.128/silent.cfg | grep -v EULA | grep -v PSET_INSTALL_DIR > silent.cfg
echo "ACCEPT_EULA=accept" >> silent.cfg
echo "PSET_INSTALL_DIR=${MKL_INSTALL_DIR}" >> silent.cfg
./l_mkl_2018.0.128/install.sh --user-mode -s ./silent.cfg
export LD_LIBRARY_PATH="${MKL_INSTALL_DIR}/mkl/lib/intel64/:${LD_LIBRARY_PATH}"
. ${MKL_INSTALL_DIR}/mkl/bin/mklvars.sh intel64 ilp64
else # Mac
export MKL_INSTALL_DIR=/opt/intel
export ARCH_FNAME=m_mkl_2017.4.220.dmg
travis_wait 30 download http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/12185/${ARCH_FNAME}
hdiutil attach $DL_DIR/${ARCH_FNAME}
cat /Volumes/m_mkl_2017.4.220/m_mkl_2017.4.220.app/Contents/MacOS/silent.cfg | grep -v EULA | grep -v PSET_INSTALL_DIR > silent.cfg
echo "ACCEPT_EULA=accept" >> silent.cfg
echo "PSET_INSTALL_DIR=${MKL_INSTALL_DIR}" >> silent.cfg
sudo /Volumes/m_mkl_2017.4.220/m_mkl_2017.4.220.app/Contents/MacOS/install.sh -s ./silent.cfg
. /opt/intel/mkl/bin/mklvars.sh intel64 ilp64
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment