popsim-consortium / analysis2

Analysis for the second consortium paper.
8 stars 14 forks source link

Compatibility with macOS M1 #57

Closed lntran26 closed 5 months ago

lntran26 commented 2 years ago

When I follow the readme instruction to create the conda environment for analysis2, I got this error:

Solving environment: failed

ResolvePackageNotFound:

  • gxx
  • gcc

Removing these two from the environment.yml file allows me to create the environment but installing smc++ became a problem. The error I got when running pip install . in smcpp is

clang: error: unsupported option '-fopenmp' error: command '/usr/bin/g++' failed with exit code 1

I've tried installing gcc with homebrew but then I got a different error

gcc-11: warning: this compiler does not support x86 ('-arch' option ignored) gcc-11: error: unrecognized command-line option '-mssse3' error: command '/opt/homebrew/bin/gcc-11' failed with exit code 1

RyanGutenkunst commented 2 years ago

Do you have the Apple Developer Tools installed, via XCode? See the first part of this for guidelines: https://betterprogramming.pub/setting-up-a-macbook-m1-development-machine-cda22a92fa22 .

andrewkern commented 2 years ago

any update here @lntran26? thanks

xin-huang commented 2 years ago

I tried to use GNU GCC on Mac OS using Github Actions. It can compile dfe-alpha but it failed to compile smc++ https://github.com/xin-huang/analysis2/runs/7114496778?check_suite_focus=true This doesn't happen on Linux.

andrewkern commented 2 years ago

well that's strange, but I don't think it has anything to do with the m1 architecture?

RyanGutenkunst commented 2 years ago

smc++ compiles fine on my non-m1 mac... What a pain.

lntran26 commented 2 years ago

I do have Xcode installed on my laptop. From what I can gather about the M1 system, the default compiler it uses when gcc is called is clang. Since the first error seems to be saying that clang doesn't support the -fopenmp option, I tried to install gcc with homebrew (Rosetta) and change the path so that this gcc is used instead. But for this I got a different error, which was for the -msse3 flag not being recognized. Here's a few threads I found regarding the issue of using gcc on M1. It seems like an on-going development. https://discussions.apple.com/thread/252398918 https://github.com/Homebrew/discussions/discussions/2499 I've since moved on to just using Linux on our cluster to install and run the pipeline and everything works fine there as well.