2020-03-31 14:47:18 +00:00
|
|
|
{ stdenv, fetchFromGitHub, blas, lapack, gfortran, fixDarwinDylibNames }:
|
2018-08-23 21:26:41 +00:00
|
|
|
|
2020-04-20 20:50:55 +00:00
|
|
|
assert (!blas.isILP64) && (!lapack.isILP64);
|
2020-04-17 19:00:19 +00:00
|
|
|
|
2018-08-23 21:26:41 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "scs";
|
2020-01-27 20:13:54 +00:00
|
|
|
version = "2.1.1";
|
2018-08-23 21:26:41 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "cvxgrp";
|
|
|
|
repo = "scs";
|
2020-01-27 20:13:54 +00:00
|
|
|
rev = version;
|
|
|
|
sha256 = "14g5m3lcvrbwpq1bq0liq00jh0gm1947lg3z4jfsp43f6p5alb20";
|
2018-08-23 21:26:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Actually link and add libgfortran to the rpath
|
2018-09-11 22:17:44 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace scs.mk \
|
|
|
|
--replace "#-lgfortran" "-lgfortran" \
|
|
|
|
--replace "gcc" "cc"
|
2018-08-23 21:26:41 +00:00
|
|
|
'';
|
|
|
|
|
2018-09-11 22:17:44 +00:00
|
|
|
nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
|
|
|
|
2020-03-31 14:47:18 +00:00
|
|
|
buildInputs = [ blas lapack gfortran.cc.lib ];
|
2018-09-11 22:17:44 +00:00
|
|
|
|
2018-08-23 21:26:41 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2018-09-11 22:17:44 +00:00
|
|
|
# Test demo requires passing data and seed; numbers chosen arbitrarily.
|
|
|
|
postCheck = ''
|
|
|
|
./out/demo_socp_indirect 42 0.42 0.42 42
|
2018-08-23 21:26:41 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2018-09-11 22:17:44 +00:00
|
|
|
runHook preInstall
|
2018-08-23 21:26:41 +00:00
|
|
|
mkdir -p $out/lib
|
|
|
|
cp -r include $out/
|
2018-09-11 22:17:44 +00:00
|
|
|
cp out/*.a out/*.so out/*.dylib $out/lib/
|
|
|
|
runHook postInstall
|
2018-08-23 21:26:41 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Splitting Conic Solver";
|
|
|
|
longDescription = ''
|
|
|
|
Numerical optimization package for solving large-scale convex cone problems
|
|
|
|
'';
|
2020-01-27 20:13:54 +00:00
|
|
|
homepage = "https://github.com/cvxgrp/scs";
|
2018-08-23 21:26:41 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = [ maintainers.bhipple ];
|
|
|
|
};
|
|
|
|
}
|