2018-11-20 12:18:03 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2018-04-11 17:19:52 +01:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, isPyPy
|
|
|
|
, python
|
2020-03-31 15:47:18 +01:00
|
|
|
, blas, lapack # build segfaults with 64-bit blas
|
2018-04-11 17:19:52 +01:00
|
|
|
, suitesparse
|
|
|
|
, glpk ? null
|
|
|
|
, gsl ? null
|
|
|
|
, fftw ? null
|
|
|
|
, withGlpk ? true
|
|
|
|
, withGsl ? true
|
|
|
|
, withFftw ? true
|
|
|
|
}:
|
|
|
|
|
2020-04-20 21:50:55 +01:00
|
|
|
assert (!blas.isILP64) && (!lapack.isILP64);
|
2020-03-31 15:47:18 +01:00
|
|
|
|
2018-04-11 17:19:52 +01:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cvxopt";
|
2020-05-09 00:37:52 +01:00
|
|
|
version = "1.2.5";
|
2018-04-11 17:19:52 +01:00
|
|
|
|
|
|
|
disabled = isPyPy; # hangs at [translation:info]
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-05-09 00:37:52 +01:00
|
|
|
sha256 = "0widrfxr0x0cyg72ibkv7fdzkvmf5mllchq1x4fs2a36plv8rv4l";
|
2018-04-11 17:19:52 +01:00
|
|
|
};
|
|
|
|
|
2020-03-31 15:47:18 +01:00
|
|
|
buildInputs = [ blas lapack ];
|
|
|
|
|
2018-04-11 17:19:52 +01:00
|
|
|
# similar to Gsl, glpk, fftw there is also a dsdp interface
|
|
|
|
# but dsdp is not yet packaged in nixpkgs
|
|
|
|
preConfigure = ''
|
2020-03-31 15:47:18 +01:00
|
|
|
export CVXOPT_BLAS_LIB=blas
|
|
|
|
export CVXOPT_LAPACK_LIB=lapack
|
2020-02-11 19:02:43 +00:00
|
|
|
export CVXOPT_SUITESPARSE_LIB_DIR=${lib.getLib suitesparse}/lib
|
|
|
|
export CVXOPT_SUITESPARSE_INC_DIR=${lib.getDev suitesparse}/include
|
2018-04-11 17:19:52 +01:00
|
|
|
'' + lib.optionalString withGsl ''
|
|
|
|
export CVXOPT_BUILD_GSL=1
|
|
|
|
export CVXOPT_GSL_LIB_DIR=${gsl}/lib
|
|
|
|
export CVXOPT_GSL_INC_DIR=${gsl}/include
|
|
|
|
'' + lib.optionalString withGlpk ''
|
|
|
|
export CVXOPT_BUILD_GLPK=1
|
|
|
|
export CVXOPT_GLPK_LIB_DIR=${glpk}/lib
|
|
|
|
export CVXOPT_GLPK_INC_DIR=${glpk}/include
|
|
|
|
'' + lib.optionalString withFftw ''
|
|
|
|
export CVXOPT_BUILD_FFTW=1
|
|
|
|
export CVXOPT_FFTW_LIB_DIR=${fftw}/lib
|
|
|
|
export CVXOPT_FFTW_INC_DIR=${fftw.dev}/include
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
${python.interpreter} -m unittest discover -s tests
|
|
|
|
'';
|
|
|
|
|
2018-11-20 12:18:03 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://cvxopt.org/";
|
2018-04-11 17:19:52 +01:00
|
|
|
description = "Python Software for Convex Optimization";
|
|
|
|
longDescription = ''
|
|
|
|
CVXOPT is a free software package for convex optimization based on the
|
|
|
|
Python programming language. It can be used with the interactive
|
|
|
|
Python interpreter, on the command line by executing Python scripts,
|
|
|
|
or integrated in other software via Python extension modules. Its main
|
|
|
|
purpose is to make the development of software for convex optimization
|
|
|
|
applications straightforward by building on Python's extensive
|
|
|
|
standard library and on the strengths of Python as a high-level
|
|
|
|
programming language.
|
|
|
|
'';
|
2018-11-20 12:18:03 +00:00
|
|
|
maintainers = with maintainers; [ edwtjo ];
|
|
|
|
license = licenses.gpl3Plus;
|
2018-04-11 17:19:52 +01:00
|
|
|
};
|
|
|
|
}
|