-
-
Notifications
You must be signed in to change notification settings - Fork 25.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUILD gcc14 cannot compile scikit-learn #28530
Comments
Not sure if relevant, but we now require cython=3.0.8 as minimum version. Otherwise I'm not sure. Can you reproduce with a conda/mamba environment and give us the lock file? |
Fedora Rawhide python3-cython already with 3.0.8, see https://fedora.pkgs.org/rawhide/fedora-x86_64/python3-cython-3.0.8-1.fc40.x86_64.rpm.html P.S. They just update Python3 to 3.12.2, see https://fedora.pkgs.org/rawhide/fedora-x86_64/python3-devel-3.12.2-1.fc40.x86_64.rpm.html P.P.S. They also update GCC to 14.0.1, see https://fedora.pkgs.org/rawhide/fedora-x86_64/gcc-14.0.1-0.7.fc41.x86_64.rpm.html
|
@lesteve would you know maybe? |
I was about to report the same problem. This is related with cython/cython#2747 This problem was mentioned in a bug open to keep track of the effort to remove all compilation warnings #24875 (search "Incompatible pointers types casts") With gcc < 14 the code compiles with Fedora bug: https://bugzilla.redhat.com/show_bug.cgi?id=2261602 |
I see. GCC=14 hasn't landed on conda-forge yet, and not even on archlinux. So it's gonna be fun to fix. |
How about temporarily passing Any hints for passing this to Cython to GCC, from our existing setup.py? I could give a try locally and let's test it? Also see gentoo/gentoo@786a157 |
git clean -xdf git submodule sync git submodule update --init tar zcvf ../python-scikit-learn_1.4.1+post1.orig.tar.gz --exclude=.git . debuild -uc -us cp python-scikit-learn.spec ../python-scikit-learn_1.4.1+post1-1.spec cp ../python*-scikit-learn*1.4.1+post1*.{gz,xz,spec,dsc} /osc/home\:alvistack/scikit-learn-scikit-learn-1.4.1+post1/ rm -rf ../python*-scikit-learn*1.4.1+post1*.* ../python*-sklearn*1.4.1+post1*.* See scikit-learn#28530 Signed-off-by: Wong Hoi Sing Edison <[email protected]>
git clean -xdf git submodule sync git submodule update --init tar zcvf ../python-scikit-learn_1.4.0.orig.tar.gz --exclude=.git . debuild -uc -us cp python-scikit-learn.spec ../python-scikit-learn_1.4.0-1.spec cp ../python*-scikit-learn*1.4.0*.{gz,xz,spec,dsc} /osc/home\:alvistack/scikit-learn-scikit-learn-1.4.0/ rm -rf ../python*-scikit-learn*1.4.0*.* ../python*-sklearn*1.4.0*.* See scikit-learn#28530 Signed-off-by: Wong Hoi Sing Edison <[email protected]>
git clean -xdf git submodule sync git submodule update --init tar zcvf ../python-scikit-learn_1.4.0.orig.tar.gz --exclude=.git . debuild -uc -us cp python-scikit-learn.spec ../python-scikit-learn_1.4.0-1.spec cp ../python*-scikit-learn*1.4.0*.{gz,xz,spec,dsc} /osc/home\:alvistack/scikit-learn-scikit-learn-1.4.0/ rm -rf ../python*-scikit-learn*1.4.0*.* ../python*-sklearn*1.4.0*.* See scikit-learn#28530 Signed-off-by: Wong Hoi Sing Edison <[email protected]>
git clean -xdf git submodule sync git submodule update --init tar zcvf ../python-scikit-learn_1.3.2.orig.tar.gz --exclude=.git . debuild -uc -us cp python-scikit-learn.spec ../python-scikit-learn_1.3.2-1.spec cp ../python*-scikit-learn*1.3.2*.{gz,xz,spec,dsc} /osc/home\:alvistack/scikit-learn-scikit-learn-1.3.2/ rm -rf ../python*-scikit-learn*1.3.2*.* ../python*-sklearn*1.3.2*.* See scikit-learn#28530 Signed-off-by: Wong Hoi Sing Edison <[email protected]>
git clean -xdf git submodule sync git submodule update --init tar zcvf ../python-scikit-learn_1.3.2.orig.tar.gz --exclude=.git . debuild -uc -us cp python-scikit-learn.spec ../python-scikit-learn_1.3.2-1.spec cp ../python*-scikit-learn*1.3.2*.{gz,xz,spec,dsc} /osc/home\:alvistack/scikit-learn-scikit-learn-1.3.2/ rm -rf ../python*-scikit-learn*1.3.2*.* ../python*-sklearn*1.3.2*.* See scikit-learn#28530 Signed-off-by: Wong Hoi Sing Edison <[email protected]>
git clean -xdf git submodule sync git submodule update --init tar zcvf ../python-scikit-learn_0.24.2.orig.tar.gz --exclude=.git . debuild -uc -us cp python-scikit-learn.spec ../python-scikit-learn_0.24.2-1.spec cp ../python*-scikit-learn*0.24.2*.{gz,xz,spec,dsc} /osc/home\:alvistack/scikit-learn-scikit-learn-0.24.2/ rm -rf ../python*-scikit-learn*0.24.2*.* ../python*-sklearn*0.24.2*.* See scikit-learn#28530 Signed-off-by: Wong Hoi Sing Edison <[email protected]>
Hi, Thank you for reporting this problem. I think that this kind of warning (or error as of gcc 14) is inherent to Cython's implementation of class polymorphism and method dispatch. For now, I recommend deactivating the warning and pursuing the discussion on cython/cython#2747. |
A posible workaround is to remove the scikit-learn/sklearn/metrics/_dist_metrics.pyx.tp Line 1480 in 74d1307
With that change, cython generates correct code (I don't know why). But removing the |
IIRC we can also replace |
@sergiopasra : I think your proposal would be the best approach on the long-term if Cython is this used since it is unlikely that those methods are effectively inlined. Could you open a PR? |
git clean -xdf git submodule sync git submodule update --init tar zcvf ../python-scikit-learn_0.24.2.orig.tar.gz --exclude=.git . debuild -uc -us cp python-scikit-learn.spec ../python-scikit-learn_0.24.2-1.spec cp ../python*-scikit-learn*0.24.2*.{gz,xz,spec,dsc} /osc/home\:alvistack/scikit-learn-scikit-learn-0.24.2/ rm -rf ../python*-scikit-learn*0.24.2*.* ../python*-sklearn*0.24.2*.* See scikit-learn#28530 Signed-off-by: Wong Hoi Sing Edison <[email protected]>
git clean -xdf git submodule sync git submodule update --init tar zcvf ../python-scikit-learn_1.4.1.post1.orig.tar.gz --exclude=.git . debuild -uc -us cp python-scikit-learn.spec ../python-scikit-learn_1.4.1.post1-1.spec cp ../python*-scikit-learn*1.4.1.post1*.{gz,xz,spec,dsc} /osc/home\:alvistack/scikit-learn-scikit-learn-1.4.1.post1/ rm -rf ../python*-scikit-learn*1.4.1.post1*.* ../python*-sklearn*1.4.1.post1*.* See scikit-learn#28530 Signed-off-by: Wong Hoi Sing Edison <[email protected]>
At least I could confirm that adding following lines making Fedora Rawhide working fine (see alvistack@75f6060#diff-d7bb055047e0934d04bfd2ce3f3be1476f609cebd726cc347fd87ba11d799b62R52-R54):
|
This is related with cython/cython#2747 This problem was mentioned in a bug open to keep track of the effort to remove all compilation warnings scikit-learn#24875 (search "Incompatible pointers types casts") With gcc < 14 the code compiles with incompatible-pointer warning. But with gcc 14 that warning is an error. Fedora bug: https://bugzilla.redhat.com/show_bug.cgi?id=2261602 A posible workaround is to remove the inline in the definition of the rdist_csr and rdistmembers. With that change, cython generates correct code (I don't know why). But removing the inline can impact the performance. Fixes scikit-learn#28530 Signed-off-by: Wong Hoi Sing Edison <[email protected]>
@sergiopasra confirm this suggestion working fine:
PR opened as #28541 |
I followed the "Steps/Code to Reproduce" to build with GCC 14 (on aarch64) and Cython 3.0.9 and I can no longer reproduce, which seems to confirms what @da-woods announced in #28541 (comment). @sergiopasra do you confirm we can close this issue alongside with #28541? |
Closing, feel free to reopen if you still experience the problem. |
This must have been properly fixed by cython/cython#6085 which will feature in Cython 3.0.10. |
Describe the bug
When building 1.3.2+ with Fedora Rawhide at OBS, it is now failed with below error message (see https://build.opensuse.org/package/live_build_log/home:alvistack/scikit-learn-scikit-learn-1.4.1+post1/Fedora_Rawhide/x86_64):
Steps/Code to Reproduce
Fixes (see #28530 (comment)):
Expected Results
Build successful.
Actual Results
As shown above.
Versions
The text was updated successfully, but these errors were encountered: