···
1
+
{ stdenv, fetchurl, fetchFromGitHub
2
+
, assembleReductionMatrix ? false
3
+
, useCoefficients ? false
4
+
, indicateProgress ? false
5
+
, useGoogleHashmap ? false, sparsehash ? null
6
+
, fileFormat ? "lowerTriangularCsv"
11
+
assert elem fileFormat ["lowerTriangularCsv" "upperTriangularCsv" "dipha"];
12
+
assert useGoogleHashmap -> sparsehash != null;
15
+
inherit (stdenv.lib) optional;
17
+
stdenv.mkDerivation {
21
+
src = fetchFromGitHub {
24
+
rev = "f69c6af6ca6883dd518c48faf41cf8901c379598";
25
+
sha256 = "1mw2898s7l29hgajsaf75bs9bjn2sn4g2mvmh41a602jpwp9r0rz";
28
+
#Patch from dev branch to make compilation work.
29
+
#Will be removed when it gets merged into master.
30
+
patches = [(fetchurl {
31
+
url = https://github.com/Ripser/ripser/commit/dc78d8ce73ee35f3828f0aad67a4e53620277ebf.patch;
32
+
sha256 = "1y93aqpqz8fm1cxxrf90dhh67im3ndkr8dnxgbw5y96296n4r924";
35
+
buildInputs = optional useGoogleHashmap sparsehash;
42
+
++ optional assembleReductionMatrix "-D ASSEMBLE_REDUCTION_MATRIX"
43
+
++ optional useCoefficients "-D USE_COEFFICIENTS"
44
+
++ optional indicateProgress "-D INDICATE_PROGRESS"
45
+
++ optional useGoogleHashmap "-D USE_GOOGLE_HASHMAP"
46
+
++ optional (fileFormat == "lowerTriangularCsv") "-D FILE_FORMAT_LOWER_TRIANGULAR_CSV"
47
+
++ optional (fileFormat == "upperTriangularCsv") "-D FILE_FORMAT_UPPER_TRIANGULAR_CSV"
48
+
++ optional (fileFormat == "dipha") "-D FILE_FORMAT_DIPHA"
51
+
buildPhase = "c++ ripser.cpp -o ripser $buildFlags";
59
+
description = "A lean C++ code for the computation of Vietoris–Rips persistence barcodes";
60
+
homepage = "https://github.com/Ripser/ripser";
61
+
license = stdenv.lib.licenses.lgpl3;
62
+
maintainers = with stdenv.lib.maintainers; [erikryb];
63
+
platforms = stdenv.lib.platforms.linux;