Getting a floating point error when running the example

Hello,

First time using FLUKA, the installation went fine and everything seems ok (no errors when installing and everything went according to the installation manual).

I then tried to run the example simulation

rfluka -N0 -M5 example.inp

and I get this error:

9539 Floating point exception: 8   "${EXE}" "${INPF}" > "${LOGF}" 2>&1
Error: "path_to_fluka/fluka4-4.1/bin/fluka" executable returned RC=136

Does anyone know what is the problem here. I didn’t find anything useful on any of the manuals/website.

Thanks for your help and here’s the example.inp just in case.
example.inp (3.2 KB)

Info:

  • I used gcc-13 from MacPorts to make.

Hello @khalil.alkhour ,

It seems it is an installation issue.

What is the output of these commands?

  • echo $PATH
  • which rfluka
  • ls path_to_fluka/fluka4-4.1/

Kind regards, Luigi

Thanks for your response.

The PATH that appeared contains /path-to-fluka/fluka4-4.1/bin, the which rfluka command returns /path-to-fluka/fluka4-4.1/bin/rfluka and the ls command returns the following:

AUTHORS LICENSE REFERENCES Version.tag data examples lib
INSTALL README.md RELEASE-NOTES bin doc include src

Thanks again for your help.

Dear @khalil.alkhour ,

From the output you provided, your FLUKA installation is directly in the root directory /, which is typically a read-only file system. I suggest you to install fluka in a more standard directory, such as your home (/Users/<your_username>).

For the sake of precision, the PATH environment variable should include also other directories, and not only /path-to-fluka/fluka4-4.1/bin. Do you confirm this is the case?

Moreover, your error message reports the full path of the FLUKA executable as path_to_fluka/fluka4-4.1/bin/fluka, while it should start with a / (according to your info), pointing to some error in the installation.

Cheers, Luigi

P.S. Maybe it was clear but path_to_fluka in the installation instructions does not indicate a specific directory name, rather it is the path where you have installed FLUKA.

Thanks for your response.

But I did install fluka in home, the path is /Users/user/fluka4-4.1. Yes the path that appeared after the echo $PATH command was huge but the last entity was the /path-to-fluka/fluka4-4.1/bin. And finally the path that I sent you and that I got for which fluka does contain a / at the very start.

I don’t know if I’m messing something but the fluka software does run showing the directory, the data, exec and input. When it starts with the first cycle, it shows a floating point exception and that the error is that the excutable returned RC=136.

Hello @khalil.alkhour ,

can you check if there is any message in the *.err , *.log or *.out files?

And the output of these commands?

which gfortran
gfortran -v

Thanks for your response and sorry for the delayed one from my part.

There’s no .err file and the .out one is empty but the .log displays the following message:

Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation.

Backtrace for this error:
#0 0x10c670b22
#1 0x10c670155
#2 0x7ff806e9de9c
#3 0x100d43891
#4 0x100efa6e2
#5 0x100ece62f
#6 0x101207ac0
#7 0x7ff806adb2cc

The gfortran version is the GNU Fortran (Homebrew GCC 14.2.0_1) 14.2.0

Hope this helps.

Hello @khalil.alkhour

You are using an environment based on HomeBrew, or even a mixed with MacPorts.
We recommend to use MacPorts for FLUKA/Flair installation.

Please refer to this thread for more details to fix the issue:

I hope this helps or if you have any further questions.

Cheers, Luigi

Dear Luigi,

I didn’t work, I removed everything related to Homebrew from my computer and tried with another Mac with the same setup and the problem is always is the same.

When I run the rfluka -M1 example.inp, I get the following error:

======================== Running FLUKA for cycle # 1 ========================
line 376:  7731 Illegal instruction: 4  "${EXE}" "${INPF}" > "${LOGF}" 2>&1
Error: "/pathtofluka/bin/fluka" executable returned RC=132

The gcc is the gcc14 from MacPorts:

gcc (MacPorts gcc14 14.2.0_3+stdlib_flag) 14.2.0
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Do you have any idea where this error might be getting from ?

Best

Hello @khalil.alkhour,

Could you confirm your Xcode or CLT version using these commands?

pkgutil --pkg-info=com.apple.pkg.CLTools_Executables

xcodebuild -version

From version 16 onwards, there is a known issue in the linker. If this is the case, you can refer to this solution:

Please let us know if this helps.

Best, Luigi

1 Like

This was it.

Thanks a lot :slight_smile: