How to compile and run using ifort and coarrays

Hi all,
I just recently installed the Intel Fortran compiler on Fedora, I wanted to know:

  1. How do I check if it’s installed correctly ?
  2. How do I compile programs with ifort (I looked at intel’s website, it’s not really clear)
  3. Does ifort have a coarrays option ? How do I use it ?
  4. Is there a full manual of ifort ?

Note: I installed using the offline installers from the intel website

Thanks

2 & 3) This is an example (https://github.com/vmagnin/exploring_coarrays):

$ export FOR_COARRAY_NUM_IMAGES=2
$ ifort -O3 -coarray m_xoroshiro128plus.f90 pi_monte_carlo_coarrays.f90
$ ./a.out
  1. Intel® Fortran Compiler Classic 2021.1 and Intel® Fortran Compiler...

The corresponding coarray part: Using Coarrays

I guess in Fedora it is installed similar to all Linuxes, in /opt/intel/… hierarchy. To use it, you have to set configuration of your shell (paths etc.). For bash, use
source /opt/intel/oneapi/setvars.sh or (shorter, with a dot)
. /opt/intel/oneapi/setvars.sh

Thank you, this worked for my first question

Thank you !

Thank you too

1 Like

Sorry to necro the thread, but how do I change the name of the output file ?

With the -o option, for example

ifort -O3 -coarray -o foo.out m_xoroshiro128plus.f90 pi_monte_carlo_coarrays.f90

2 Likes

Thank you