BLAS/LAPACK Linking Issues

Hi!

I have been running into issues with BLAS/LAPACK linking when runing Hail functions that use linear algebra operations like linear regression or PCA. The error message looks like this:

symbol lookup error: /tmp/jniloader421303948191888475netlib-native_system-linux-x86_64.so: undefined symbol: cblas_dgemv

I have tried the fixes proposed in this forum:

and this one:

But neither have worked to resolve the issue. In particular, if I try the “quick fix” to set LD_PRELOAD to the OpenBLAS path, I get an error from NumPy when importing Hail before initialization:

RuntimeError: The current Numpy installation ('/nfs/sw/hail/hail-0.2/python/lib/python3.9/site-packages/numpy/__init__.py') fails to pass simple sanity checks. This can be caused for example by incorrect BLAS library being linked in, or by mixing package managers (pip, conda, apt, ...). Search closed numpy issues for similar problems.

Is there another way to resolve this issue?

@sk4 ,

What environment are you in? Do you have root privileges on these machines?

Are you certain you have OpenBLAS installed? You need a copy of open blas with the name libblas.so and you need to convince netlib to load that not something else. Did you already try both of these approaches?

mkdir -p ~/lib
ln -s /path/to/your/libopenblas.so ~/lib/libblas.so
export LD_LIBRARY_PATH=~/lib:$LD_LIBRARY_PATH

and starting Spark with this?

--conf spark.executor.extraClassPath="/path/to/libblas.so:/path/to/liblapack.so"

The hl.init approach only works if the Spark cluster isn’t already running.

Hi @danking,

Well, it looks like the Spark --conf flag approach works now when using spark-submit. I tried it earlier along with the symlink approach, but perhaps I didn’t specify the OpenBLAS and LAPACK paths correctly. Thanks for your quick response!

1 Like