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

Add SciPy #2

Open
virtuald opened this issue Oct 26, 2020 · 5 comments
Open

Add SciPy #2

virtuald opened this issue Oct 26, 2020 · 5 comments

Comments

@virtuald
Copy link
Member

cross-compiling scipy is technically possible, but I don't trust the result yet. Needs testing. Also, numpy + scipy need some cross-compiling adjustments, will have to work on those later.

@Inspirol
Copy link

Inspirol commented Jan 20, 2024

Is this something I can make a PR/work on? My team is interested in using it in the 2024 season. Or would you say trying something else for now would be better?

@virtuald
Copy link
Member Author

You're welcome to work on it and I'm happy to provide some basic support, but it's not a trivial task if you haven't done this sort of thing before.

scipy has also moved to meson-python I believe, and there are some issues with cross-compilation (see #17). However, I believe the numpy project has overcome some of this and is cross-compiling in CI now, so that might be fine? You'd have to look into it.

A final thought is that if your team isn't on a RIO 2, I wouldn't really recommend going down this path. IIRC when I was able to get it to compile for the rio in 2020, it's really big, and takes up a lot of memory. I'm sure it's even bigger now.

@Inspirol
Copy link

Inspirol commented Jan 22, 2024

Ah, I see. I indeed have not done this before, and I also do not have too much time on my hands, so I think I will have to pass on this for now. The only thing we needed it for is the initial value problem for multivariable calc, do you think any other libraries that do this could be ported easier than scipy, like the casADI library?

I think I will still look into this anyway for a little bit. Thanks for the info!

@virtuald
Copy link
Member Author

I'm not a Math person, so I can't provide any useful guidance. I'll ping Tyler, I feel like they did something like that for WPILib already?

@calcmogul
Copy link

calcmogul commented Jan 22, 2024

do you think any other libraries that do this could be ported easier than scipy, like the casADI library?

The only free configuration I'm aware of for CasADi uses Ipopt for the NLP solver and MUMPS for the linear system solver. All three are really annoying to cross-compile to the roboRIO; the folks at @SleipnirGroup have tried and failed to do that. CasADi's autodiff is also really slow, even on desktop.

SciPy can solve IVPs, but if that's not an option, you could try https://github.com/SleipnirGroup/Sleipnir/#python-library; it's a CasADi replacement that's faster and is easier to cross compile. The main C++ library easily cross compiles to the roboRIO, but I haven't tried building roboRIO wheels. Also fair warning that the Python bindings have a concerning open issue: SleipnirGroup/Sleipnir#275.

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

No branches or pull requests

3 participants