Finished with error when running FLUKA

while running a basic simulation on flair, run is finished with errors with error in output file as:
Dir: /usr/local/fluka
Data: /usr/local/fluka/data
/usr/local/fluka/bin/rfluka: 108: gfortran: not found
/usr/local/fluka/bin/rfluka: 112: [: -eq: unexpected operator
/usr/local/fluka/bin/rfluka: 112: [: -ge: unexpected operator
Error: Incompatible gfortran version!
System gfortran version:
FLUKA package version: 7
but when checked for gfortran version in ubuntu terminal by typing gfortran --version i get the result as:
GNU Fortran (Ubuntu 7.5.0 -6ubuntu2) 7.5.0

Dear Ramanpreet Kaur,

If I’m correct you installed gcc / gfortran 7 on Ubuntu 20.04. Since this is not the most recent compiler for this linux distribution, the standard commands are not working out of the box.

Are you sure, you get the gfortran version with the command gfortran --version and not with gfortran-7 --version?

if gfortran-7 works, then you can set it as the default gfortran:

sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-7 10

Or, you can install the latest compiler with

sudo apt install gfortran

This will install gfortran 9, and the gfortran command should work. But in this case you need to install the corresponding FLUKA version from https://fluka.cern/

Cheers,
David

yes used command gfortran-7 --version,
i used the command ```
alias gfortran=gfortran-7
but i still get same error in flair output file.

Dear Ramanpreet,

you can try to set gfortran-7 as the default gfortran command with:

sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-7 10

After this please check if the

gfortran --version

command also works.

Cheers,
David