In my work, I'm building Python libraries in C++17 with massive use of the BLAS
subroutines under the Intel's MKL
implementation. I have no problems building these applications, however I have been unable to loaded them correctly on any Jupyter notebooks within vscode
. The root of the problem was that I don't know now to activate oneAPI environment vars, i.e. to call
$ source /opt/intel/oneapi/setvars.sh
within the Jupyter notebooks.
I think this is not possible: oneAPI environment should be called before activating the Jupiter notebook. (But, perhaps I'm wrong and someone can show me how)
As a result whenever I try to load my library within a ipynb
I get the following error from libmkl:
By mistake, I opened vscode
on a terminal where I had previously activated oneAPI's environment and this solved my initial issue. Now I'm able to load correctly my library
... and use it with any ipynb
within vscode
:
For the sake of clarity, this works only because I load oneAPI's vars before calling svcode
, namely
(base) joe@cool$ source /opt/intel/oneapi/setvars.sh
:: initializing oneAPI environment ...
bash: BASH_VERSION = 5.2.21(1)-release
args: Using "$@" for setvars.sh arguments:
:: compiler -- latest
:: mkl -- latest
:: tbb -- latest
:: umf -- latest
:: oneAPI environment initialized ::
(base) joe@cool$ code&
However, this leave me with two questions:
- is there an automated way call oneAPI's MKL enviroment whenever I call/open vscode?
and
- is there a way for vscode to let me know that oneAPI's MKL enviroment is active or not?
In other words: I found a work around to my initial problem, but I think there must be a feature in vscode
that allows me to automate the loading of oneAPI's MKL environment variables.