schneebergerlab / syri

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

Not able to compile v1.6.3 on Ubuntu 20.04 #212

Closed DimitriDDLNL closed 3 weeks ago

DimitriDDLNL commented 9 months ago

Hello,

I'm trying to install v1.6.3 on Ubuntu 20.04 without conda. All dependencies are installed and the package versions are all up-to-date. When trying to build extension 'syri.inversions' I'm getting the error:

building 'syri.inversions' extension
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.8/dist-packages/numpy/core/include -I/usr/include/python3.8 -c syri/pyxFiles/inversions.cpp -o build/temp.linux-x86_64-3.8/syri/pyxFiles/inversions.o
In file included from /usr/local/lib/python3.8/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1940,
                 from /usr/local/lib/python3.8/dist-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                 from /usr/local/lib/python3.8/dist-packages/numpy/core/include/numpy/arrayobject.h:5,
                 from syri/pyxFiles/inversions.cpp:1200:
/usr/local/lib/python3.8/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
   17 | #warning "Using deprecated NumPy API, disable it with " \
      |  ^~~~~~~
syri/pyxFiles/inversions.cpp: In function ‘int __pyx_import_star_set(PyObject*, PyObject*, char*)’:
syri/pyxFiles/inversions.cpp:38983:44: error: lvalue required as left operand of assignment
38983 |     PY_MAJOR_VERSION = __Pyx_PyInt_As_int(o);
      |                                            ^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

If I change this into a comparison with ==, then I only get a warning that the computed value is not used.

But then, exactly the same error pops-up while compiling extension syri.tdfunc on syri/pyxFiles/tdfunc.cpp 79149:44 and the line is identical to the other one in inversions.cpp.

When I make this change in these two places, then the code compiles and I get a working syri executable. Thank you for your time!

mnshgl0110 commented 9 months ago

Hi @DimitriDDLNL . Thanks a lot for checking this. The .cpp files are auto-generated by cython, so ideally this issue should not happen. My guess is this is caused by some recent changes either in cython or gcc itself. As of now, difficult to say what exactly is causing this and unfortunately I am a bit too occupied with other stuff to check this.

lrauschning commented 8 months ago

Hi, ran into this same issue. This occurs when building with a cython version >= 3.0, there seems to be some regression. I have changed the packaging and pinned cython to the last working version, once that PR is merged it should build again.

DimitriDDLNL commented 8 months ago

@lrauschning Thank you for looking into this and fixing it! I guess you can close the issue.