Fresh Install of FLUKA and FLAIR on MacOS Sonoma 14.1

Hello FLUKA Forum,

I had FLUKA/FLAIR running on my Macbook with no issue, until I had to update my operating system. After the transition to Sonoma, my FLUKA /FLAIR installation was broken. I removed both directories and attempted a clean install. I followed the directions provided on the website, and have run into some errors. During this process I have made sure to update my Xcode Tools, and install the latest MacPorts version, as well as allowing that to update all of its ports. In attempting to “make” FLUKA, I received the following error:
(base) RJacob@rjacob-m17 src % make

gfortran -o /Users/RJacob/fluka4-4.0//bin/fluka -fuse-ld=bfd -L/Users/RJacob/fluka4-4.0//lib -lfluka -lstdc++ -lz

ld: unsupported tapi file type ‘!tapi-tbd’ in YAML file ‘/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libz.tbd’ for architecture x86_64

collect2: error: ld returned 1 exit status

make: *** [/Users/RJacob/fluka4-4.0//bin/fluka] Error 1

In perusing the user forums for help I ran the following command: export PATH=/opt/local/bin:/opt/local/sbin:$PATH

After running this command, the error message following “make” has become:
(base) RJacob@rjacob-m17 src % make

gfortran -o /Users/RJacob/fluka4-4.0//bin/fluka -fuse-ld=bfd -L/Users/RJacob/fluka4-4.0//lib -lfluka -lstdc++ -lz

-macosx_version_min has been renamed to -macos_version_min

ld: warning: ignoring duplicate libraries: ‘-lSystem’, ‘-lgcc’, ‘-lgcc_ext.10.5’

ld: unsupported mach-o filetype (only MH_OBJECT and MH_DYLIB can be linked) in ‘/usr/local/Cellar/gcc/11.2.0/lib/gcc/11/libgcc_ext.10.5.dylib’

collect2: error: ld returned 1 exit status

make: *** [/Users/RJacob/fluka4-4.0//bin/fluka] Error 1

Note, I have tried to install GCC 10 using MacPorts, but it fails every time. Any insight or assistance with this matter would be greatly appreciated.

Update: I updated HomeBrew and upgraded all of its packages. This allowed the “make” command to run, but the error is now:

(base) RJacob@rjacob-m17 src % make

Compiling: tools

gcc -c -o usbmax.o -I/Users/RJacob/fluka4-4.0//include -g -O3 -DNDEBUG -Wpacked -malign-double -mpreferred-stack-boundary=8 usbmax.c

clang: error: unknown argument: ‘-mpreferred-stack-boundary=8’

make[1]: *** [usbmax.o] Error 1

make: *** [tools] Error 2

Update Another attempt to make FLUKA has resulted in the following error message:

(base) RJacob@rjacob-m17 src % make

Compiling: tools

gfortran -o /Users/RJacob/fluka4-4.0//bin/atmloc atmloc.o -L/Users/RJacob/fluka4-4.0//lib -lfluka -lstdc++ -lz

ld: unsupported tapi file type ‘!tapi-tbd’ in YAML file ‘/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/lib/libz.tbd’ for architecture x86_64

collect2: error: ld returned 1 exit status

make[1]: *** [/Users/RJacob/fluka4-4.0//bin/atmloc] Error 1

make: *** [tools] Error 2

Thank you,
Robert

Dear @RJacob

The mixed environment MacPorts / HomeBrew can lead to inconsistencies. Better to avoid and – if you need to use both – be sure that the environment PATH in the Terminal where you use FLUKA/Flair includes MacPorts executable directories first (as you have done):

PATH=/opt/local/bin:/opt/local/sbin:$PATH

Even with that, there’s no guarantee you wont’s run into issues.

Based on past experience, the MacPorts migration from an old OSX version to a newer one can leave inconsistencies in the MacPorts installation.
I would recommend to reinstall gcc port after having wiped all installed ports.
To be more specific:

  1. save the list of the requested ports as reference
    port echo requested
  2. remove all ports with the command
    sudo port uninstall installed
  3. install gcc10 (I assume you have an Intel processor):
    sudo port install gcc10
  4. recompile FLUKA
    make clean and make
    For more details on FLUKA installation, refer to the FLUKA web page.

Concerning additional packages needed by Flair, refer to the instructions on the Flair web site, in particular, the sections Mac OsX and Compile from source.

Please let us know if this can help.

Hi Luigi,

Thank you for your help! I made it through steps 1 and 2 successfully. However, when I attempt to run the command sudo port install gcc I am returned an error. When I specify sudo port install gcc10, the libgcc11 will build successfully, however libgcc10 fails consistently. Is it necessary to have gcc10 specifically for the make process? I was able to completely compile gcc13, so I attempted to compile FLUKA and received the same error as before. Yes, I am running an Intel processor.

(base) RJacob@rjacob-m17 src % make
gfortran -o /Users/RJacob/fluka4-4.0//bin/fluka -fuse-ld=bfd -L/Users/RJacob/fluka4-4.0//lib -lfluka -lstdc++ -lz
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/lib/libz.tbd' for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [/Users/RJacob/fluka4-4.0//bin/fluka] Error 1

Hello @RJacob

sorry there was a typo in my previous post (which I corrected now).

Both gcc10 or gcc11 should work, i.e.
sudo port install gcc10
sudo port install gcc11

Could you post the output of the command?
which gfortran

Cheers Luigi

Hi Luigi,

Here is the output:

(base) RJacob@RJacob-M17 ~ % which gfortran
/usr/local/bin/gfortran

Compiling gcc10 is still failing, as is the fluka compile. I have since installed a Virtual Machine and have Fluka/FLAIR running in that environment. So, this Mac compilation is no longer a priority, but I am happy to continue troubleshooting to help future users.

Thanks,
Rob

Hi @RJacob

It looks like you’re not using the compiler from MacPorts, which is normally /opt/local/bin/gfortran."

I suspect there may be an issue with your environment, especially with the PATH variable (probably due to the mixed MacPorts/HomeBrew system).

I’m glad you found a workaround.

Cheers Luigi