python3Packages.cvxopt: use openblas for darwin

This commit is contained in:
Edward Tjörnhammar 2023-01-27 17:13:22 +01:00
parent 48fe7cfeb9
commit 0c20db8f0c

View File

@ -1,8 +1,10 @@
{ lib
{ stdenv
, lib
, buildPythonPackage
, fetchPypi
, isPyPy
, python
, openblas
, blas
, lapack # build segfaults with 64-bit blas
, suitesparse
@ -28,13 +30,23 @@ buildPythonPackage rec {
sha256 = "sha256-ALGyMvnR+QLVeKnXWBS2f6AgdY1a5CLijKjO9iafpcY=";
};
buildInputs = [ blas lapack ];
buildInputs = (if stdenv.isDarwin then [ openblas ] else [ blas lapack ]);
doCheck = !stdenv.isDarwin;
# similar to Gsl, glpk, fftw there is also a dsdp interface
# but dsdp is not yet packaged in nixpkgs
preConfigure = ''
preConfigure = (if stdenv.isDarwin then
''
export CVXOPT_BLAS_LIB=openblas
export CVXOPT_LAPACK_LIB=openblas
''
else
''
export CVXOPT_BLAS_LIB=blas
export CVXOPT_LAPACK_LIB=lapack
'') +
''
export CVXOPT_BUILD_DSDP=0
export CVXOPT_SUITESPARSE_LIB_DIR=${lib.getLib suitesparse}/lib
export CVXOPT_SUITESPARSE_INC_DIR=${lib.getDev suitesparse}/include
'' + lib.optionalString withGsl ''