2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, eigen
|
|
|
|
, fetchurl
|
|
|
|
, cmake
|
|
|
|
, gflags
|
|
|
|
, glog
|
|
|
|
, runTests ? false
|
|
|
|
}:
|
|
|
|
|
|
|
|
# gflags is required to run tests
|
|
|
|
assert runTests -> gflags != null;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ceres-solver";
|
2020-12-25 13:55:36 +00:00
|
|
|
version = "2.0.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://ceres-solver.org/ceres-solver-${version}.tar.gz";
|
2020-12-25 13:55:36 +00:00
|
|
|
sha256 = "00vng9vnmdb1qga01m0why90m0041w7bn6kxa2h4m26aflfqla8h";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
buildInputs = [ eigen glog ]
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optional runTests gflags;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# The Basel BUILD file conflicts with the cmake build directory on
|
|
|
|
# case-insensitive filesystems, eg. darwin.
|
|
|
|
preConfigure = ''
|
|
|
|
rm BUILD
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = runTests;
|
|
|
|
|
|
|
|
checkTarget = "test";
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "C++ library for modeling and solving large, complicated optimization problems";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
homepage = "http://ceres-solver.org";
|
|
|
|
maintainers = with maintainers; [ giogadi ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|