Setup of Intel's Fortran compiler on Linux

This short step-by-step tutorial should help you setup Code::Blocks IDE for use Intel's Fortran compiler on Linux. The Intel's oneAPI 2021 is used here. The setup process can be a bit different for other versions. It is not about how to install Intel's oneAPI on your PC. Search for Intel instructions about it.

  1. To start Code::Blocks, open a terminal in the folder with Code::Blocks. According to the Intel’s documentation, the environment variables should be set using provided script file "setvars.sh”:

    source /opt/intel/oneapi/setvars.sh
    

/images/ifortLinux/ifort_linux_setvars.png

  1. Start Code::Blocks:

    /images/ifortLinux/ifort_linux_startCB.png

  1. Check if C::B found Intel’s Fortran compiler “ifort” on your system:

    /images/ifortLinux/ifort_linux_exe_path.png

  1. Setup Intel’s provided customized GDB debugger:

    /images/ifortLinux/ifort_linux_gdb_settings.png

  1. If you want to debug your code, compile your project with “ifort” compiler with option “-debug full”.

    /images/ifortLinux/ifort_linux_compiler_debug_flags.png

  1. You can omit Step 1 by including "source /opt/intel/oneapi/setvars.sh" line directly into "codeblocks_run.sh" file:

    /images/ifortLinux/ifort_linux_cb_runsh.png