SciNim / nimblas

BLAS for Nim
http://scinim.github.io/nimblas
Apache License 2.0
42 stars 5 forks source link

NimBLAS should always use the cblas API #4

Closed mratsim closed 5 years ago

mratsim commented 5 years ago

Currently nimblas try to use cblas_ddot (in nimblas CI) and cblas_dgemm (in Arraymancer CI).

Unfortunately those functions are not available in the default libblas.so shipped in Linux distributions.

Instead nimblas should always dlopen libcblas.so

cc @narimiran @Araq for popular repos testing.

edit: fix #3

andreaferretti commented 5 years ago

Thank you. All distrubutions I usually use ship cblas with blas itself, I did not know about a separate cblas

andreaferretti commented 5 years ago

Sorry, I had to revert the PR. I assumed you had tested on various distributions, but this already fails on Ubuntu. Since the previous version works on Debian, Rad Hat and their derivatives, I am going back. I assume the issue only appears in Manjaro

mratsim commented 5 years ago

It fails on Arch as well (which Manjaro is a derivative of).

Looking into http://nicolas.limare.net/pro/notes/2014/10/31_cblas_clapack_lapacke/ and https://discuss.mxnet.io/t/build-failure-with-use-blas-blas-in-arch-linux/618

It seems like Archlinux choose to split the C and Fortran interface while other distros do not.

andreaferretti commented 5 years ago

What could be a good way to handle this? Can we use detectOs or is it just a nimble thing? For now, the workaround is just to pass -d:blas=cblas on Arch and derivatives

mratsim commented 5 years ago

I don't think there is a proper way besides documentation.

andreaferretti commented 5 years ago

I added some in the README