Undefined symbols in Scipy and Scikit-learn on RedHat

独自空忆成欢 提交于 2019-12-23 11:59:53

问题


I'm trying to install Scikit-Learn on a 64-bit Red Hat Enterprise 6.6 server on which I don't have root privileges. I've done a fresh installation of Python 2.7.9, Numpy 1.9.2, Scipy 0.15.1, and Scikit-Learn 0.16.1. The Atlas BLAS installation on the server is 3.8.4.

I can install scikit-learn, but when I attempt to import it in Python, I get

File "<pyinstall>/site-packages/scipy/parse/linalg/isolve/_iterative.so: undefined symbol: slamch_"

Similarly, when I run

>>> import scipy; scipy.test()

I get 16 errors, 14 of them ImportErrors for the following undefined symbols:

  • scipy/cluster/_vq.so: undefined symbol _gfortran_st_write_done
  • scipy/special/_ufuncs.so: undefined symbol dstevr_
  • scipy/linalg/_fblas.so: undefined symbol csyr_
  • scipy/lib/blas/fblas.so: undefined symbol slamch_
  • scipy/lib/lapack/flapack.so: undefined symbol sgbsv_
  • scipy/spatial/qhull.so: undefined symbol _gfortran_st_write_done

My research Several sources I've found suggest that issues like this occur because of a mismatched Fortran compiler in compiling the BLAS/LAPack libraries and scipy, e.g. this mail exchange and another from 2007 (not linked because my reputation isn't high enough to include another link; it referenced the _gfortran_st_write_done symbol). However, the BLAS build was done on a server that only has gfortran installed (no g77 or Intel compilers), and I recompiled scipy to explicitly use gfortran.

The scipy installation notes also mention that the LAPACK version that comes with Atlas BLAS is not a full implementation, and says that ImportErrors may occur if the installed LAPACK is missing some functions. So, I followed the instructions here to install the full version of LAPACK 3.5.0, also compiled with gfortran. I then recompiled scipy and sklearn pointed at the updated libraries, and received the same import errors.

My question Is there anything that might be causing these errors other than mismatched Fortran compilers? Alternatively, is there another library I need to be recompiling?


回答1:


Thanks to Andreas Mueller for the tip: doing a local install of anaconda to a directory I owned got around the compilation issues.



来源:https://stackoverflow.com/questions/30428278/undefined-symbols-in-scipy-and-scikit-learn-on-redhat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!