<commit_before>{ stdenv
, fetchFromGitHub
, cmake
, gfortran
, blas
, boost
, python
, cudatoolkit
, nvidia_x11
, gtest
}:

stdenv.mkDerivation rec {
  name = "clblas-cuda-${version}"; 
  version = "git-20160505"; 

  src = fetchFromGitHub {
    owner = "clMathLibraries"; 
    repo = "clBLAS";
    rev = "d20977ec4389c6b3751e318779410007c5e272f8";
    sha256 = "1jna176cxznv7iz43svd6cjrbbf0fc2lrbpfpg4s08vc7xnwp0n4";
  }; 

  patches = [ ./platform.patch ]; 

  postPatch = ''
    sed -i -re 's/(set\(\s*Boost_USE_STATIC_LIBS\s+).*/\1OFF\ \)/g' src/CMakeLists.txt
  '';

  configurePhase = ''
    findInputs ${boost.dev} boost_dirs propagated-native-build-inputs

    export BOOST_INCLUDEDIR=$(echo $boost_dirs | sed -e s/\ /\\n/g - | grep '\-dev')/include
    export BOOST_LIBRARYDIR=$(echo $boost_dirs | sed -e s/\ /\\n/g - | grep -v '\-dev')/lib

    mkdir -p Build
    pushd Build

    export LD_LIBRARY_PATH="${stdenv.lib.makeLibraryPath [ blas nvidia_x11 ]}"

    cmake ../src -DCMAKE_INSTALL_PREFIX=$out \
                 -DCMAKE_BUILD_TYPE=Release \
                 -DOPENCL_ROOT=${cudatoolkit} \
                 -DUSE_SYSTEM_GTEST=ON
  '';

  dontStrip = true; 

  buildInputs = [
    cmake
    gfortran
    blas
    python
    cudatoolkit
    nvidia_x11
    gtest
  ]; 

  meta = with stdenv.lib; {
    homepage = https://github.com/clMathLibraries/clBLAS;
    description = "A software library containing BLAS functions written in OpenCL";
    longDescription = ''
      This package contains a library of BLAS functions on top of OpenCL. 
      The current version is linked to the NVIDIA OpenCL implementation provided by the CUDA toolkit. 
    '';<commit_msg>clblas-cuda: requires ocl-icd now for libOpenCL.so.1 #25902<commit_after>{ stdenv
, fetchFromGitHub
, cmake
, gfortran
, blas
, boost
, python
, ocl-icd
, cudatoolkit
, nvidia_x11
, gtest
}:

stdenv.mkDerivation rec {
  name = "clblas-cuda-${version}"; 
  version = "git-20160505"; 

  src = fetchFromGitHub {
    owner = "clMathLibraries"; 
    repo = "clBLAS";
    rev = "d20977ec4389c6b3751e318779410007c5e272f8";
    sha256 = "1jna176cxznv7iz43svd6cjrbbf0fc2lrbpfpg4s08vc7xnwp0n4";
  }; 

  patches = [ ./platform.patch ]; 

  postPatch = ''
    sed -i -re 's/(set\(\s*Boost_USE_STATIC_LIBS\s+).*/\1OFF\ \)/g' src/CMakeLists.txt
  '';

  configurePhase = ''
    findInputs ${boost.dev} boost_dirs propagated-native-build-inputs

    export BOOST_INCLUDEDIR=$(echo $boost_dirs | sed -e s/\ /\\n/g - | grep '\-dev')/include
    export BOOST_LIBRARYDIR=$(echo $boost_dirs | sed -e s/\ /\\n/g - | grep -v '\-dev')/lib

    mkdir -p Build
    pushd Build

    export LD_LIBRARY_PATH="${stdenv.lib.makeLibraryPath [ blas nvidia_x11 ]}"

    cmake ../src -DCMAKE_INSTALL_PREFIX=$out \
                 -DCMAKE_BUILD_TYPE=Release \
                 -DOPENCL_ROOT=${cudatoolkit} \
                 -DUSE_SYSTEM_GTEST=ON
  '';

  dontStrip = true; 

  buildInputs = [
    cmake
    gfortran
    blas
    python
    ocl-icd
    cudatoolkit
    nvidia_x11
    gtest
  ]; 

  meta = with stdenv.lib; {
    homepage = https://github.com/clMathLibraries/clBLAS;
    description = "A software library containing BLAS functions written in OpenCL";
    longDescription = ''
      This package contains a library of BLAS functions on top of OpenCL. 
      The current version is linked to the NVIDIA OpenCL implementation provided by the CUDA toolkit. 
    '';
{'fraction_non_alphanumeric': 0.11952074810052601, 'fraction_numerical': 0.03974284044418469, 'mean_word_length': 2.7287581699346406, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5324674', 'n_tokens_mistral': 1398, 'n_tokens_neox': 1255, 'n_words': 264}