lol
1{ lib, stdenv
2, fetchurl
3, cmake
4, gtest
5, blas
6, fftw
7, liblapack
8, gfortran
9}:
10
11stdenv.mkDerivation rec {
12 pname = "it++";
13 version = "4.3.1";
14
15 src = fetchurl {
16 url = "mirror://sourceforge/itpp/itpp-${version}.tar.bz2";
17 sha256 = "0xxqag9wi0lg78xgw7b40rp6wxqp5grqlbs9z0ifvdfzqlhpcwah";
18 };
19
20 nativeBuildInputs = [ cmake gfortran ];
21 buildInputs = [
22 fftw
23 liblapack
24
25 # NOTE: OpenBLAS doesn't work here because IT++ doesn't pass aligned
26 # buffers, which causes segfaults in the optimized kernels :-(
27 blas
28 ];
29
30 cmakeFlags = [
31 "-DCMAKE_CXX_FLAGS=-std=c++14"
32 "-DBLAS_FOUND:BOOL=TRUE"
33 "-DBLAS_LIBRARIES:STRING=${blas}/lib/libblas.so"
34 "-DLAPACK_FOUND:BOOL=TRUE"
35 "-DLAPACK_LIBRARIES:STRING=${liblapack}/lib/liblapack.so"
36 "-DGTEST_DIR:PATH=${gtest.src}/googletest"
37 ];
38
39 doCheck = true;
40
41 checkPhase = ''
42 ./gtests/itpp_gtests
43 '';
44
45 meta = with lib; {
46 description = "IT++ is a C++ library of mathematical, signal processing and communication classes and functions";
47 mainProgram = "itpp-config";
48 homepage = "https://itpp.sourceforge.net/";
49 license = licenses.gpl3;
50 platforms = platforms.unix;
51 maintainers = with maintainers; [ ];
52 broken = stdenv.isDarwin; # never built on Hydra https://hydra.nixos.org/job/nixpkgs/trunk/itpp.x86_64-darwin
53 };
54}