Skip to content
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

Enhancement request: lapack recipe using OpenBLAS #2824

Open
RobertFlatt opened this issue May 30, 2023 · 8 comments
Open

Enhancement request: lapack recipe using OpenBLAS #2824

RobertFlatt opened this issue May 30, 2023 · 8 comments

Comments

@RobertFlatt
Copy link
Contributor

Description

The current lapack recipe implementation using LEGACY_NDK is clever but somewhat baroque. And not all users can navigate the steps.

Consider using lapack from OpenBLAS, it contains lapack (the same version 3.10.1) that has been run through f2c.
So lapack can be be built with a C compiler, no extra NDK!

This is now the default behavior of OpenBLAS, so we might reasonably think it is stable.

From https://www.openblas.net/Changelog.txt

Version 0.3.21
07-Aug-2022

general:

  • Updated the included LAPACK to Reference-LAPACK release 3.10.1
  • when no Fortran compiler is available, OpenBLAS builds will now automatically
    build LAPACK from an f2c-converted copy of LAPACK 3.9.0 unless the NO_LAPACK option
    is specified

An alternative might be to use f2c directly, since OpenBLAS contains C not Fortran it is possible this translation has issues with automation. Impossible to know without trying it.

@misl6
Copy link
Member

misl6 commented May 30, 2023

Oh, that's nice!

+1 for getting rid of LEGACY_NDK, as it's legacy, and it will break sometimes in the future + is not available for Apple Silicon users (like me)

Are you considering trying yourself or we should schedule/advertise the proposal? 😁

@RobertFlatt
Copy link
Contributor Author

Advertise, I have external things going on.

And I look at all the issues I just posted as possible training projects to allow other people to get inside the tools a little (one more enhancement request to come).

@misl6
Copy link
Member

misl6 commented May 31, 2023

Hi @mzakharo! (sorry for the ping)

I do not know if it happen that you're still active on python-for-android related projects (and maybe you also still make use of lapack).

I was wondering if you may be interested in working on this proposal, as you're the #2615 author, and you're likely (100% sure) most knowledgeable than me on lapack and scipy.

@mzakharo
Copy link
Contributor

Lapack is not the end goal. Scipy needs Fortran last time I checked. Is this no longer the case?

@misl6
Copy link
Member

misl6 commented Jun 2, 2023

Lapack is not the end goal. Scipy needs Fortran last time I checked. Is this no longer the case?

You're right.

As I said, you're more knowledgeable than me on scipy and lapack 😀

@RobertFlatt
Copy link
Contributor Author

Will Scipy run through f2c?

If not a built cache would address the complexity issue for most users. #2823

@Samael-TLB
Copy link

Currently, Scipy is relying on Meson for their cross-compilation and meson seems to be supporting ios and android. So may be we can try to venture into Meson and try out the cross-compilation for scipy. Next, we have the open-sourced methodology for cross -compilation for android by Chaquopy and for ios through Beeware. They have been successful in cross-compiling their own gfortran used for cross compiling scipy.
https://github.com/chaquo/chaquopy/tree/master/server/pypi/packages
https://github.com/freakboy3742/chaquopy/tree/iOS-support/server/pypi
https://docs.scipy.org/doc/scipy/building/cross_compilation.html
scipy/scipy#14812

Old repo but possibly showing the methodology for cross-compilation for android irrespective of ndk version (??):
https://github.com/buffer51/android-gfortran

@mhsmith
Copy link

mhsmith commented Oct 2, 2024

Hi, I'm a member of the Chaquopy and BeeWare projects. We're actually not compiling our own gfortran for Android anymore; we're doing the same as Kivy and using the prebuilt gfortran from @mzakharo. But as I've just posted at #2615 (comment), I'm not sure how long this will continue to be feasible.

On iOS we haven't found any adequate Fortran compiler yet – see beeware/mobile-forge#10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

6 participants