Merge pull request #72142 from chessai/arrayfire-update
arrayfire: update
This commit is contained in:
commit
5a715fc96c
@ -1,36 +1,16 @@
|
|||||||
{ stdenv, fetchurl, fetchFromGitHub, cmake, pkgconfig
|
{ stdenv, fetchurl, fetchFromGitHub, cmake, pkgconfig
|
||||||
, cudatoolkit, opencl-clhpp, ocl-icd, fftw, fftwFloat, mkl
|
, cudatoolkit, opencl-clhpp, ocl-icd, fftw, fftwFloat, mkl
|
||||||
, blas, openblas, boost, mesa, libGLU_combined
|
, blas, openblas, boost, mesa, libGLU_combined
|
||||||
, freeimage, python
|
, freeimage, python, clfft, clblas
|
||||||
|
, doxygen, buildDocs ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
version = "3.6.4";
|
strOnLinux = stdenv.lib.optionalString stdenv.isLinux;
|
||||||
|
|
||||||
clfftSource = fetchFromGitHub {
|
in stdenv.mkDerivation rec {
|
||||||
owner = "arrayfire";
|
|
||||||
repo = "clFFT";
|
|
||||||
rev = "16925fb93338b3cac66490b5cf764953d6a5dac7";
|
|
||||||
sha256 = "0y35nrdz7w4n1l17myhkni3hwm37z775xn6f76xmf1ph7dbkslsc";
|
|
||||||
fetchSubmodules = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
clblasSource = fetchFromGitHub {
|
|
||||||
owner = "arrayfire";
|
|
||||||
repo = "clBLAS";
|
|
||||||
rev = "1f3de2ae5582972f665c685b18ef0df43c1792bb";
|
|
||||||
sha256 = "154mz52r5hm0jrp5fqrirzzbki14c1jkacj75flplnykbl36ibjs";
|
|
||||||
fetchSubmodules = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
cl2hppSource = fetchurl {
|
|
||||||
url = "https://github.com/KhronosGroup/OpenCL-CLHPP/releases/download/v2.0.10/cl2.hpp";
|
|
||||||
sha256 = "1v4q0g6b6mwwsi0kn7kbjn749j3qafb9r4ld3zdq1163ln9cwnvw";
|
|
||||||
};
|
|
||||||
|
|
||||||
in stdenv.mkDerivation {
|
|
||||||
pname = "arrayfire";
|
pname = "arrayfire";
|
||||||
inherit version;
|
version = "3.6.4";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "http://arrayfire.com/arrayfire_source/arrayfire-full-${version}.tar.bz2";
|
url = "http://arrayfire.com/arrayfire_source/arrayfire-full-${version}.tar.bz2";
|
||||||
@ -41,21 +21,21 @@ in stdenv.mkDerivation {
|
|||||||
"-DAF_BUILD_OPENCL=OFF"
|
"-DAF_BUILD_OPENCL=OFF"
|
||||||
"-DAF_BUILD_EXAMPLES=OFF"
|
"-DAF_BUILD_EXAMPLES=OFF"
|
||||||
"-DBUILD_TESTING=OFF"
|
"-DBUILD_TESTING=OFF"
|
||||||
"-DCMAKE_LIBRARY_PATH=${cudatoolkit}/lib/stubs"
|
(strOnLinux "-DCMAKE_LIBRARY_PATH=${cudatoolkit}/lib/stubs")
|
||||||
];
|
];
|
||||||
|
|
||||||
patches = [ ./no-download.patch ];
|
patches = [ ./no-download.patch ];
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
mkdir -p ./build/third_party/clFFT/src
|
mkdir -p ./build/third_party/clFFT/src
|
||||||
cp -R --no-preserve=mode,ownership ${clfftSource}/ ./build/third_party/clFFT/src/clFFT-ext/
|
cp -R --no-preserve=mode,ownership ${clfft.src}/ ./build/third_party/clFFT/src/clFFT-ext/
|
||||||
mkdir -p ./build/third_party/clBLAS/src
|
mkdir -p ./build/third_party/clBLAS/src
|
||||||
cp -R --no-preserve=mode,ownership ${clblasSource}/ ./build/third_party/clBLAS/src/clBLAS-ext/
|
cp -R --no-preserve=mode,ownership ${clblas.src}/ ./build/third_party/clBLAS/src/clBLAS-ext/
|
||||||
mkdir -p ./build/include/CL
|
mkdir -p ./build/include/CL
|
||||||
cp -R --no-preserve=mode,ownership ${cl2hppSource} ./build/include/CL/cl2.hpp
|
cp -R --no-preserve=mode,ownership ${opencl-clhpp}/include/CL/cl2.hpp ./build/include/CL/cl2.hpp
|
||||||
'';
|
'';
|
||||||
|
|
||||||
preBuild = ''
|
preBuild = strOnLinux ''
|
||||||
export CUDA_PATH="${cudatoolkit}"
|
export CUDA_PATH="${cudatoolkit}"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@ -64,6 +44,7 @@ in stdenv.mkDerivation {
|
|||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
cmake
|
cmake
|
||||||
pkgconfig
|
pkgconfig
|
||||||
|
python
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
@ -72,15 +53,18 @@ in stdenv.mkDerivation {
|
|||||||
openblas
|
openblas
|
||||||
libGLU_combined
|
libGLU_combined
|
||||||
mesa freeimage
|
mesa freeimage
|
||||||
boost.out boost.dev python
|
boost.out boost.dev
|
||||||
] ++ (stdenv.lib.optional stdenv.isLinux [ cudatoolkit ocl-icd ]);
|
] ++ (stdenv.lib.optional stdenv.isLinux [ cudatoolkit ocl-icd ])
|
||||||
|
++ (stdenv.lib.optional buildDocs [ doxygen ]);
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "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";
|
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.";
|
||||||
|
'';
|
||||||
license = licenses.bsd3;
|
license = licenses.bsd3;
|
||||||
homepage = https://arrayfire.com/ ;
|
homepage = "https://arrayfire.com/";
|
||||||
platforms = platforms.linux ++ platforms.darwin;
|
platforms = platforms.linux ++ platforms.darwin;
|
||||||
maintainers = with stdenv.lib.maintainers; [ chessai ];
|
maintainers = with maintainers; [ chessai ];
|
||||||
inherit version;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user