Showing results for 
Search instead for 
Did you mean: 

Problems with environment variables and using code examples

I was following installation guide up to environmental variable step: 

I entered
mklvars intel64
in the command shell. The script got executed fine and when I checked PATH variable in the command shell, I could see the added path. But if I check System properties -> environment variables, the Path variable remained unchanged. Also, when I restarted the command shell Path variable was the same as before running the script.

Also if I try to run a sample code in VS2017, the line 

#include "mkl.h"

gets underscored with a message "cannot open source file mkl.h"

Installation of mkl went without errors and all files that are mentioned in are on their place.

If I understand correctly, this error is due to the absence of mkl.h in the path. 

Am I missing something? How can I correct it?


0 Kudos
2 Replies

This bat script will set the MKL environments into the local working session. If you manually add these environments to the system properties -> environment variables then you will resolve this issues. 

In the case of Visual Studio – please refer to this article to set MKL environments in VS.

0 Kudos

For others who run into this problem, the solution is to source the script rather than execute it.


source /opt/intel/bin/ <arch>


./opt/intel/bin/ <arch>

Executing a shell script executes it in a new shell process. The environment settings are lost when that process terminates. Sourcing it executes it in the current process.

0 Kudos