magv / feynson

A tool for Feynman integral symmetries.
2 stars 1 forks source link

Compiling feynson on M1 Macs #2

Closed vsht closed 1 year ago

vsht commented 1 year ago

I've been trying to help a colleague to get feynson compiled on an M1 MacBook, but unfortunately we didn't really get far.

On an Intel machine the installation is very simple. Essentially it boils down to running

git clone https://github.com/magv/feynson.git
cd feynson
brew install cln
brew install ginac
brew install nauty 
make

However, since neither ginac nor cln are officially available on homebew for M1, things get pretty contrived here.

So I'm wondering if you've already tried something similar? Perhaps it would be also possible to offer a statically linked feynson binary for M1?

vsht commented 1 year ago

Ok, I sort of got it working by first compiling feynson on an Intel Mac with ginac, cln and gmp statically linked

Bildschirmfoto vom 2023-03-29 17-59-44

and then copying the x86 binary to our M1 Mac. This seems to work fine thanks to Rosetta, although we didn't really test it much yet. I'm also attaching the binary in the case someone runs into similar issues.

feynson.zip

magv commented 1 year ago

You should compile the dependencies by hand more or less. I'm not sure how well do GiNaC & CLN work on M1, but at least they can be made to compile; CLN needs the latest commit and the -DNO_ASM flag though.

You can use my installation scripts at github.com/magv/hepware for this. With those I think you can build feynson and all the dependencies with make -j8 feynson.done CC=gcc-12 CXX=g++-12 CFLAGS="-DNO_ASM" if you'll first install GCC 12 (via brew install gcc) and remove -Wl,--gc-sections from the Makefile.

vsht commented 1 year ago

Many thanks for the hint with hepware. My colleague followed this path and managed to compile feynson on his M1 Mac. I guess that this should be it for now.