MacOS-13 cannot install fluka successfully

Dear Technician!
I have the same problem, I have Intel version of MacOS-13, but when I use the port to install gcc10 or gcc11 it keeps failing with the message:" sudo port install gcc10
gcc10 is known to fail. Try to install anyway? [y/N]“. Then I see on the MacPorts website that it doesn’t support my OS, but at least gcc12. Even if I successfully install the gcc-10 or gcc-11 version using homebrew, and set up my system environment correctly as gnu, I still get a compile error that says: " clang: error:unknown argument: ‘-mpreferred-stack-boundary=8’” , what should I do to solve this problem?
Thank you,
Baisong

Dear Experts,
I’m installing fluka using the Intel version of MacOS-13, but I’m having problems with make. I’m using gcc-11 downloaded from brewhome. How can I fix it?


Any suggestion will be appreciated.

Thanking you in advance.

Dear @zhoubaisong

pls install gcc12 or later.

Previous version are known to fail on you OSX, as reported here

Please let us know that it works for you.

Cheers Luigi

Dear @luillo
Thank you very much! I have solved the problem!
But now I have another problem, can you help me more?

Now that I’ve installed “flair” and “geoviewer”, but I can’t run my input files or the default examples provided by the program properly, and I can’t visualize. Whenever I click on visualize, the program automatically reports an error and exits, showing an error like this:

the output file is:
Started 2024.03.11 20:02:39
- Running: mu
Dir: /Users/zhou/Desktop
Cmd: /usr/bin/nohup /Users/zhou/FLUKA/fluka4-4.0/bin/rfluka -M 5 mu.inp

                               F L U K A

Dir: /Users/zhou/FLUKA/fluka4-4.0
Data: /Users/zhou/FLUKA/fluka4-4.0/data
Exec: /Users/zhou/FLUKA/fluka4-4.0/bin/fluka
Input: /Users/zhou/Desktop/mu.inp
Initial seed copied from /Users/zhou/FLUKA/fluka4-4.0/data
Running fluka in /Users/zhou/Desktop/fluka_76228

======================== Running FLUKA for cycle # 1 ========================

/Users/zhou/FLUKA/fluka4-4.0/bin/rfluka: line 376: 76279 Floating point exception: 8 (core dumped) “{EXE}" "{INPF}” > “${LOGF}” 2>&1
Error: “/Users/zhou/FLUKA/fluka4-4.0/bin/fluka” executable returned RC=136

And when I want to visualize, it prints:

Here is my environment:

And some of the required modules were installed by homebrew, and some were installed by a virtual environment in anaconda. The reason I don’t use MacPorts is that the framework would conflict with my existing homebrew, so I use homebrew exclusively to install my environment.

Any suggestion will be appreciated.

Thanking you in advance.
Baisong

Dear @zhoubaisong

we don’t have workable solution with HomeBrew.
Therefore, we recommend to install both FLUKA and Flair in a MacPorts environments.

I can suggest to install MacPorts in a dedicated environment on you machine (to be properly setup with the configuration shell files in order not to interfere with HomeBrew).

Another solution may be to install FLUKA/Flair in a virtual machine.

Kind regards Luigi

Dear @luillo
I’m very sorry for getting back to you so late. I’ve checked and it’s not the environment, because even if I use all of MacPorts’ environment, I still get the same problem.

                               F L U K A

Dir: /Users/zhou/FLUKA/fluka4-4.0
Data: /Users/zhou/FLUKA/fluka4-4.0/data
Exec: /Users/zhou/FLUKA/fluka4-4.0/bin/fluka
Input: /Users/zhou/Desktop/mu.inp
Initial seed copied from /Users/zhou/FLUKA/fluka4-4.0/data
Running fluka in /Users/zhou/Desktop/fluka_28102

======================== Running FLUKA for cycle # 1 ========================

/Users/zhou/FLUKA/fluka4-4.0/bin/rfluka: line 376: 28153 Floating point exception: 8 (core dumped) “{EXE}" "{INPF}” > “${LOGF}” 2>&1
Error: “/Users/zhou/FLUKA/fluka4-4.0/bin/fluka” executable returned RC=136

Just now I saw another poster, link: " SIGFPE: Floating-point exception - erroneous arithmetic operation - #4 by horvathd ", where I encountered a problem very similar to his, but this one referred to a Linux environment and I am on MacOS, and when I also tried to use the script given by the expert, it compiled and ran with an error: no fluka file, as shown in the screenshot below.

So I suspect that it’s not a problem with the environment, but that the program doesn’t want to be compatible with my laptop. Is it possible to try to debug it for me based on the modifications in this article?

Can you help me? Thank you very much!

Best regards,
Baisong

Dear @zhoubaisong

In a new Terminal, please check your environment with these commands (1):

xcodebuild -version
pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
which g++ gcc gfortran ar
gfortran -v
echo $PATH

Be sure that gfortran is v12 or later, and is from the MacPorts binary directory /opt/local/bin

Then please re-compile FLUKA and test it (2):

cd <path FLUKA>/src
make clean
make
cd <path FLUKA>/example
../bin/rfluka -M1 example.inp

In case you still have problem, please send the output of the commands (1).

Best regards Luigi