2018-09-11 23:17:44 +01:00
|
|
|
{ stdenv, fetchFromGitHub, blas, liblapack, gfortran, fixDarwinDylibNames }:
|
2018-08-23 22:26:41 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "scs-${version}";
|
|
|
|
version = "2.0.2";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "cvxgrp";
|
|
|
|
repo = "scs";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "17lbcmcsniqlyzgbzmjipfd0rrk25a8hzh7l5wl2wp1iwsd8c3a9";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Actually link and add libgfortran to the rpath
|
2018-09-11 23:17:44 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace scs.mk \
|
|
|
|
--replace "#-lgfortran" "-lgfortran" \
|
|
|
|
--replace "gcc" "cc"
|
2018-08-23 22:26:41 +01:00
|
|
|
'';
|
|
|
|
|
2018-09-11 23:17:44 +01:00
|
|
|
nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
|
|
|
|
|
|
|
buildInputs = [ blas liblapack gfortran.cc.lib ];
|
|
|
|
|
2018-08-23 22:26:41 +01:00
|
|
|
doCheck = true;
|
|
|
|
|
2018-09-11 23:17:44 +01: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 22:26:41 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2018-09-11 23:17:44 +01:00
|
|
|
runHook preInstall
|
2018-08-23 22:26:41 +01:00
|
|
|
mkdir -p $out/lib
|
|
|
|
cp -r include $out/
|
2018-09-11 23:17:44 +01:00
|
|
|
cp out/*.a out/*.so out/*.dylib $out/lib/
|
|
|
|
runHook postInstall
|
2018-08-23 22:26:41 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Splitting Conic Solver";
|
|
|
|
longDescription = ''
|
|
|
|
Numerical optimization package for solving large-scale convex cone problems
|
|
|
|
'';
|
|
|
|
homepage = https://github.com/cvxgrp/scs;
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = [ maintainers.bhipple ];
|
|
|
|
};
|
|
|
|
}
|