Oneapi on ubuntu23010


I installed oneapi in Ubuntu 23.10.
The installation ran without a problem.
Oneapi is in /opt/intel/
I sourced
On I open a terminal iexecutes setting the environment variables.
Disaster strikes when I enter ifort --version which gives me ‘Command ‘ifort’ not found’
I think something went wrong with the installation.
On mpiifort --version I get:
/opt/intel/oneap/mpi/2021.10.0/bin/mpiifort: 1: eval: ifort: not found.
As far as I understand ifort didn’t get installed.


Did you close and open again your terminal?

I have installed Intel Fortran in Ubuntu 23.10 from the terminal, and I remember the command was not found until I open again the terminal.

Yes I did to no avail.
Very strange. I tried sudo apt-get --reinstall install intel-basekit
but it states that alle files are up to date.
To really reinstall I suppose I have to purge first but I would like to avoid that.


This is the steps I followed in 2021:

Do you see the executable in the /opt/intel/ directory? On a Ubuntu 23.04 system I have:

$ whereis ifort
ifort: /opt/intel/oneapi/compiler/2023.1.0/linux/bin/intel64/ifort

apt-key add is deprecated in latest linux distro’s such as ubuntu 23.10 for security reasons. You have to add the key in /etc/apt/keyrings and edit the sources.list. But I did that and I could continue with installing.
I have a SSD of 1TB, so I have enough storage capacity.

Yes, I used the following bash script in another Ubuntu 23.10 (mantic):

#! /bin/bash

wget -O- |\
    gpg --dearmor |\
    sudo tee /usr/share/keyrings/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB > /dev/null

echo "deb [signed-by=/usr/share/keyrings/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB] all main" |\
    sudo tee /etc/apt/sources.list.d/archive_uri-https_apt_repos_intel_com_oneapi-mantic.list

No ifort. This is weird.
I did ’ ```
sudo apt install intel-oneapi-compiler-fortran

Seemed to work fine. Now there is ifort in opt/intel/oneapi/compiler/2024.0/bin/
Executable as program Read only.
But still not working.

Stranger and stranger.icc – version and icpc --versio gives me the versions.
ifort --version gives command not found. Apparently they don’t like fortran.
I have no idea whats going wrong.

I don’t remember the exact name of the package off the top of my head, but I believe you also need to

sudo apt install intel-hpckit

Edit to add: The Fortran compilers are not included in the basekit, and possibly intel-oneapi-compiler-fortran only installs ifx.

As Brad says, the Intel Fortran compiler is part of the HPC Toolkit: Intel® HPC Toolkit: Cluster & HPC Development Tools

The Basekit (Intel® oneAPI Base Toolkit: Essential oneAPI Tools & Libraries) contains the DPC++ compiler, MKL, and other Intel tools.

1 Like

I installed intel-basekit intel-iotkit intel-aikit intel-renderkit intel-hpckit intel-oneapi-compiler-fortran

Using gfortran till problem resolved.


When I installed ifort in a Ubuntu system I found I had to put both these lines in a shell script to use it. (The > /dev/null is optional.)

 source /opt/intel/oneapi/ > /dev/null
opt/intel/oneapi/2024.0/bin/ifort -standard-semantics -L/lib/gcc/x86_64-linux-gnu/13 -lgcc -lgcc_s "$@"

But I still can’t use ifx because there seems to be LLVM stuff missing that I don’t know how to access.

The Fortran compilers are in the HPC Toolkit, NOT the Base Kit.
Install the HPC Kit.

1 Like

I know. I did install it and ifort is in the intel directory but for some reason it is not recognized.

Apparently something went wrong on installation. I did a fresh install and now everything is working as it should.
Thank you all for your comments.


1 Like

I have just installed on Windows and the trick was to see that Intel have a “macro” for opening a command line window which is configured so that ifort and if are added to the path along with all the other environment variables required.
If does not work in a vanilla command prompt window.
So I wonder if they took the same approach in Linux? Do they supply a command that reconfigure a terminal so that all necessary may be discovered?

That is the role of the /opt/intel/oneapi/ script. I had to configure my system so that the command source /opt/intel/oneapi/ --force > /dev/null is executed each time I launch a terminal (it runs the script without sending its messages on screen).

>  This is the top-level environment variable setup script for use with Intel
 OneAPI toolkits. Most "tools" or "components" that are part of an Intel
 oneAPI installation include an `env/` script that configures the
 environment variables needed for that specific tool to work. More details
 are available via this script's "--help" argument.

yes. In linux for bash shell users:
source /opt/intel/oneapi/

If you’re not using bash, read this

Intel has a Fortran Developer Guide and Reference, and it’s been online for over 20 years. One of the first chapters is on using the compiler. Specifically, one can go here to see the details for setting environment for command lines for Windows or linux. And it also shows how to use it in Visual Studio.

1 Like