fdasrsf_python icon indicating copy to clipboard operation
fdasrsf_python copied to clipboard

undefined symbol: dnrm2_

Open vnmabus opened this issue 1 year ago • 8 comments

If you install the latest version of this library in an empty environment in Python 3.9, and you then perform import fdasrsf, the following error is raised:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../lib/python3.9/site-packages/fdasrsf/__init__.py", line 43, in <module>
    from .time_warping import (
  File ".../lib/python3.9/site-packages/fdasrsf/time_warping.py", line 9, in <module>
    import fdasrsf.utility_functions as uf
  File ".../python3.9/site-packages/fdasrsf/utility_functions.py", line 24, in <module>
    import crbfgs as cr
ImportError: .../python3.9/site-packages/crbfgs.cpython-39-x86_64-linux-gnu.so: undefined symbol: dnrm2_

I obtained that error in my CI tests.

vnmabus avatar Jan 31 '24 10:01 vnmabus

This is caused by not finding a blas library in the CI. The new optimizer (rbfgs) in Cython requires blas. In conda this is not an issue and on most machines. Easiest fix is to pip install mkl-devel in the CI. I have debated adding this to the requirements, but haven't decided as it pops up in small situations.

jdtuck avatar Feb 12 '24 18:02 jdtuck

Also sorry @vnmabus I totally missed this one.

jdtuck avatar Feb 12 '24 19:02 jdtuck

@jdtuck I followed your advice, but it still does not work (it now says ImportError: DLL load failed while importing crbfgs: The specified module could not be found.): https://github.com/GAA-UAM/scikit-fda/actions/runs/7883161339/job/21509586537

If the issue is due to the rbfgs optimizer (which I do not use) a possible way to sidestep the problem is to import the module only when that particular optimizer is used.

vnmabus avatar Feb 13 '24 07:02 vnmabus

We could do that, but I don't understand this error. It tells me the Windows CI is not compiling properly....

jdtuck avatar Feb 13 '24 11:02 jdtuck

@vnmabus #38 should fix this for you, can you confirm.

jdtuck avatar Feb 13 '24 13:02 jdtuck

If I both install mkl-devel and use #38, then it works for me. However, this is just a workaround, and the cause for the error remains to be identified.

vnmabus avatar Feb 14 '24 09:02 vnmabus

Agreed but it is a work around for now and I think this is a windows specific issue

jdtuck avatar Feb 14 '24 11:02 jdtuck

I will merge and release today for this and keep exploring

jdtuck avatar Feb 14 '24 11:02 jdtuck

closing for now wheels are being built and packaging BLAS now

jdtuck avatar Jul 05 '24 13:07 jdtuck