schneebergerlab / syri

Synteny and Rearrangement Identifier
https://schneebergerlab.github.io/syri/
MIT License
303 stars 36 forks source link

Failure to compile on MacOS 13 / M1 Pro #210

Closed scottcain closed 10 months ago

scottcain commented 10 months ago

I am trying to compile on a MacBook Pro with 32 GB of RAM running MacOS 13.4.1. What I'm describing here happens on the main branch as well as on the V1.4.1 and V5 branches. My python environment looks like this:

Python 3.8.17
cython                    3.0.0
numpy                     1.24.4
scipy                     1.10.1
pandas                    2.0.3
python-igraph             0.8.3
psutil                    5.9.5
pysam                     0.9.1
matplotlib                3.5.3
biopython                 1.81

When I run python setup.py install, it fails with

7 warnings and 1 error generated.
error: command '/usr/bin/clang' failed with exit code 1

and the error message looks like

syri/pyxFiles/inversions.cpp:37936:22: error: expression is not assignable
    PY_MAJOR_VERSION = __Pyx_PyInt_As_int(o); if (unlikely((PY_MAJOR_VERSION == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 203, __pyx_L2_error)
    ~~~~~~~~~~~~~~~~ ^

Is there something I need to do differently to get this to compile on an M1?

mnshgl0110 commented 10 months ago

Hi @scottcain . Unfortunately, I do not use macOS, so difficult for me to test. Have you tried installing syri using anaconda? I think, that should work. Currently, I guess, the issue is arising based on how clang compiles. Maybe using g++ could help as well.

szhorvat commented 10 months ago

FYI something is fishy with your setup. python-igraph 0.8.3 is extremely outdated, and was released before any ARM-based Macs even became available. I do not even expect it to compile without errors with Apple toolchains that support ARM. Thus if you have this very old package installed, you are very likely running x86_64 code, not arm64 code.

scottcain commented 10 months ago

Yeah, python-igraph looked weird to me too; it is unclear to me why it tried to use that version--I certainly didn't force it to at any point. Anyway I forced conda to uninstall it, then did conda install syri and it seems to have worked fine. Thanks!