Flair crashes in Geometry tab (macOs)

Versions

Please provide the used software versions.

FLUKA: 4-5.2
Flair: 3.4-5.4
Operating system: macOS 26.3.1
Python 3.13.14

Description

Please describe the issue. In case of reporting a bug, please provide step-by-step instructions for reproducing the error.

Dear Flair experts,

Flair crashes every time I switch to the geometry tab. I have tried following the steps from previous discussions, but still couldn’t solve the problem due to outdated systems or packages.

./flair: line 18: 40092 Segmentation fault: 11 ${PYTHON} -O -W ignore ${DIR}/flair.py "$@"

Everything else in Flair seems to work fine.

Please let me know if there is any way to resolve this issue. Thank you very much.

Best regards,
Heiley

Input files

Please upload all relevant files. (FLUKA input file, Flair project file, user routines, and data files)

Dear @HeileyWong,

Sorry for the late reply, I overlooked this thread.

As you suggested, the issue is related to some misconfiguration in the environment.
Unless you have not yet fixed the problem, I would suggest removing all ports with the command sudo port -fp uninstall installed and installing all the required packages following the instructions here.

If this does not solve the issue, please provide the output of these commands for troubleshooting:

pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
echo $PATH
gcc -v
port echo requested
port select --summary
port installed | grep -w tk

Best regards, Luigi

Dear @luillo ,

I reply to this thread since I am encountering a very similar error as the one of @HeileyWong .

/Users/Matteo/FLUKA/flair-3.4/flair: line 18: 15663 Bus error: 10           ${PYTHON} -O -W ignore ${DIR}/flair.py "$@"

This error appears “semi-randomly” and it’s 100% reproducible all the times but almost half of the times I’m clicking to the INPUT tab from the GEOMETRY one and viceversa.

Another weird thing that is happening to me is related to geo-viewer; instead of moving the camera around the model, it’s like I am dragging the viewports and the model around.

Anyway, I attached my outputs of the commands you requested.

pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 26.6.0.0.1781586589
volume: /
location: /
install-time: 1782721014
echo $PATH
/Users/Matteo/BDSIM/bdsim-install/bin/../bin:/Users/Matteo/GEANT4/install/bin:/opt/local/bin:/opt/local/sbin:/Users/Matteo/Library/Python/3.13/bin:/opt/homebrew/opt/qt@5/bin:/opt/homebrew/Cellar/root/6.40.02/bin:/Users/Matteo/FLUKA/fluka4-5.2/bin:/opt/homebrew/sbin:/opt/homebrew/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/homebrew/Caskroom/miniforge/base/condabin:/Users/Matteo/BDSIM/bdsim-install/bin/../bin:/Users/Matteo/GEANT4/install/bin:/opt/local/bin:/opt/local/sbin:/Users/Matteo/Library/Python/3.13/bin:/opt/homebrew/opt/qt@5/bin:/Users/Matteo/FLUKA/fluka4-5.2/bin:/opt/homebrew/sbin:/opt/homebrew/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/pkg/env/global/bin:/Library/Apple/usr/bin:/Applications/VMware Fusion.app/Contents/Public:/usr/local/share/dotnet:~/.dotnet/tools:/Applications/iTerm.app/Contents/Resources/utilities:/Users/Matteo/.local/bin:/Users/Matteo/GEANT4/install/bin:/Users/Matteo/BDSIM/bdsim-install/bin:/Users/Matteo/Scripts:/Users/Matteo/GEANT4/install/bin:/Users/Matteo/BDSIM/bdsim-install/bin:/Users/Matteo/Scripts
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/aarch64-apple-darwin25/14.3.0/lto-wrapper
Target: aarch64-apple-darwin25
Configured with: /opt/local/var/macports/build/gcc14-d0edef85/work/gcc-14.3.0/configure --prefix=/opt/local --build=aarch64-apple-darwin25 --enable-languages=c,c++,objc,obj-c++,lto,fortran,m2,jit --libdir=/opt/local/lib/gcc14 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-14 --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-14 --with-gxx-include-dir=/opt/local/include/gcc14/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-isl=/opt/local --with-zstd=/opt/local --enable-checking=release --disable-multilib --enable-lto --enable-libstdcxx-time --with-build-config=bootstrap-debug --with-as=/opt/local/bin/as --with-ld=/opt/local/bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --enable-host-shared --with-darwin-extra-rpath=/opt/local/lib/libgcc --with-libiconv-prefix=/opt/local --disable-tls --with-gxx-libcxx-include-dir=/opt/local/libexec/gcc14/libc++/include/c++/v1 --with-pkgversion='MacPorts gcc14 14.3.0_0+stdlib_flag' --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.3.0 (MacPorts gcc14 14.3.0_0+stdlib_flag)
sudo port echo requested
gcc14                          @14.3.0_0+stdlib_flag
ghostscript                    @10.07.1_0+x11
gnuplot                        @6.0.4_0+aquaterm+luaterm+pangocairo+qt5+wxwidgets
pkgconfig                      @0.29.2_0
py313-pydicom                  @3.0.2_0
py313-scipy                    @1.18.0_1+accelerate+gfortran
py313-tkinter                  @3.13.14_1+quartz
tcl                            @8.6.18_0
tk                             @8.6.18_0+x11
xorg                           @20090316_0
xorg-server                    @1.20.11_1
xterm                          @406_0
 sudo port select --summary
Name       Selected   Options
====       ========   =======
clang      none       mp-clang-19 none
fonttools  none       fonttools-313 none
gcc        mp-gcc14   mp-gcc14 none
llvm       none       mp-llvm-19 mp-llvm-22 none
pip        pip313     none
pip3       pip313     none
python     python313  python313 python314 none
python3    python313  python313 python314 none
wxWidgets  none       wxWidgets-3.2 none
sudo port installed | grep -w tk
  tk @8.6.18_0+x11 (active)

Many thanks in advance for your help.

Cheers,

Matteo

Dear @mcapitan,

Your environment variable PATH includes both Homebrew and MacPorts paths. This is a source of potential conflicts between libraries provided by the package managers.
I’d recommend keeping the two package managers separated.
Please follow the instructions from this post.

Let me know if this works for you.
Best regards

Dear @luillo

Thank you for the fast reply!

I tried to follow your advice and I even completely uninstalled brew from my system (just for the compilation of geoviewer), but the same but I got the same bug…

As you can see my PATH variable does not have any reference to brew:

echo $PATH
/Users/Matteo/BDSIM/bdsim-install/bin/../bin:/Users/Matteo/GEANT4/install/bin:/Users/Matteo/Library/Python/3.13/bin:/Users/Matteo/FLUKA/fluka4-5.2/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/Users/Matteo/BDSIM/bdsim-install/bin/../bin:/Users/Matteo/GEANT4/install/bin:/Users/Matteo/Library/Python/3.13/bin:/Users/Matteo/FLUKA/fluka4-5.2/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/pkg/env/global/bin:/Library/Apple/usr/bin:/Applications/VMware Fusion.app/Contents/Public:/usr/local/share/dotnet:~/.dotnet/tools:/opt/homebrew/bin:/Applications/iTerm.app/Contents/Resources/utilities:/Users/Matteo/.local/bin:/Users/Matteo/GEANT4/install/bin:/Users/Matteo/BDSIM/bdsim-install/bin:/Users/Matteo/Scripts:/Users/Matteo/GEANT4/install/bin:/Users/Matteo/BDSIM/bdsim-install/bin:/Users/Matteo/Scripts

Moreover, during the compilation process of geoviewer, make couldn’t find the tcl libraries and I had to force it via the following commands:

export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig:/opt/local/lib/tcl8/pkgconfig

Maybe the two things are related?

I remain at your disposal for whatever test you need to perform.

Cheers,
Matteo

Dear @mcapitan,

I noticed there are other directories in your PATH variable. Perhaps the python3 executable isn’t the one from MacPorts. You can check this by running which python3. To test further, remove everything from the PATH variable before the MacPorts directories.

It’s strange that tcl isn’t found. They should be located with the utility pkg-config you installed.
Can you check where this executable is located with the command which pkg-config and what is the output of pkg-config --libs tk?

Best Luigi

Dear @luillo ,

I still got the same issue…

I tried to compile geoviewer in a new window with only the MacPorts (and the system core utilities) in the PATH as following

 echo $PATH
/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin

My python/python3 is the one installed via MacPorts, as well as the pkg-config utility:

which python3
/opt/local/bin/python3
which python
/opt/local/bin/python
which pkg-config
/opt/local/bin/pkg-config

However, the output of pkg-config --libs tk is empty before I run the export PKG_CONFIG_PATH=... command:

pkg-config --libs tk
Package tcl was not found in the pkg-config search path.
Perhaps you should add the directory containing `tcl.pc'
to the PKG_CONFIG_PATH environment variable
Package 'tcl', required by 'tk', not found 

while after the export, it gives:

-L/opt/local/lib/tk8-x11 -L/opt/local/lib/tcl8 -ltk8.6 -ltkstub8.6 -ltcl8.6 -ltclstub8.6

and the compilation will proceed as normal, but the resulting flair installation is very unstable and crashes often.

Cheers,
Matteo

Dear @mcapitan,

I have a setup similar to yours that works perfectly.

Before compiling the geoviewer, ensure you run a make clean command. If that doesn’t help, you might want to check your MacPorts installation using the following commands:

sudo port selfupdate
sudo port upgrade outdated
sudo port reclaim

Alternatively, you could remove all installed ports with sudo port -fp uninstall installed and then reinstall.

Please let me know what you find.

Cheers, Luigi

Dear @luillo

Sorry for the late reply but i was on vacation these past weeks.

In the meantime, i tried your suggestion and I even formatted my mac and reinstalled Macports and FLUKA from scratch but i got the same exact symptoms.

Still the same crash and pkg-config is unable to locate tcl before explicitly exporting the libraries path.

Moreover, I saw that other people have found the same issue (FLAIR 3.4-5.4 crashes on Mac ) so I suspect that something broke in the tk package distributed by Macports.

Cheers,
Matteo

Dear @mcapitan,

I’ve reproduced the crash. MacPorts now install both tk/tcl 8.6 and 9.0, which can cause a library mismatch between Python and geoviewer.

Here’s how to fix it on my Mac:
sudo port -f uninstall py314-tkinter
sudo port install py314-tkinter +x11 -tk9

Since you have a different Python version, adjust the commands accordingly.

You might also need to run:
sudo port upgrade —enforce-variants py314-Pillow py314-matplotlib +x11 -tk9

Again, adjust this command for your Python version.

Finally, run make clean inside Geoviewer and recompile it.

Let me know if this works for you too.

Cheers, Luigi

Dear @luillo

Thank you!

I still had to export the libraries path in order to find tk/tcl with the following command:

export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig:/opt/local/lib/tcl8/pkgconfig

but after it compiled without any problems and flair now seems much more stable. I will test more thoroughly in the next days but for now this solution seems to work.
I suggest to add this additional step to the installation guide on the flair website.

One last note is that the weird visualization bug remains. I have my personal laptop with flair 3.4.5.2 and fluka 4.5.1 installed and here when i move around in the geometry tab, the viewport follow the mouse flawlessly and instantly.

Now instead, at first I move around the viewport lines and then the geometry gets redrawn in the new position. Maybe it’s something that changed with the flair upgrade? If that’s the case, personally I am not a big fan of this change :wink:

Thank you again for your great help!

Cheers,
Matteo

Hi @mcapitan ,

Glad that it works.

Could you please send me the error message in case the PKG_CONFIG_PATH is not set?

Concerning this issue,

Have you tested the latest Flair/geoviewer version 3.4-5.4?

Cheers Luigi

Dear @luillo

Here you can find the complete log of the geoviewer compilation when the PKG_CONFIG_PATH is not set.
log_geoviewer_compilation.txt (55.9 KB)

Regarding the latest version, what i’m installing on the working machine is the 3.4.5.4 version (i.e. the one with graphical bug). I would like to keep my installation of FLUKA on my laptop as it is since it’s quite stable and it was the only way I could reliably work with FLUKA during the past month.

Cheers,
Matteo