shangjingbo1226 / AutoPhrase

AutoPhrase: Automated Phrase Mining from Massive Text Corpora
Apache License 2.0
1.17k stars 272 forks source link

Running on Apple Silicon #106

Open AdamGEmerson opened 1 year ago

AdamGEmerson commented 1 year ago

I ran into some issues running the library on Apple silicon due to the fact that gcc-6 only offers x_86 support.

I was able to fix this by modifying the Makefile to use gcc-12, which works for both mac and intel chips. I also had to remove the -msse2 flags, which appear to be related to Microsoft security features for Windows.

Perhaps we should update the readme to include information for Apple Silicon?

zhezhaozz commented 4 weeks ago

Can I ask how you modified the Makefile to the use later version of gcc?

AdamGEmerson commented 2 weeks ago

Hey @zhezhaozz, unfortunately I don't have the modified code anymore.

I believe that in /Makefile I modified the CLFAGS line, removing the -msse2 flag.

CFLAGS = -std=c++11 -Wall -O3 -fopenmp  -I..

Then I think in /compile.sh, CXX=g++-6 gets changed to CXX=g++-12 but I'm not certain and you might need to play around with that flag.

if [ "$(uname)" == "Darwin" ]; then
    make all CXX=g++-12 | grep -v "Nothing to be done for"

If you get it working let me know.