3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/arrayfire/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

71 lines
2.1 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, cmake, pkg-config
2020-04-17 00:06:49 +01:00
, opencl-clhpp, ocl-icd, fftw, fftwFloat
, blas, lapack, boost, mesa, libGLU, libGL
2021-03-25 09:24:48 +00:00
, freeimage, python3, clfft, clblas
, doxygen, buildDocs ? false
, cudaSupport ? false, cudatoolkit
2019-10-20 02:04:07 +01:00
}:
stdenv.mkDerivation rec {
2019-10-20 02:04:07 +01:00
pname = "arrayfire";
version = "3.7.3";
2019-10-20 02:04:07 +01:00
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "v${version}";
sha256 = "0gcbg6b6gs38xhks5pp0vkcqs89zl7rh9982jqlzsd0h724qddw0";
fetchSubmodules = true;
2019-10-20 02:04:07 +01:00
};
cmakeFlags = [
"-DAF_BUILD_OPENCL=OFF"
"-DAF_BUILD_EXAMPLES=OFF"
"-DBUILD_TESTING=OFF"
] ++ lib.optional cudaSupport "-DCMAKE_LIBRARY_PATH=${cudatoolkit}/lib/stubs";
2019-10-20 02:04:07 +01:00
patches = [ ./no-download.patch ];
postPatch = ''
mkdir -p ./build/third_party/clFFT/src
cp -R --no-preserve=mode,ownership ${clfft.src}/ ./build/third_party/clFFT/src/clFFT-ext/
2019-10-20 02:04:07 +01:00
mkdir -p ./build/third_party/clBLAS/src
cp -R --no-preserve=mode,ownership ${clblas.src}/ ./build/third_party/clBLAS/src/clBLAS-ext/
2019-10-20 02:04:07 +01:00
mkdir -p ./build/include/CL
cp -R --no-preserve=mode,ownership ${opencl-clhpp}/include/CL/cl2.hpp ./build/include/CL/cl2.hpp
2019-10-20 02:04:07 +01:00
'';
preBuild = lib.optionalString cudaSupport ''
2019-10-20 02:04:07 +01:00
export CUDA_PATH="${cudatoolkit}"
'';
nativeBuildInputs = [
cmake
pkg-config
2021-03-25 09:24:48 +00:00
python3
2019-10-20 02:04:07 +01:00
];
2021-03-25 09:24:48 +00:00
strictDeps = true;
2019-10-20 02:04:07 +01:00
buildInputs = [
opencl-clhpp fftw fftwFloat
blas lapack
2019-11-10 16:44:34 +00:00
libGLU libGL
2019-10-20 02:04:07 +01:00
mesa freeimage
boost.out boost.dev
] ++ (lib.optional stdenv.isLinux ocl-icd)
++ (lib.optional cudaSupport cudatoolkit)
++ (lib.optional buildDocs doxygen);
2019-10-20 02:04:07 +01:00
meta = with lib; {
description = "A general-purpose library for parallel and massively-parallel computations";
longDescription = ''
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.";
'';
2019-10-20 02:04:07 +01:00
license = licenses.bsd3;
homepage = "https://arrayfire.com/";
2019-10-20 02:04:07 +01:00
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ chessai ];
2019-10-20 02:04:07 +01:00
};
}