Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 48c9c55accfd
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b03da424c6b9
Choose a head ref
  • 2 commits
  • 3 files changed
  • 2 contributors

Commits on Oct 20, 2019

  1. arrayfire: add package

    chessai committed Oct 20, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ed3ccf4 View commit details
  2. Merge pull request #71413 from chessai/add-arrayfire

    arrayfire: add
    cleverca22 authored Oct 20, 2019
    Copy the full SHA
    b03da42 View commit details
Showing with 119 additions and 0 deletions.
  1. +86 −0 pkgs/development/libraries/arrayfire/default.nix
  2. +28 −0 pkgs/development/libraries/arrayfire/no-download.patch
  3. +5 −0 pkgs/top-level/all-packages.nix
86 changes: 86 additions & 0 deletions pkgs/development/libraries/arrayfire/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{ stdenv, fetchurl, fetchFromGitHub, cmake, pkgconfig
, cudatoolkit, opencl-clhpp, ocl-icd, fftw, fftwFloat, mkl
, blas, openblas, boost, mesa, libGLU_combined
, freeimage, python
}:

let
version = "3.6.4";

clfftSource = fetchFromGitHub {
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";
inherit version;

src = fetchurl {
url = "http://arrayfire.com/arrayfire_source/arrayfire-full-${version}.tar.bz2";
sha256 = "1fin7a9rliyqic3z83agkpb8zlq663q6gdxsnm156cs8s7f7rc9h";
};

cmakeFlags = [
"-DAF_BUILD_OPENCL=OFF"
"-DAF_BUILD_EXAMPLES=OFF"
"-DBUILD_TESTING=OFF"
"-DCMAKE_LIBRARY_PATH=${cudatoolkit}/lib/stubs"
];

patches = [ ./no-download.patch ];

postPatch = ''
mkdir -p ./build/third_party/clFFT/src
cp -R --no-preserve=mode,ownership ${clfftSource}/ ./build/third_party/clFFT/src/clFFT-ext/
mkdir -p ./build/third_party/clBLAS/src
cp -R --no-preserve=mode,ownership ${clblasSource}/ ./build/third_party/clBLAS/src/clBLAS-ext/
mkdir -p ./build/include/CL
cp -R --no-preserve=mode,ownership ${cl2hppSource} ./build/include/CL/cl2.hpp
'';

preBuild = ''
export CUDA_PATH="${cudatoolkit}"
'';

enableParallelBuilding = true;

nativeBuildInputs = [
cmake
pkgconfig
];

buildInputs = [
opencl-clhpp fftw fftwFloat
mkl
openblas
libGLU_combined
mesa freeimage
boost.out boost.dev python
] ++ (stdenv.lib.optional stdenv.isLinux [ cudatoolkit ocl-icd ]);

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";
license = licenses.bsd3;
homepage = https://arrayfire.com/ ;
platforms = platforms.linux ++ platforms.darwin;
maintainers = with stdenv.lib.maintainers; [ chessai ];
inherit version;
};
}
28 changes: 28 additions & 0 deletions pkgs/development/libraries/arrayfire/no-download.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/CMakeModules/build_clBLAS.cmake b/CMakeModules/build_clBLAS.cmake
index 8de529e8..6361b613 100644
--- a/CMakeModules/build_clBLAS.cmake
+++ b/CMakeModules/build_clBLAS.cmake
@@ -14,8 +14,7 @@ find_package(OpenCL)

ExternalProject_Add(
clBLAS-ext
- GIT_REPOSITORY https://github.com/arrayfire/clBLAS.git
- GIT_TAG arrayfire-release
+ DOWNLOAD_COMMAND true
BUILD_BYPRODUCTS ${clBLAS_location}
PREFIX "${prefix}"
INSTALL_DIR "${prefix}"
diff --git a/CMakeModules/build_clFFT.cmake b/CMakeModules/build_clFFT.cmake
index 28be38a3..85e3915e 100644
--- a/CMakeModules/build_clFFT.cmake
+++ b/CMakeModules/build_clFFT.cmake
@@ -20,8 +20,7 @@ ENDIF()

ExternalProject_Add(
clFFT-ext
- GIT_REPOSITORY https://github.com/arrayfire/clFFT.git
- GIT_TAG arrayfire-release
+ DOWNLOAD_COMMAND true
PREFIX "${prefix}"
INSTALL_DIR "${prefix}"
UPDATE_COMMAND ""
5 changes: 5 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
@@ -10413,6 +10413,11 @@ in

armadillo = callPackage ../development/libraries/armadillo {};

arrayfire = callPackage ../development/libraries/arrayfire {
# fails to build with gcc >= 7
stdenv = gcc6Stdenv;
};

arrow-cpp = callPackage ../development/libraries/arrow-cpp {
gtest = gtest.override { static = true; };
};