- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have two versions of the oneapi-hpc toolkits installed on my machine (the latest one and an older one for compatibility issues).
Is there a way to specify which version to load into my environment when I source `/opt/intel/oneapi/setvars.sh`?
Thanks
- Ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yo can you the "--config=file" option to specify the compiler you want to use.
For instance, let's say there are two versions of the compiler installed on your machine:
- /opt/intel/oneapi/compiler/2024.0
- /opt/intel/oneapi/compiler/2025.3.2
By default, running "setvars.sh" will select the latest version installed (2025.3.2).
Now, you can create a configuration file, say ~/config_intel_compiler
In this file, add the following line:
compiler=2024.0
Finally, run the script with the following command:
source /opt/intel/oneapi/setvars.sh --config="~/config_intel_compiler"
And finally check your current compiler version:
which ifx
You should see that the old version is active.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You would need to select the desired one from its installation folder.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How?
I usually just source the script with:
`. /opt/intel/oneapi/setvars.sh`
How do I select the one I want?
Is there optional arguments to the script?
- Ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yo can you the "--config=file" option to specify the compiler you want to use.
For instance, let's say there are two versions of the compiler installed on your machine:
- /opt/intel/oneapi/compiler/2024.0
- /opt/intel/oneapi/compiler/2025.3.2
By default, running "setvars.sh" will select the latest version installed (2025.3.2).
Now, you can create a configuration file, say ~/config_intel_compiler
In this file, add the following line:
compiler=2024.0
Finally, run the script with the following command:
source /opt/intel/oneapi/setvars.sh --config="~/config_intel_compiler"
And finally check your current compiler version:
which ifx
You should see that the old version is active.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In addition to my reply, you can force setvars to re-run if the Intel environment has already been configured. For instance:
source /opt/intel/oneapi/setvars.sh --force --config="$HOME/config_intel_compiler"
Then check with:
which ifx
or
ifx --version
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for the help, but I can't seem to get it to work.
I have:
# ls /opt/intel/oneapi/compiler/ -la
total 16
drwxr-xr-x 4 root root 4096 Feb 5 11:46 .
drwxr-xr-x 27 root root 4096 Jan 29 15:31 ..
drwxr-xr-x 10 root root 4096 Nov 7 14:07 2025.2
drwxr-xr-x 10 root root 4096 Feb 5 11:45 2025.3
lrwxrwxrwx 1 root root 6 Feb 5 11:46 latest -> 2025.3
So I have both 2025.3 and 2025.2
I made a config file that looks like:
$ cat ~/config_intel_compiler_2502
compiler=2025.2
I then source with:
$ . /opt/intel/oneapi/setvars.sh --config="~/config_intel_compiler_2502"
But I am still on the newest compiler:
$ ifx -v
ifx version 2025.3.2
Am I missing something?
- Ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is strange, it works perfectly on my Ubuntu machine.
Is "setvars.sh" executed automatically when you log in (by means of a similar command in file ~/.bashrc for instance)? If this is the case, your command with the "--config" option is skipped. Can you try forcing the execution of the bash script?
$ . /opt/intel/oneapi/setvars.sh --force --config="~/config_intel_compiler_2502"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
It works now.
I have a system "load" script and I had copied it to my home dir but forgot to use "./" when sourcing the local one.
Thanks!
Problem solved!
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page