millanek / fineRADstructure

A package for population structure inference from RAD-seq data
https://www.milan-malinsky.org/fineradstructure
Other
31 stars 7 forks source link

configure for Apple M1 processor #19

Open tommydevitt opened 2 years ago

tommydevitt commented 2 years ago

Trying to install on an Apple M1 processor and getting the following error message after issuing the 'make' command. Any help is appreciated.

g++ -DPACKAGE_NAME=\"fineRADstructure\" -DPACKAGE_TARNAME=\"fineradstructure\" -DPACKAGE_VERSION=\"0.3.1\" -DPACKAGE_STRING=\"fineRADstructure\ 0.3.1\" -DPACKAGE_BUGREPORT=\"milan.malinsky@unibas.ch\" -DPACKAGE_URL=\"\" -DPACKAGE=\"fineradstructure\" -DVERSION=\"0.3.1\" -DHAVE_LIBZ=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE__BOOL=1 -DHAVE_STDBOOL_H=1 -DHAVE_POW=1 -DHAVE_SELECT=1 -DHAVE_SQRT=1 -DHAVE_STRCHR=1 -DHAVE_STRTOUL=1 -I. -I/opt/homebrew/Cellar/gsl/2.7/include -O3 -Wall -mfpmath=sse -msse -msse2 -funroll-loops -fomit-frame-pointer -ftree-vectorize -funsafe-math-optimizations -lgsl -lgslcblas -Wall -g -O2 -MT finestructure-safegetline.o -MD -MP -MF .deps/finestructure-safegetline.Tpo -c -o finestructure-safegetline.o test -f 'safegetline.cpp' || echo './'safegetline.cpp clang: warning: -lgsl: 'linker' input unused [-Wunused-command-line-argument] clang: warning: -lgslcblas: 'linker' input unused [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-msse' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-msse2' [-Wunused-command-line-argument] error: unknown FP unit 'sse' make: *** [finestructure-safegetline.o] Error 1

dorseyb commented 9 months ago

I am getting the same error on a Mac M1 Ultra. Any help would be great. Thanks.

XWBarton commented 7 months ago

Howdy,

I've found a bit of a workaround that may work for you.

First you need to actually point the gcc command to the gcc compiler and not the clang compiler (which is the default Apple one). I had to do this to properly install stacks as well.

Here's how I did that:

brew install gcc cd /opt/homebrew/bin ln -s gcc-11 gcc ln -s g++-11 g++ export PATH=/opt/homebrew/bin:$PATH

Then I removed some troublesome flags from the Makefile which cause problems with Apple Silicon. I was having issues with:

'-mfpmath=sse' '-msse' '-msse2'

Which I believe is something to do with multithreading, which will kneecap that function. Yet, cmd+f for those flags in the makefile and run the instructions as normal and then it should compile correctly.

Hopefully this helps, its just me blindly trying to work it out :D

mazepago commented 3 weeks ago

Thanks a lot, XWBarton, managed to solve this "make" issue following your recipe!!!