3 # Install Intel Parallel Studio on Travis CI
4 # https://github.com/nemequ/icc-travis
6 # Originally written for Squash <https://github.com/quixdb/squash> by
7 # Evan Nemerson. For documentation, bug reports, support requests,
8 # etc. please use <https://github.com/nemequ/icc-travis>.
10 # To the extent possible under law, the author(s) of this script have
11 # waived all copyright and related or neighboring rights to this work.
12 # See <https://creativecommons.org/publicdomain/zero/1.0/> for
15 # Tools - Not very useful in non-interactive mode.
16 COMPONENTS_VTUNE
="intel-vtune-amplifier-xe-2016-cli__x86_64;intel-vtune-amplifier-xe-2016-common__noarch;intel-vtune-amplifier-xe-2016-cli-common__noarch;intel-vtune-amplifier-xe-2016-collector-64linux__x86_64;intel-vtune-amplifier-xe-2016-sep__noarch;intel-vtune-amplifier-xe-2016-gui-common__noarch;intel-vtune-amplifier-xe-2016-gui__x86_64;intel-vtune-amplifier-xe-2016-common-pset__noarch"
17 COMPONENTS_INSPECTOR
="intel-inspector-xe-2016-cli__x86_64;intel-inspector-xe-2016-cli-common__noarch;intel-inspector-xe-2016-gui-common__noarch;intel-inspector-xe-2016-gui__x86_64;intel-inspector-xe-2016-cli-pset__noarch"
18 COMPONENTS_ADVISOR
="intel-advisor-xe-2016-cli__x86_64;intel-advisor-xe-2016-cli-common__noarch;intel-advisor-xe-2016-gui-common__noarch;intel-advisor-xe-2016-gui__x86_64;intel-advisor-xe-2016-cli-pset__noarch"
19 COMPONENTS_GDB
="intel-gdb-gt__x86_64;intel-gdb-gt-src__noarch;intel-gdb-gt-libelfdwarf__x86_64;intel-gdb-gt-devel__x86_64;intel-gdb-gt-common__noarch;intel-gdb-ps-cdt__x86_64;intel-gdb-ps-cdt-source__x86_64;intel-gdb-ps-mic__x86_64;intel-gdb-ps-mpm__x86_64;intel-gdb__x86_64;intel-gdb-source__noarch;intel-gdb-python-source__noarch;intel-gdb-common__noarch;intel-gdb-ps-common__noarch"
22 COMPONENTS_MPI
="intel-mpi-rt-core__x86_64;intel-mpi-rt-mic__x86_64;intel-mpi-sdk-core__x86_64;intel-mpi-sdk-mic__x86_64;intel-mpi-psxe__x86_64;intel-mpi-rt-psxe__x86_64"
23 COMPONENTS_TBB
="intel-tbb-libs__noarch;intel-mkl-ps-tbb__x86_64;intel-mkl-ps-tbb-devel__x86_64;intel-mkl-ps-tbb-mic__x86_64;intel-mkl-ps-tbb-mic-devel__x86_64;intel-tbb-source__noarch;intel-tbb-devel__noarch;intel-tbb-common__noarch;intel-tbb-ps-common__noarch;intel-tbb-psxe__noarch"
24 COMPONENTS_MKL
="intel-mkl__x86_64;intel-mkl-ps__x86_64;intel-mkl-common__noarch;intel-mkl-ps-common__noarch;intel-mkl-devel__x86_64;intel-mkl-ps-mic-devel__x86_64;intel-mkl-ps-f95-devel__x86_64;intel-mkl-gnu-devel__x86_64;intel-mkl-ps-gnu-devel__x86_64;intel-mkl-ps-pgi-devel__x86_64;intel-mkl-sp2dp-devel__x86_64;intel-mkl-ps-cluster-devel__x86_64;intel-mkl-ps-cluster-common__noarch;intel-mkl-ps-f95-common__noarch;intel-mkl-ps-cluster__x86_64;intel-mkl-gnu__x86_64;intel-mkl-ps-gnu__x86_64;intel-mkl-ps-pgi__x86_64;intel-mkl-sp2dp__x86_64;intel-mkl-ps-mic__x86_64;intel-mkl-ps-tbb__x86_64;intel-mkl-ps-tbb-devel__x86_64;intel-mkl-ps-tbb-mic__x86_64;intel-mkl-ps-tbb-mic-devel__x86_64;intel-mkl-psxe__noarch"
25 COMPONENTS_IPP
="intel-ipp-l-common__noarch;intel-ipp-l-ps-common__noarch;intel-ipp-l-st__x86_64;intel-ipp-l-mt__x86_64;intel-ipp-l-st-devel__x86_64;intel-ipp-l-ps-st-devel__x86_64;intel-ipp-l-mt-devel__x86_64;intel-ipp-psxe__noarch"
26 COMPONENTS_IPP_CRYPTO
="intel-crypto-ipp-st-devel__x86_64;intel-crypto-ipp-ps-st-devel__x86_64;intel-crypto-ipp-st__x86_64;intel-crypto-ipp-mt-devel__x86_64;intel-crypto-ipp-mt__x86_64;intel-crypto-ipp-ss-st-devel__x86_64;intel-crypto-ipp-common__noarch"
27 COMPONENTS_DAAL
="intel-daal__x86_64;intel-daal-common__noarch"
30 COMPONENTS_OPENMP
="intel-openmp-l-all__x86_64;intel-openmp-l-ps-mic__x86_64;intel-openmp-l-ps__x86_64;intel-openmp-l-ps-ss__x86_64;intel-openmp-l-all-devel__x86_64;intel-openmp-l-ps-mic-devel__x86_64;intel-openmp-l-ps-devel__x86_64;intel-openmp-l-ps-ss-devel__x86_64"
31 COMPONENTS_COMPILER_COMMON
="intel-comp-l-all-vars__noarch;intel-comp-l-all-common;intel-comp-l-ps-common;intel-comp-l-all-devel;intel-comp-l-ps-ss-devel;intel-comp-l-ps-ss-wrapper;intel-comp-l-all-devel;intel-comp-l-ps-devel__x86_64;intel-comp-l-ps-ss-devel__x86_64;intel-psf-intel__x86_64;intel-icsxe-pset;intel-ipsf__noarch;intel-ccompxe__noarch;${COMPONENTS_OPENMP}"
32 COMPONENTS_IFORT
="intel-ifort-l-ps__x86_64;intel-ifort-l-ps-vars__noarch;intel-ifort-l-ps-common__noarch;intel-ifort-l-ps-devel__x86_64;${COMPONENTS_COMPILER_COMMON}"
33 COMPONENTS_ICC
="intel-icc-l-all__x86_64;intel-icc-l-ps-ss__x86_64;intel-icc-l-all-vars__noarch;intel-icc-l-all-common__noarch;intel-icc-l-ps-common__noarch;intel-icc-l-all-devel__x86_64;intel-icc-l-ps-devel__x86_64;intel-icc-l-ps-ss-devel__x86_64;${COMPONENTS_COMPILER_COMMON}"
35 DESTINATION
="${HOME}/intel"
36 TEMPORARY_FILES
="/tmp"
41 if [ ! -z "${COMPONENTS}" ]; then
42 COMPONENTS
="${COMPONENTS};$1"
51 DESTINATION
="$(realpath "$2")"; shift
54 TEMPORARY_FILES
="$2"; shift
60 for component
in $1; do
63 add_components
"${COMPONENTS_ICC}"
66 add_components
"${COMPONENTS_MPI}"
69 add_components
"${COMPONENTS_VTUNE}"
72 add_components
"${COMPONENTS_INSPECTOR}"
75 add_components
"${COMPONENTS_ADVISOR}"
78 add_components
"${COMPONENTS_TBB}"
81 add_components
"${COMPONENTS_IFORT}"
84 add_components
"${COMPONENTS_MKL}"
87 # Noop, here for compatability. OpenMP is installed with icc and ifort now.
90 add_components
"${COMPONENTS_IPP}"
93 add_components
"${COMPONENTS_IPP_CRYPTO}"
96 add_components
"${COMPONENTS_GDB}"
99 add_components
"${COMPONENTS_DAAL}"
102 echo "Unknown component '$component'"
110 echo "Unrecognized argument '$1'"
117 if [ -z "${COMPONENTS}" ]; then
118 COMPONENTS
="${COMPONENTS_ICC}"
121 INSTALLER_SCRIPT
="parallel_studio_xe_2016_update3_online.sh"
122 INSTALLER
="${TEMPORARY_FILES}/${INSTALLER_SCRIPT}"
123 INSTALLER_URL
="http://registrationcenter-download.intel.com/akdlm/irc_nas/9061/${INSTALLER_SCRIPT}"
124 SILENT_CFG
="${TEMPORARY_FILES}/silent.cfg"
125 SUCCESS_INDICATOR
="${TEMPORARY_FILES}/icc-travis-success"
127 if [ ! -e "${TEMPORARY_FILES}" ]; then
128 echo "${TEMPORARY_FILES} does not exist, creating..."
129 mkdir
-p "${TEMPORARY_FILES}" || (sudo mkdir -p "${TEMPORARY_FILES}" && sudo chown -R "${USER}:${USER}" "${TEMPORARY_FILES}")
132 if [ ! -e "${DESTINATION}" ]; then
133 echo "${DESTINATION} does not exist, creating..."
134 mkdir
-p "${DESTINATION}" || (sudo mkdir -p "${DESTINATION}" && sudo chown -R "${USER}:${USER}" "${DESTINATION}")
137 if [ ! -e "${INSTALLER}" ]; then
138 wget
-O "${INSTALLER}" "${INSTALLER_URL}" ||
exit 1
140 chmod u
+x
"${INSTALLER}"
142 # See https://software.intel.com/en-us/articles/intel-composer-xe-2015-silent-installation-guide
143 echo "# Generated silent configuration file" > "${SILENT_CFG}"
144 echo "ACCEPT_EULA=accept" >> "${SILENT_CFG}"
145 echo "INSTALL_MODE=NONRPM" >> "${SILENT_CFG}"
146 echo "CONTINUE_WITH_OPTIONAL_ERROR=yes" >> "${SILENT_CFG}"
147 echo "PSET_INSTALL_DIR=${DESTINATION}" >> "${SILENT_CFG}"
148 echo "CONTINUE_WITH_INSTALLDIR_OVERWRITE=yes" >> "${SILENT_CFG}"
149 echo "COMPONENTS=${COMPONENTS}" >> "${SILENT_CFG}"
150 echo "PSET_MODE=install" >> "${SILENT_CFG}"
151 echo "PHONEHOME_SEND_USAGE_DATA=${PHONE_INTEL}" >> "${SILENT_CFG}"
152 if [ "x" != "x${INTEL_SERIAL_NUMBER}" ]; then
153 echo "ACTIVATION_SERIAL_NUMBER=${INTEL_SERIAL_NUMBER}" >> "${SILENT_CFG}"
154 echo "ACTIVATION_TYPE=serial_number" >> "${SILENT_CFG}"
156 echo "ACTIVATION_TYPE=trial_lic" >> "${SILENT_CFG}"
160 while [ $attempt -le 3 ]; do
161 if [ ! -e "${TEMPORARY_FILES}/parallel-studio-install-data" ]; then
162 mkdir
-p "${TEMPORARY_FILES}/parallel-studio-install-data" || (sudo mkdir -p "${TEMPORARY_FILES}/parallel-studio-install-data" && sudo chown -R "${USER}:${USER}" "${TEMPORARY_FILES}")
166 -t "${TEMPORARY_FILES}/parallel-studio-install-data" \
170 touch "${SUCCESS_INDICATOR}") &
172 # So Travis doesn't die in case of a long download/installation.
174 # NOTE: a watched script never terminates.
176 while kill -0 $
! 2>/dev
/null
; do
178 elapsed
=$
(expr $elapsed + 1)
179 if [ $
(expr $elapsed % 60) -eq 0 ]; then
180 mins_elapsed
=$
(expr $elapsed / 60)
181 if [ $mins_elapsed = 1 ]; then
182 minute_string
="minute"
184 minute_string
="minutes"
186 echo "Still running... (about $(expr $elapsed / 60) ${minute_string} so far)."
190 if [ ! -e "${SUCCESS_INDICATOR}" ]; then
191 echo "Installation failed."
195 if [ ! -e "${DESTINATION}/bin/compilervars.sh" ]; then
196 # Sometimes the installer returns successfully without actually
197 # installing anything. Let's try again…
198 echo "Installation attempt #${attempt} completed, but unable to find compilervars.sh."
199 find "${DESTINATION}"
204 rm -vrf "${TEMPORARY_FILES}/parallel-studio-install-data"
205 echo "Trying again..."
207 attempt
=$
(expr $attempt + 1)
210 if [ ! -e "${DESTINATION}/bin/compilervars.sh" ]; then
211 echo "Installation failed."
215 # Apparently the installer drops the license file in a location it
216 # doesn't know to check.
217 ln -s "${DESTINATION}"/licenses ~
/Licenses
219 # Add configuration information to ~/.bashrc. Unfortunately this will
220 # not be picked up automatically by Travis, so you'll still need to
221 # source ~/.bashrc in your .travis.yml
223 # Container-based builds include a `[ -z "$PS1" ] && return` near the
224 # beginning of the file, so appending won't work, we'll need to
226 echo "export INTEL_INSTALL_PATH=\"${DESTINATION}\"" >> ~
/.bashrc-intel
227 echo ". \"\${INTEL_INSTALL_PATH}/bin/compilervars.sh\" intel64" >> ~
/.bashrc-intel
228 echo "export LD_LIBRARY_PATH=\"\${INTEL_INSTALL_PATH}/ism/bin/intel64:\${INTEL_INSTALL_PATH}/lib/intel64_lin:\$LD_LIBRARY_PATH\"" >> ~
/.bashrc-intel
229 echo "export PATH=\"\${INTEL_INSTALL_PATH}/bin:\$PATH\"" >> ~
/.bashrc-intel
230 echo "function uninstall_intel_software {" >> ~
/.bashrc-intel
231 echo " find \"\${INTEL_INSTALL_PATH}\" -name 'uninstall.sh' -not -path '*/ism/uninstall.sh' -exec {} -s \;" >> ~
/.bashrc-intel
232 echo "}" >> ~
/.bashrc-intel
233 cat ~
/.bashrc
>> ~
/.bashrc-intel
234 mv ~
/.bashrc-intel ~
/.bashrc