Oneapi on ubuntu23010

The experience on my system

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Linuxmint
Description:	Linux Mint 21.2
Release:	21.2
Codename:	victoria

has been the following.

Executing

$ wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
$ echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
$ sudo apt update
$ sudo apt install intel-oneapi-compiler-fortran

and then

$ source /opt/intel/oneapi/setvars.sh

ifort --version and ifx --version work.

If, then, I try to add the C compilers package

$ sudo apt install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic

and then

$ source /opt/intel/oneapi/setvars.sh

icx --version and icc --version work but I lose access to the Fortran compilers (the mentioned ifort --version and ifx --version do not work any more)

After checking the guides on the Intel website (where I found myself many times running in circles through the hyper-links and getting lost in very deep digressions and special cases), I cooked the following solution to have all four compilers available. When you open a new terminal execute:

$ source /opt/intel/oneapi/setvars.sh
$ source /opt/intel/oneapi/compiler/2024.0/env/vars.sh intel64

Just to clarify, I have absolutely no clue why that works, for how long it will continue to work and how robust it is (I have so far experimented very little with combined Fortran and C compilation). It is just the solution I have reached after some lengthy, frustrating trial and error.

For the sake of completeness:

$ which ifort
/opt/intel/oneapi/compiler/2024.0/bin/ifort
$ which ifx
/opt/intel/oneapi/compiler/2024.0/bin/ifx
$ which icc
/opt/intel/oneapi/compiler/2023.2.2/linux/bin/intel64/icc
$ which icx
/opt/intel/oneapi/compiler/2023.2.2/linux/bin/icx

It would be nice if the Intel compilers (that are excellent products) would be far easier to access for the average user and for basic use-cases.

Ah I see the problem. You cannot install Fortran with one version and C++ at another version.
You have the 2024.0.0 Fortran package
but you ASKED for intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
Since we removed ICC from the 2024.0 packages, the last version of “intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic” is 2023.2.2 like you see.

Compilers have to be at the same version.
I think the C++ package you want may be named “intel-oneapi-compiler-dpcpp-cpp”
Let me check the repo to see the package name, but I would guess the above is correct.

1 Like

Yes, the package you want is intel-oneapi-compiler-dpcpp-cpp

apt-cache policy intel-oneapi-compiler-dpcpp-cpp
intel-oneapi-compiler-dpcpp-cpp:
Installed: (none)
Candidate: 2024.0.0-49819
Version table:
2024.0.0-49819 500
500 https://apt.repos.intel.com/oneapi all/main amd64 Packages
2023.2.2-47 500
500 https://apt.repos.intel.com/oneapi all/main amd64 Packages
2023.2.1-16 500
500 https://apt.repos.intel.com/oneapi all/main amd64 Packages
2023.2.0-49495 500
500 https://apt.repos.intel.com/oneapi all/main amd64 Packages
2023.1.0-46305 500
500 https://apt.repos.intel.com/oneapi all/main amd64 Packages
2023.0.0-25370 500
500 https://apt.repos.intel.com/oneapi all/main amd64 Packages
2022.2.1-16953 500
500 https://apt.repos.intel.com/oneapi all/main amd64 Packages
2022.2.0-8734 500
500 https://apt.repos.intel.com/oneapi all/main amd64 Packages
2022.1.0-3768 500
500 https://apt.repos.intel.com/oneapi all/main amd64 Packages
2022.0.2-3658 500
500 https://apt.repos.intel.com/oneapi all/main amd64 Packages
2022.0.1-3633 500
500 https://apt.repos.intel.com/oneapi all/main amd64 Packages
2021.4.0-3561 500
500 https://apt.repos.intel.com/oneapi all/main amd64 Packages
2021.3.0-3350 500
500 https://apt.repos.intel.com/oneapi all/main amd64 Packages
2021.2.0-610 500
500 https://apt.repos.intel.com/oneapi all/main amd64 Packages
2021.1.2-266 500
500 https://apt.repos.intel.com/oneapi all/main amd64 Packages
2021.1.1-189 500
500 https://apt.repos.intel.com/oneapi all/main amd64 Packages

1 Like

Many thanks! It all makes sense now and I can go back to using only source /opt/intel/oneapi/setvars.sh