Skip to content

Conversation

@tobiasdiez
Copy link
Contributor

Replaces openblas by accelerate in the conda env.

Note: added virtual-packages.yml to define virtual package __osx with a recent macOS platform so that the accelerate package can be used.

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

Note: added `virtual-packages.yml` to define virtual package `__osx` with a recent macOS platform so that the accelerate package can be used.
@tobiasdiez
Copy link
Contributor Author

@dimpase it fails to build now:

[615/1782] Compiling C++ object src/sage/libs/linbox/linbox_flint_interface.cpython-311-darwin.so.p/meson-generated_src_sage_libs_linbox_linbox_flint_interface.pyx.cpp.o
  FAILED: [code=1] src/sage/libs/linbox/linbox_flint_interface.cpython-311-darwin.so.p/meson-generated_src_sage_libs_linbox_linbox_flint_interface.pyx.cpp.o
  ccache arm64-apple-darwin20.0.0-clang++ -Isrc/sage/libs/linbox/linbox_flint_interface.cpython-311-darwin.so.p -Isrc/sage/libs/linbox -I../src/sage/libs/linbox -Isrc/sage/libs/flint -I../src/sage/libs/flint -I/Users/runner/miniconda3/envs/sage-dev/include/python3.11 -I/Users/runner/miniconda3/envs/sage-dev/include -fvisibility=hidden -fvisibility-inlines-hidden -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++11 -O3 -ftree-vectorize -fPIC -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -fmessage-length=0 -isystem /Users/runner/miniconda3/envs/sage-dev/include -D_FORTIFY_SOURCE=2 -isystem /Users/runner/miniconda3/envs/sage-dev/include -DDISABLE_COMMENTATOR -pthread -DFFLAS_COMPILED -DFFPACK_COMPILED -F/Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework -idirafter/Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Headers -MD -MQ src/sage/libs/linbox/linbox_flint_interface.cpython-311-darwin.so.p/meson-generated_src_sage_libs_linbox_linbox_flint_interface.pyx.cpp.o -MF src/sage/libs/linbox/linbox_flint_interface.cpython-311-darwin.so.p/meson-generated_src_sage_libs_linbox_linbox_flint_interface.pyx.cpp.o.d -o src/sage/libs/linbox/linbox_flint_interface.cpython-311-darwin.so.p/meson-generated_src_sage_libs_linbox_linbox_flint_interface.pyx.cpp.o -c src/sage/libs/linbox/linbox_flint_interface.cpython-311-darwin.so.p/src/sage/libs/linbox/linbox_flint_interface.pyx.cpp
  In file included from src/sage/libs/linbox/linbox_flint_interface.cpython-311-darwin.so.p/src/sage/libs/linbox/linbox_flint_interface.pyx.cpp:1143:
  In file included from /Users/runner/miniconda3/envs/sage-dev/include/givaro/zring.h:160:
  /Users/runner/miniconda3/envs/sage-dev/include/givaro/givinteger.h:33:11: error: explicit specialization of 'Givaro::ZRing<Givaro::Integer>' after instantiation
     33 |     class ZRing<Integer> : public UnparametricZRing<Integer> {
        |           ^~~~~~~~~~~~~~
  /Users/runner/miniconda3/envs/sage-dev/include/givaro/random-integer.h:90:51: note: implicit instantiation first required here
     90 |                 const_cast<Integer_Domain&>(_ring)=R._ring;
        |                                                   ^
  In file included from src/sage/libs/linbox/linbox_flint_interface.cpython-311-darwin.so.p/src/sage/libs/linbox/linbox_flint_interface.pyx.cpp:1146:
  In file included from /Users/runner/miniconda3/envs/sage-dev/include/givaro/givpoly1.h:41:
  In file included from /Users/runner/miniconda3/envs/sage-dev/include/givaro/givpoly1denseops.inl:19:
  In file included from /Users/runner/miniconda3/envs/sage-dev/include/givaro/givpoly1cyclo.inl:13:
  In file included from /Users/runner/miniconda3/envs/sage-dev/include/givaro/givintfactor.h:161:
  /Users/runner/miniconda3/envs/sage-dev/include/givaro/givintfactor.inl:269:23: error: no member named 'gcd' in 'IntFactorDom<MyRandIter>'
    269 |                 this->gcd(g,sub(t,y,x),n);
        |                 ~~~~  ^
  /Users/runner/miniconda3/envs/sage-dev/include/givaro/givintfactor.inl:280:23: error: no member named 'gcd' in 'IntFactorDom<MyRandIter>'
    280 |                 this->gcd(g,sub(t,y,x),n);
        |                 ~~~~  ^
  /Users/runner/miniconda3/envs/sage-dev/include/givaro/givintfactor.inl:480:15: error: no member named 'gcd' in 'IntFactorDom<MyRandIter>'
    480 |         this->gcd(g,u,v,two,n);
        |         ~~~~  ^
  /Users/runner/miniconda3/envs/sage-dev/include/givaro/givintfactor.inl:483:15: error: no member named 'gcd' in 'IntFactorDom<MyRandIter>'
    483 |         this->gcd(g,u,v,four,n);
        |         ~~~~  ^
  /Users/runner/miniconda3/envs/sage-dev/include/givaro/givintfactor.inl:486:15: error: no member named 'gcd' in 'IntFactorDom<MyRandIter>'
    486 |         this->gcd(g,u,v,sixt,n);
        |         ~~~~  ^
  /Users/runner/miniconda3/envs/sage-dev/include/givaro/givintfactor.inl:497:23: error: no member named 'gcd' in 'IntFactorDom<MyRandIter>'
    497 |                 this->gcd(kgg,kg,n);
        |                 ~~~~  ^
  /Users/runner/miniconda3/envs/sage-dev/include/givaro/givintfactor.inl:500:27: error: no member named 'gcd' in 'IntFactorDom<MyRandIter>'
    500 |                     this->gcd(g,u,v,kg,n); if (! this->isOne(g)) { delete [] A; delete [] X; delete [] Z; return g; }
        |                     ~~~~  ^
  /Users/runner/miniconda3/envs/sage-dev/include/givaro/givintfactor.inl:507:19: error: no member named 'gcd' in 'IntFactorDom<MyRandIter>'
    507 |             this->gcd(g,u,v,a,n); if (! this->isOne(g)) { delete [] A; delete [] X; delete [] Z; return g; }
        |             ~~~~  ^
  /Users/runner/miniconda3/envs/sage-dev/include/givaro/givintfactor.inl:534:19: error: no member named 'gcd' in 'IntFactorDom<MyRandIter>'
    534 |             this->gcd(ftm,f,n);
        |             ~~~~  ^
  In file included from src/sage/libs/linbox/linbox_flint_interface.cpython-311-darwin.so.p/src/sage/libs/linbox/linbox_flint_interface.pyx.cpp:1146:
  In file included from /Users/runner/miniconda3/envs/sage-dev/include/givaro/givpoly1.h:41:
  In file included from /Users/runner/miniconda3/envs/sage-dev/include/givaro/givpoly1denseops.inl:19:
  /Users/runner/miniconda3/envs/sage-dev/include/givaro/givpoly1cyclo.inl:62:20: error: no member named 'divexact' in 'Givaro::IntFactorDom<>'
     62 |                 IF.divexact(Iq, n, IF.factor(If,n) );
        |                 ~~ ^
  In file included from src/sage/libs/linbox/linbox_flint_interface.cpython-311-darwin.so.p/src/sage/libs/linbox/linbox_flint_interface.pyx.cpp:1148:
  In file included from /Users/runner/miniconda3/envs/sage-dev/include/linbox/matrix/dense-matrix.h:85:
  In file included from /Users/runner/miniconda3/envs/sage-dev/include/linbox/matrix/densematrix/blas-matrix.h:42:
  In file included from /Users/runner/miniconda3/envs/sage-dev/include/linbox/vector/blas-vector.h:43:
  In file included from /Users/runner/miniconda3/envs/sage-dev/include/linbox/field/hom.h:33:
  In file included from /Users/runner/miniconda3/envs/sage-dev/include/givaro/modular.h:26:
  In file included from /Users/runner/miniconda3/envs/sage-dev/include/givaro/modular-ruint.h:24:
  In file included from /Users/runner/miniconda3/envs/sage-dev/include/recint/rint.h:53:
  In file included from /Users/runner/miniconda3/envs/sage-dev/include/recint/rdiv.h:48:
  /Users/runner/miniconda3/envs/sage-dev/include/recint/rfiddling.h:170:29: error: no member named 'Low' in 'rint<K>'
    170 |         set_highest_bit(max.Low.Value);
        |                         ~~~ ^

Do you also get this issue with #40397?

@tobiasdiez tobiasdiez marked this pull request as draft August 1, 2025 03:09
@tobiasdiez
Copy link
Contributor Author

Thanks for looking into this Dima!

Some further investigation shows:

So we just have to wait for this last PR.

@github-actions
Copy link

github-actions bot commented Oct 28, 2025

Documentation preview for this PR (built with commit 6282ca5; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@tobiasdiez
Copy link
Contributor Author

This is now generally working, except that cython_alias fails because it still tries to find blas and not accelerate. @dimpase is it okay to remove get_cblas_pc_module_name in the cython alias handling?

@dimpase
Copy link
Member

dimpase commented Oct 29, 2025

do you talk about a specific platform (conda on macOS) ?

@tobiasdiez
Copy link
Contributor Author

do you talk about a specific platform (conda on macOS) ?

No in general. We don't really require blas - accelerate works as well.

@dimpase
Copy link
Member

dimpase commented Oct 29, 2025

this should be harmonised with sage-distro

@tobiasdiez
Copy link
Contributor Author

Tests are green, so this is now ready for review from my side.

@tobiasdiez tobiasdiez marked this pull request as ready for review November 25, 2025 21:37
@cxzhong
Copy link
Contributor

cxzhong commented Nov 26, 2025

Maybe you should after remove python 3.11 enviorment then merge this. Thank you very much. And it will cause conflict with remove python 3.11 PR.

@tobiasdiez
Copy link
Contributor Author

Maybe you should after remove python 3.11 enviorment then merge this. Thank you very much. And it will cause conflict with remove python 3.11 PR.

You right. I'll deal with the merge conflicts once the other PR is merged into develop.

@cxzhong
Copy link
Contributor

cxzhong commented Dec 12, 2025

Looks good to me

Copy link
Member

@dimpase dimpase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@dimpase
Copy link
Member

dimpase commented Dec 19, 2025

this needs an update of conda environments

@tobiasdiez
Copy link
Contributor Author

this needs an update of conda environments

What do you mean? I've updated the conda env files a few weeks ago in this PR...

@dimpase
Copy link
Member

dimpase commented Dec 20, 2025

I tried to rebase this over 10.8, and got lots of conflicts in environment-* (some packages are newer in 10.8 than in this branch)

@dimpase
Copy link
Member

dimpase commented Dec 20, 2025

so you can merge, but then you still need to update environments, and push the update

@tobiasdiez
Copy link
Contributor Author

so you can merge, but then you still need to update environments, and push the update

Okay, I've now updated the conda lock files.

@cxzhong
Copy link
Contributor

cxzhong commented Dec 21, 2025

run update-meson again. because meson 1.10.0 change the format. Or you pin the version of meson to 1.9.0

@dimpase
Copy link
Member

dimpase commented Dec 21, 2025

update conda lock files needs a good instructon. I don't really know what this does conceptually.

Does it mean to pin the versions to the latest conda state? Then it can be done in bootstrap, no need to keep these environment* files.

Or does it mean to record the latest conda state the current branch is supposed to work in?
Then it needs to be checked on different platforms, not just in one local conda environment. Again, this seems to be some sort of labour intensive stuff best left to a computer.

Recording all the state of all packages is too much, it should suffice to record only the maximal elements state in the package poset.

@tobiasdiez
Copy link
Contributor Author

run update-meson again. because meson 1.10.0 change the format. Or you pin the version of meson to 1.9.0

Done! Thanks

update conda lock files needs a good instructon. I don't really know what this does conceptually.
Or does it mean to record the latest conda state the current branch is supposed to work in? Then it needs to be checked on different platforms, not just in one local conda environment. Again, this seems to be some sort of labour intensive stuff best left to a computer.

Yes, those lock files record a set of versions of conda packages where we know that CI passes without errors. The purpose is two fold:

  • CI doesn't break randomly because someone pushes a new version of a package to the conda eco system
  • Devs can use the same lock files locally to setup a dev environment that is known to work

The lock files are automatically generated but need to be updated manually. In the future it would be nice to automate the process by something like dependabot/renovate.

@vbraun vbraun merged commit 174227b into sagemath:develop Dec 29, 2025
18 of 31 checks passed
@antonio-rojas
Copy link
Contributor

The CBLAS_PC_MODULES variable is unused after this and can be dropped.

@tobiasdiez
Copy link
Contributor Author

Thanks, done in #41439

vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 14, 2026
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

It's no longer used after sagemath#40520.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [ ] The title is concise and informative.
- [ ] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->

URL: sagemath#41439
Reported by: Tobias Diez
Reviewer(s):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants