jdtuck / fdasrsf_python

elastic fda python code
http://research.tetonedge.net
BSD 3-Clause "New" or "Revised" License
51 stars 18 forks source link

undefined symbol: dnrm2_ #37

Closed vnmabus closed 4 months ago

vnmabus commented 9 months ago

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.

jdtuck commented 9 months ago

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 commented 9 months ago

Also sorry @vnmabus I totally missed this one.

vnmabus commented 9 months ago

@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.

jdtuck commented 9 months ago

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

jdtuck commented 9 months ago

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

vnmabus commented 9 months ago

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.

jdtuck commented 9 months ago

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

jdtuck commented 9 months ago

I will merge and release today for this and keep exploring

jdtuck commented 4 months ago

closing for now wheels are being built and packaging BLAS now