Intel® Processors, Tools, and Utilities
13837 Discussions

How can I "cache" the effects of Intel OneAPI setvars?


Intel's OneAPI distribution (which includes many components such as ICC) has a script named, which checks for the presence of various stuff, then runs components' individual scripts for setting environment variables. It takes over a second to run and prints some stuff to the terminal.

Now, I'm willing to run it once, but I certainly don't want to run it whenever I start a shell. How can I "cache" its results, in the form of the delta it adds (or removes?) from my environment before its invocation? So that I could just source a script with:

export PATH="whatever:$PATH"
export TBBROOT="whatever"
# etc. etc.


Naturally, I would need to re-run if my system configuration changed in any way, but I'm ok with that.

0 Kudos
0 Replies