23 , cudaSupport ? config.cudaSupport
28 stdenv.mkDerivation rec {
32 src = fetchFromGitHub {
36 sha256 = "0gcbg6b6gs38xhks5pp0vkcqs89zl7rh9982jqlzsd0h724qddw0";
37 fetchSubmodules = true;
41 "-DAF_BUILD_OPENCL=OFF"
42 "-DAF_BUILD_EXAMPLES=OFF"
44 ] ++ lib.optional cudaSupport "-DCMAKE_LIBRARY_PATH=${cudatoolkit}/lib/stubs";
46 patches = [ ./no-download.patch ];
49 mkdir -p ./build/third_party/clFFT/src
50 cp -R --no-preserve=mode,ownership ${clfft.src}/ ./build/third_party/clFFT/src/clFFT-ext/
51 mkdir -p ./build/third_party/clBLAS/src
52 cp -R --no-preserve=mode,ownership ${clblas.src}/ ./build/third_party/clBLAS/src/clBLAS-ext/
53 mkdir -p ./build/include/CL
54 cp -R --no-preserve=mode,ownership ${opencl-clhpp}/include/CL/cl2.hpp ./build/include/CL/cl2.hpp
57 preBuild = lib.optionalString cudaSupport ''
58 export CUDA_PATH="${cudatoolkit}"
81 ] ++ lib.optionals stdenv.isLinux [
83 ] ++ lib.optionals cudaSupport [
85 ] ++ lib.optionals buildDocs [
87 ] ++ lib.optionals stdenv.isDarwin [
88 darwin.apple_sdk_11_0.frameworks.Accelerate
92 description = "A general-purpose library for parallel and massively-parallel computations";
94 A general-purpose library that simplifies the process of developing software that targets parallel and massively-parallel architectures including CPUs, GPUs, and other hardware acceleration devices.";
96 license = licenses.bsd3;
97 homepage = "https://arrayfire.com/";
98 platforms = platforms.linux ++ platforms.darwin;
99 maintainers = with maintainers; [ chessai ];