Skip to content

Commit 8db978b

Browse files
committed
Allow disutils to detect implementation of linear algebra
Currently, the libraries for linear algebra are hard coded and constrained. This makes the installation to fail in several environments, even when available BLAS/LAPACK libraries are present. This happens frequently with MKL. Since the interface of these routines is always the same, it is worth it to have a dynamical detection of the library, which is done through numpy directly.
1 parent 37aac7a commit 8db978b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

setup.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
from numpy.distutils.core import setup, Extension
44
import os, sys
55
import numpy
6+
from numpy.distutils.system_info import get_info
7+
8+
lapack_opt = get_info('lapack_opt')
69

710
extra_flags_c = []
811
extra_link_args_c = []
@@ -48,7 +51,6 @@
4851

4952

5053

51-
LIBRARIES = ["lapack", "blas"]
5254
EXTRA_F90_FLAGS = ["-cpp", "-fopenmp"]
5355
EXTRA_LINK_ARGS = ["-fopenmp"]
5456

@@ -70,9 +72,9 @@
7072
"SCHAModules/get_cmat.f90",
7173
"SCHAModules/get_v4.f90",
7274
"SCHAModules/get_odd_straight_with_v4.f90"],
73-
libraries = LIBRARIES,
7475
extra_f90_compile_args = EXTRA_F90_FLAGS,
75-
extra_link_args= EXTRA_LINK_ARGS)
76+
extra_link_args= EXTRA_LINK_ARGS,
77+
**lapack_opt)
7678

7779

7880

0 commit comments

Comments
 (0)