macOS zsh or other zsh users: compilervars.sh currently does not support zsh.
Simplest workaround is:
bash -c 'source /opt/intel/bin/compilervars.sh intel64 ; exec zsh'
Which will end up with a new zsh instance, so if you exit from the new instance you will lose the env vars.
oneAPI: setvars.sh or compiler/latest/vars.sh and other shells:
Same method as above:
# oneAPI setvars.sh use in zsh
bash -c 'source /opt/intel/oneapi/setvars.sh ; exec zsh'
# oneAPI compiler vars.sh use in zsh
bash -c 'source /opt/intel/oneapi/compiler/latest/env/vars.sh ; exec zsh'
# oneAPI setvars.sh use in csh/tcsh
bash -c 'source /opt/intel/oneapi/setvars.sh ; exec csh'
# oneAPI compiler vars.sh use in csh/tcsh
bash -c 'source /opt/intel/oneapi/compiler/latest/env/vars.sh ; exec csh'
WARNING - do not put these in your shell "rc" dot file, for example, ~/.cshrc. Your shell RC is invoked with each new shell - and notice "exec csh" in this workaround - this will start a subshell, invoke .cshrc, which execs a new shell, the new shell runs .cshrc and you get into an infinite loop.
One-time invocation at login:
For zsh, you can put the workaround(s) in your ~/.zlogin file which is only executed once per login. See this information on startup scripts for zsh. Note that with this method, to exit your login you will need to enter the 'exit' command TWICE to terminate your login.