When /opt/intel/oneapi/setvar.sh
is sourced, it overrides ${@}
(the bash variable that stores command line arguments).
This is very problematic when when you are sourcing the script inside of another script that needs to process command line arguments.
To reproduce:
docker run -i ubuntu:20.04 /bin/bash -s <<EOF
echo "Bash Arguments: \${@}"
apt-get -y update
apt-get -y install gnupg curl
echo "deb https://apt.repos.intel.com/oneapi all main" > /etc/apt/sources.list.d/icc.list
curl --silent --show-error -L https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB -o - | apt-key add -
apt-get -y update
apt-get -y --no-install-recommends install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
source /opt/intel/oneapi/setvars.sh
echo "Bash Arguments: \${@}"
EOF
The last line SHOULD print out:
Bash Arguments:
But instead it prints:
Bash Arguments: compiler=latest tbb=latest dev-utilities=latest
This is keeping Thrust's CI system from building with ICPC. We've got it patched for now but would like it fixed.
Have you found a cure? I recently posted this to the Intel list, see https://mail.google.com/mail/u/0/#search/bug+with+setvars/FMfcgzGqQmQtrBTPNPSFtbKPLJfZcBjq . If you have no cure, maybe you can add a "I too have it" so Intel will take it seriously.
N.B., my patch is to do "var="$@" ; source /opt/intel/oneapi/setvars.sh ; eval set -- $var". It works, but it seems dumb to me.