2023-01-11 07:51:40 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, fftw, fftwFloat, boost, opencl-clhpp, ocl-icd, darwin }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
let
|
|
|
|
inherit (darwin.apple_sdk.frameworks) OpenCL;
|
|
|
|
in
|
2021-07-18 21:22:44 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "clfft";
|
2021-07-18 21:22:44 +00:00
|
|
|
version = "2.12.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "clMathLibraries";
|
|
|
|
repo = "clFFT";
|
2023-01-11 07:51:40 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-yp7u6qhpPYQpBw3d+VLg0GgMyZONVII8BsBCEoRZm4w=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
sourceRoot = "${src.name}/src";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i '/-m64/d;/-m32/d' CMakeLists.txt
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
buildInputs = [ fftw fftwFloat boost ]
|
|
|
|
++ lib.optionals stdenv.isLinux [ opencl-clhpp ocl-icd ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ OpenCL ];
|
|
|
|
|
|
|
|
# https://github.com/clMathLibraries/clFFT/issues/237
|
|
|
|
CXXFLAGS = "-std=c++98";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Library containing FFT functions written in OpenCL";
|
|
|
|
longDescription = ''
|
|
|
|
clFFT is a software library containing FFT functions written in OpenCL.
|
|
|
|
In addition to GPU devices, the library also supports running on CPU devices to facilitate debugging and heterogeneous programming.
|
|
|
|
'';
|
|
|
|
license = licenses.asl20;
|
|
|
|
homepage = "http://clmathlibraries.github.io/clFFT/";
|
2023-01-11 07:51:40 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ chessai ];
|
|
|
|
};
|
|
|
|
}
|