wpilibsuite / WPILibPi

WPILib Raspberry Pi images designed for FRC (formerly FRCVision)
Other
89 stars 41 forks source link

Suggestion: add ATLAS/OpenBLAS to image #65

Closed auscompgeek closed 5 years ago

auscompgeek commented 5 years ago

ATLAS and/or OpenBLAS are optimised implementations of BLAS/LAPACK. They will likely give a reasonable speedup for both OpenCV and numpy.

PeterJohnson commented 5 years ago

It's one or the other, not both. I have the OpenBLAS package install in #66, but compiling OpenCV with it is going to be more difficult.

auscompgeek commented 5 years ago

Yeah, I'm not entirely sure which would be better to use, hence why I listed both.

From what I understand, Debian's ATLAS and OpenBLAS packages also provide libblas.so.3 and liblapack.so.3 via their alternatives mechanism, so I believe they'll work as a drop-in replacement without having to specifically link to them.

PeterJohnson commented 5 years ago

Yes, that works for numpy, but we build our own OpenCV, so I have to figure out how to get it to find it when cross-building, etc.

auscompgeek commented 5 years ago

Ah, right.

Taking a closer look, I found that OpenCV is actually built without LAPACK:

https://github.com/wpilibsuite/FRCVision-pi-gen/blob/03dae15ddfbb01c31c457756bc390359e8e32c87/deps/03-build.sh#L39

From what I can tell, if you pull in the liblapack-dev package (and flip that ON), then it should be fine. Debian builds their OpenCV packages on sid like that it seems.