# Oneapi on ubuntu23010

**URL:** <https://fortran-lang.discourse.group/t/oneapi-on-ubuntu23010/6878>\
**Category:** Intel\
**Created:** [November 28, 2023, 11:49am UTC](https://fortran-lang.discourse.group/t/oneapi-on-ubuntu23010/6878 "2023-11-28T11:49:05Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmoortgat](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/rmoortgat/32/3569_2.png) [@rmoortgat](https://fortran-lang.discourse.group/u/rmoortgat)\
**Post date:** [November 28, 2023, 11:49am UTC](https://fortran-lang.discourse.group/t/oneapi-on-ubuntu23010/6878/1 "2023-11-28T11:49:05Z")

</div>

Hello,

I installed oneapi in Ubuntu 23.10.  
The installation ran without a problem.  
Oneapi is in /opt/intel/  
I sourced setvars.sh.  
On I open a terminal setvars.sh 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.

Roger

---

<div class="post-metadata">

**Author:** ![vmagnin](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/vmagnin/32/28_2.png) [@vmagnin](https://fortran-lang.discourse.group/u/vmagnin)\
**Post date:** [November 28, 2023, 12:33pm UTC](https://fortran-lang.discourse.group/t/oneapi-on-ubuntu23010/6878/2 "2023-11-28T12:33:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rmoortgat](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/rmoortgat/32/3569_2.png) [@rmoortgat](https://fortran-lang.discourse.group/u/rmoortgat)\
**Post date:** [November 28, 2023, 1:46pm UTC](https://fortran-lang.discourse.group/t/oneapi-on-ubuntu23010/6878/3 "2023-11-28T13:46:59Z")

</div>

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.

Roger

---

<div class="post-metadata">

**Author:** ![vmagnin](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/vmagnin/32/28_2.png) [@vmagnin](https://fortran-lang.discourse.group/u/vmagnin)\
**Post date:** [November 28, 2023, 2:32pm UTC](https://fortran-lang.discourse.group/t/oneapi-on-ubuntu23010/6878/4 "2023-11-28T14:32:45Z")

</div>

This is the steps I followed in 2021:

> [@Intel releases oneAPI Toolkit, free, Fortran 2018](https://fortran-lang.discourse.group/t/intel-releases-oneapi-toolkit-free-fortran-2018/471/43):
>
> I report the [installation of the Intel Fortran compilers](https://software.intel.com/content/www/us/en/develop/articles/installing-intel-oneapi-toolkits-via-apt.html) on a machine with Ubuntu 20.10: $ wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB $ sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB $ rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB $ sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main" $ sudo apt update As the whole intel-basekit package uses ~16 GB on disk, I have chosen to install only the Fortran compilers (download: 560 MB, on disk: ~1.…

---

<div class="post-metadata">

**Author:** ![vmagnin](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/vmagnin/32/28_2.png) [@vmagnin](https://fortran-lang.discourse.group/u/vmagnin)\
**Post date:** [November 28, 2023, 2:53pm UTC](https://fortran-lang.discourse.group/t/oneapi-on-ubuntu23010/6878/5 "2023-11-28T14:53:34Z")

</div>

> [@rmoortgat](#):
>
> To really reinstall I suppose I have to purge first but I would like to avoid that.

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

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

```

---

<div class="post-metadata">

**Author:** ![rmoortgat](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/rmoortgat/32/3569_2.png) [@rmoortgat](https://fortran-lang.discourse.group/u/rmoortgat)\
**Post date:** [November 28, 2023, 2:57pm UTC](https://fortran-lang.discourse.group/t/oneapi-on-ubuntu23010/6878/6 "2023-11-28T14:57:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![vmagnin](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/vmagnin/32/28_2.png) [@vmagnin](https://fortran-lang.discourse.group/u/vmagnin)\
**Post date:** [November 28, 2023, 3:01pm UTC](https://fortran-lang.discourse.group/t/oneapi-on-ubuntu23010/6878/7 "2023-11-28T15:01:23Z")

</div>

> [@rmoortgat](#):
>
> 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.

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

```bash
#! /bin/bash
# https://stackoverflow.com/questions/68992799/warning-apt-key-is-deprecated-manage-keyring-files-in-trusted-gpg-d-instead

wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB |\
    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] https://apt.repos.intel.com/oneapi/ all main" |\
    sudo tee /etc/apt/sources.list.d/archive_uri-https_apt_repos_intel_com_oneapi-mantic.list

```

---

<div class="post-metadata">

**Author:** ![rmoortgat](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/rmoortgat/32/3569_2.png) [@rmoortgat](https://fortran-lang.discourse.group/u/rmoortgat)\
**Post date:** [November 28, 2023, 3:19pm UTC](https://fortran-lang.discourse.group/t/oneapi-on-ubuntu23010/6878/8 "2023-11-28T15:19:44Z")

</div>

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

```auto
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.
```

---

<div class="post-metadata">

**Author:** ![rmoortgat](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/rmoortgat/32/3569_2.png) [@rmoortgat](https://fortran-lang.discourse.group/u/rmoortgat)\
**Post date:** [November 28, 2023, 3:44pm UTC](https://fortran-lang.discourse.group/t/oneapi-on-ubuntu23010/6878/9 "2023-11-28T15:44:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![everythingfunctional](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/everythingfunctional/32/176_2.png) [@everythingfunctional](https://fortran-lang.discourse.group/u/everythingfunctional)\
**Post date:** [November 28, 2023, 3:45pm UTC](https://fortran-lang.discourse.group/t/oneapi-on-ubuntu23010/6878/10 "2023-11-28T15:45:17Z")

</div>

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

```auto
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`.

---

<div class="post-metadata">

**Author:** ![ivanpribec](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/ivanpribec/32/3290_2.png) [@ivanpribec](https://fortran-lang.discourse.group/u/ivanpribec)\
**Post date:** [November 28, 2023, 3:48pm UTC](https://fortran-lang.discourse.group/t/oneapi-on-ubuntu23010/6878/11 "2023-11-28T15:48:32Z")

</div>

As Brad says, the Intel Fortran compiler is part of the HPC Toolkit: [Intel® HPC Toolkit: Cluster & HPC Development Tools](https://www.intel.com/content/www/us/en/developer/tools/oneapi/hpc-toolkit.html)

The Basekit ([Intel® oneAPI Base Toolkit: Essential oneAPI Tools & Libraries](https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit.html)) contains the DPC++ compiler, MKL, and other Intel tools.

---

<div class="post-metadata">

**Author:** ![rmoortgat](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/rmoortgat/32/3569_2.png) [@rmoortgat](https://fortran-lang.discourse.group/u/rmoortgat)\
**Post date:** [November 28, 2023, 3:51pm UTC](https://fortran-lang.discourse.group/t/oneapi-on-ubuntu23010/6878/12 "2023-11-28T15:51:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rmoortgat](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/rmoortgat/32/3569_2.png) [@rmoortgat](https://fortran-lang.discourse.group/u/rmoortgat)\
**Post date:** [November 28, 2023, 6:59pm UTC](https://fortran-lang.discourse.group/t/oneapi-on-ubuntu23010/6878/13 "2023-11-28T18:59:36Z")

</div>

Using gfortran till problem resolved.

Roger

---

<div class="post-metadata">

**Author:** ![Harper](https://avatars.discourse-cdn.com/v4/letter/h/b5ac83/32.png) [@Harper](https://fortran-lang.discourse.group/u/Harper)\
**Post date:** [November 28, 2023, 7:58pm UTC](https://fortran-lang.discourse.group/t/oneapi-on-ubuntu23010/6878/14 "2023-11-28T19:58:51Z")

</div>

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.)

```auto
 source /opt/intel/oneapi/setvars.sh > /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.

---

<div class="post-metadata">

**Author:** ![greenrongreen](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/greenrongreen/32/1249_2.png) [@greenrongreen](https://fortran-lang.discourse.group/u/greenrongreen)\
**Post date:** [November 29, 2023, 12:15am UTC](https://fortran-lang.discourse.group/t/oneapi-on-ubuntu23010/6878/15 "2023-11-29T00:15:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rmoortgat](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/rmoortgat/32/3569_2.png) [@rmoortgat](https://fortran-lang.discourse.group/u/rmoortgat)\
**Post date:** [November 29, 2023, 7:45am UTC](https://fortran-lang.discourse.group/t/oneapi-on-ubuntu23010/6878/16 "2023-11-29T07:45:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rmoortgat](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/rmoortgat/32/3569_2.png) [@rmoortgat](https://fortran-lang.discourse.group/u/rmoortgat)\
**Post date:** [November 29, 2023, 9:03am UTC](https://fortran-lang.discourse.group/t/oneapi-on-ubuntu23010/6878/17 "2023-11-29T09:03:09Z")

</div>

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.

Roger

---

<div class="post-metadata">

**Author:** ![NormanKirkby](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/normankirkby/32/1091_2.png) [@NormanKirkby](https://fortran-lang.discourse.group/u/NormanKirkby)\
**Post date:** [November 29, 2023, 10:43am UTC](https://fortran-lang.discourse.group/t/oneapi-on-ubuntu23010/6878/18 "2023-11-29T10:43:46Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![vmagnin](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/vmagnin/32/28_2.png) [@vmagnin](https://fortran-lang.discourse.group/u/vmagnin)\
**Post date:** [November 29, 2023, 12:32pm UTC](https://fortran-lang.discourse.group/t/oneapi-on-ubuntu23010/6878/19 "2023-11-29T12:32:20Z")

</div>

> [@NormanKirkby](#):
>
> 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/setvars.sh` script. I had to configure my system so that the command `source /opt/intel/oneapi/setvars.sh --force > /dev/null` is executed each time I launch a terminal (it runs the script without sending its messages on screen).

```auto
> 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/vars.sh` script that configures the
 environment variables needed for that specific tool to work. More details
 are available via this script's "--help" argument.
```

---

<div class="post-metadata">

**Author:** ![greenrongreen](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/greenrongreen/32/1249_2.png) [@greenrongreen](https://fortran-lang.discourse.group/u/greenrongreen)\
**Post date:** [November 29, 2023, 2:26pm UTC](https://fortran-lang.discourse.group/t/oneapi-on-ubuntu23010/6878/20 "2023-11-29T14:26:24Z")

</div>

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

If you’re not using bash, [read this](https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-zsh-csh-or-tcsh-with-oneAPI-setvars-sh-vars-sh-or/m-p/1227040)

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](https://www.intel.com/content/www/us/en/docs/fortran-compiler/developer-guide-reference/2023-1/compiler-setup.html) 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.

[Next page](https://fortran-lang.discourse.group/t/oneapi-on-ubuntu23010/6878.md?page=2)
