Skip to content

Instantly share code, notes, and snippets.

@SomajitDey
Last active April 8, 2024 08:21
Show Gist options
  • Star 21 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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
@eginer
Copy link

eginer commented Apr 26, 2023

Many thanks for this very simple and amazingly efficient repo/tuto !
You saved me a lot of troubles !

@saeedsltm
Copy link

saeedsltm commented Nov 1, 2023

After installation how to use ifort? ifort command does not exist!

@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")

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