Description of problem:
ATLAS xerbla exits on error. Numpy normally overrides that function, but that seems to no longer work in fedora 21.
How reproducible: Always
Steps to Reproduce:
charris@localhost [~]$ python
Python 2.7.8 (default, Nov 10 2014, 08:19:18)
[GCC 4.9.2 20141101 (Red Hat 4.9.2-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> np.linalg.lstsq([[np.nan]]*2, *2)
** On entry to DLASCL parameter number 4 had an illegal value
Raises an error and Python continues.
You might be building ATLAS with -Wl,-Bsymbolic-functions, which will cause the problem.
The numpy is locally built and linked to libtatlas. I note that Fedora numpy is linked to libsatlas, not sure why.
I can confirm the different behavior of numpy between f20 and f21. Problem does not seem to be in atlas, my mini-example with custom xerbla works fine, with both satlas and tatlas. Compiled with Makefile:
test: main.o routines.o Makefile
$(CC) -o test main.o routines.o -lm -lgfortran -L/usr/lib64/atlas -ltatlas
$(CC) -Wall -O2 -g -c $< -o $@
$(F90) -Wall -O2 -g -c $< -o $@
Call dgemm('','n',m,n,k,1.0,a,m,b,k,0.0,c,m) with wrong first parameter kills the process - default xerbla. With
subroutine xerbla(SRNAME, INFO)
PRINT *, "Hello World!"
end subroutine xerbla
in routines.f90 it prints the hello message and process continues - successful override.
Maybe something changed in numpy?
I do not know why numpy is linked to serial and not threaded atlas in Fedora. One probable answer might be that threaded atlas is currently broken on architectures with weak cache coherency, or maybe because it can not detect the number of cores at runtime and to get real benefits you need to recompile atlas yourself, or maybe because someone wants to use numpy as a generic library and do his own parallelization. Many problems with threaded atlas for little benefit.
This because multiple numpy shared libraries are linked against atlas:
rpm -ql numpy | grep -F .so | while read so; do ldd $so | grep atlas && echo $so; done
libsatlas.so.3 => /usr/lib64/atlas/libsatlas.so.3 (0x00007fd169763000)
libsatlas.so.3 => /usr/lib64/atlas/libsatlas.so.3 (0x00007f7135291000)
libsatlas.so.3 => /usr/lib64/atlas/libsatlas.so.3 (0x00007f67f2df9000)
But the xerbla_ override is not in _dotblas.so and that is getting loading first.
I've updated the upstream issue tracker:
Would have been nice to have mentioned that link in the original report.
PR https://github.com/numpy/numpy/pull/5382 for numpy fixes this, but you will probably need to fix the fedora version of numpy yourself. All that seems to be needed is to move the linalg import in numpy/__init__.py before the import of core. The fix *does not work* if site.cfg is used for the setup instead of being automatically detected as by PR https://github.com/numpy/numpy/pull/5364.
NVM, still broken, needs work.
See https://github.com/numpy/numpy/pull/5392. That patch is for 1.9.x, but the same fix is needed for the 1.8.2 that is in Fedora.
(In reply to charles harris from comment #7)
> See https://github.com/numpy/numpy/pull/5392. That patch is for 1.9.x, but
> the same fix is needed for the 1.8.2 that is in Fedora.
the problem is present also on RHEL7: numpy-1.7.1-10.el7.x86_64
numpy-1.8.2-3.fc21 has been submitted as an update for Fedora 21.
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing numpy-1.8.2-3.fc21'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
numpy-1.8.2-3.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.