Search code examples
visual-studio-codeenvironment-variablestbbintel-oneapi

Automate "Set the oneAPI Environment" every time when I start VSCode


I find out that I have to CTRL+SHIFT+P > Intel oneAPI: Initialize environment variables every time when I start up VSCode. Otherwise there are build errors "fatal error: oneapi/tbb.h: No such file or directory". Any way to automate this?


Solution

  • Add the following to /etc/profile:

    [ -f "/opt/intel/oneapi/setvars.sh" ] && . /opt/intel/oneapi/setvars.sh