Skip to content

Instantly share code, notes, and snippets.

@SomajitDey
Last active September 6, 2024 08:53
Show Gist options
  • Save SomajitDey/aeb6eb4c8083185e06800e1ece4be1bd to your computer and use it in GitHub Desktop.
Save SomajitDey/aeb6eb4c8083185e06800e1ece4be1bd to your computer and use it in GitHub Desktop.
Install INTEL Fortran compiler ifort for free on Ubuntu(WSL2). Also install MKL. OpenMP and OpenMPI runtime for coarray support.

My route:

  1. curl -Lo- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | sudo gpg --dearmor -o /usr/share/keyrings/oneapi-archive-keyring.gpg
  2. sudo tee /etc/apt/sources.list.d/oneAPI.list <<< "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main"
  3. sudo apt update
  4. sudo apt install intel-oneapi-compiler-fortran
  5. Optional: sudo apt install intel-oneapi-mkl
  6. In ~/.bashrc: source /opt/intel/oneapi/setvars.sh > /dev/null
@saeedsltm
Copy link

Fixed! maybe restaring kernel is the key point! Now its working, thanks a lot.

@leila-etsa
Copy link

Thank you very much, specially for important note number 6 "In ~/.bashrc: source /opt/intel/oneapi/setvars.sh > /dev/null"

The only thing is that your MPI folder does not contain "mpif90" nor "mpiifort" and If you can add them, it will be complete.

I did these steps:

1- I downloaded Intel Fortran compiler and Intel MPI library from Intel site and Installed them.
2- In ~/.bashrc: export I_MPI_F90=ifort, in order that mpif90 uses Ifort not Gfortran.
3- In ~/.bashrc: source .../setvars.sh > /dev/null, in order to define necessary paths and variables. Instead of ... users should write the path of setvars.sh.

( Without doing step 3 and defining only Ifort and MPI path in .bashrc, I was getting this error: "mod_mpi_shared.F90(29): error #5102: Cannot open include file 'mpif.h' INCLUDE 'mpif.h")

@superlbr
Copy link

superlbr commented May 3, 2024

ifort is now deprecated and will be discontinued late 2024..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment