- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm a beginner.Recently installed mkl in oneapi basekit on ubuntu server20, trying to compile the c program with gcc.
I've set up environment variables using files setvars.sh according to the instructions and written them to the module file.The command "Module List" also shows that mkl is loaded.
But use the command: sudo gcc -o i2fast i2fast .c -lmkl_ rt -lm -mcmodel-large, it will show: fatal error: mkl.h: There is no file or directory.
How do I fix it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem may be related to your using SUDO. Without the use of a SUDO option to preserve environment variables, any variables that GCC uses, such as C_INCLUDE_PATH, will not be available to the compiler.
Do you really need to use SUDO?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem may be related to your using SUDO. Without the use of a SUDO option to preserve environment variables, any variables that GCC uses, such as C_INCLUDE_PATH, will not be available to the compiler.
Do you really need to use SUDO?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
wow~,thanks a lot! You have successfully solved the problem for me. But I don't understand that sudo should have the highest permissions, but why do it affect environmental variables?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The issue is not about permissions -- SUDO gives you higher levels of permissions than an ordinary user may have -- but about the child process inheriting the environment of the parent process.
See, for example, this article.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Glad to know that your issue got resolved, thanks to the valuable response from @mecej4.
As your issue is resolved, we will no longer monitor this thread. If you require any additional assistance from Intel, please start a new thread.
Any further interaction in this thread will be considered community only.
Warm Regards,
Abhishek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I am new to this Environment and I have downloaded the intel oneAPI base toolkit but I don't understand how to set up environment variables using files setvars.sh or generally how to make the command line recognizes the MKL library. can you tel me how you did this?
thanks
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page