Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 469120 - sci-libs/scipy fails with eigs and complex numbers (MKL, IA64)
Summary: sci-libs/scipy fails with eigs and complex numbers (MKL, IA64)
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: IA64 Linux
: Normal normal (vote)
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-08 22:42 UTC by brandsmeier
Modified: 2015-02-19 08:38 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge_info.txt,5.74 KB, text/plain)
2013-05-08 22:42 UTC, brandsmeier
Details

Note You need to log in before you can comment on or make changes to this bug.
Description brandsmeier 2013-05-08 22:42:43 UTC
Created attachment 347784 [details]
emerge --info

Scipy fails the following very simple testcase of eigs:

import numpy as np
import scipy
from scipy.sparse.linalg import eigs

n = 4
M1 = np.random.rand(n,n)
M2 = np.random.rand(n,n)
M2 = M2 + M2.T

if 1:
  print '#### working'
  print eigs(A=M1, k=1)
  print eigs(A=M1, M=M2, k=2)

if 1:
  print '### not working (SEGFAULT)'
  C = np.random.rand(n,n)
  A = M1+1j*C # note A is now complex
  print eigs(A=A, k=2)
  #print eigs(A=A, M=M2, k=2)

This might be realted to the fact that numpy / scipy select the 32bit bit version of the MKL libraries (ignoring MKL variables) and I am on a 64-bit platform. Below is some detailed description. Note that the same test works with ATLAS. However, getting ATLAS to run with current scipy somehow is currently broken in Gentoo (I just filed a separate bug).

Configuration: scipy, numpy, atlas, mkl.
This happens independent what I select in eselect blas. In fact eselect blas/cblas/lapack all set to atlas and still scipy decides to prefer MKL. 

Applies to: sci-libs/scipy-0.12.0 and sci-libs/scipy-0.11.0-r1. I did not test it with 0.9.0-r1 (it lacks some functionality in `eigs`).

**** Running a simple python script that calls eigs fails with:
> python test_scipy.py   
MKL FATAL ERROR: /opt/intel/mkl/10.0.5.025/lib/32/libmkl_lapack.so: undefined symbol: __mkl_cfg_file_readed_extern


*** Using LD_PRELOAD for 32-bit libraries:
> export LD_PRELOAD=/opt/intel/mkl/10.0.5.025/lib/32/libmkl_core.so
> python test_scipy.py 
#### working
(array([ 2.07016704+0.j]), array([[-0.52946422+0.j],
       [-0.48910097+0.j],
       [-0.58222357+0.j],
       [-0.37611648+0.j]]))
(array([-1.61567722-1.07039665j, -5.12037359+0.j        ]), array([[ -4.14181101e-02-0.02156263j,   2.82256147e-05+0.j        ],
       [ -7.27454445e-01-0.50340818j,   5.10971431e-04+0.j        ],
       [  9.63657926e-01+0.24638324j,  -5.43569514e-04+0.j        ],
       [ -5.91602634e-01+0.18868952j,   2.34798101e-04+0.j        ]]))
### not working (SEGFAULT)
Segmentation fault

gdb reveals:
  Program received signal SIGSEGV, Segmentation fault.
  0x00007fffec034341 in mkl_lapack_zladiv () from /opt/intel/mkl/10.0.5.025/lib/em64t/libmkl_lapack.so

> unset LD_PRELOAD


*** Setting MKL variables to 32-bit version:
> source /opt/intel/mkl/10.0.5.025/tools/environment/mklvars32.sh
> python test_scipy.py 
MKL FATAL ERROR: /opt/intel/mkl/10.0.5.025/lib/32/libmkl_lapack.so: undefined symbol: __mkl_cfg_file_readed_extern

*** Setting MKL variables to 64bit:
> source /opt/intel/mkl/10.0.5.025/tools/environment/mklvars64.sh
> python test_scipy.py 
MKL FATAL ERROR: /opt/intel/mkl/10.0.5.025/lib/32/libmkl_lapack.so: undefined symbol: __mkl_cfg_file_readed_extern

*** Versions ****
[ebuild   R   ~] dev-python/numpy-1.7.1  USE="lapack -doc {-test}" PYTHON_TARGETS="python2_7 python3_2 -python2_5 -python2_6 -python3_1 (-python3_3)" 0 kB

[ebuild   R   ~] sci-libs/scipy-0.12.0  USE="-doc -sparse {-test}" PYTHON_TARGETS="python2_7 python3_2 -python2_5 -python2_6 (-python3_3)" 0 kB
Comment 1 Justin Lecher (RETIRED) gentoo-dev 2015-02-19 08:38:02 UTC
Please see whether this is still valid for scipy 0.14/0.15.