Skip to content

Compile a Fortran program using ifx

ifx is an Intel Fortran compiler. This page describes how to compile Fortran code using ifx.

Procedure

1. Load the modules

Load a recent intel module:

module load intel-oneapi 
module load compiler/2023.1.0

2. Write the Fortran program

Create and write a Fortran source file called hello_world.f:

nano hello_world.f

In nano, write the Fortran program as such:

C     HELLO.F :  PRINT MESSAGE ON SCREEN
      PROGRAM HELLO
      WRITE(*,*) "hello, world";
      END

3. Compile the C++ program

After saving and closing nano, compile as such:

ifx hello_world.f

4. Run the executable

Run the program:

./a.out 

Output:

hello, world