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: 516377d1d825
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f8cd096aad91
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Aug 30, 2019

  1. clmagma: init at 1.3

    volhovm committed Aug 30, 2019
    Copy the full SHA
    58dffa3 View commit details

Commits on Jan 5, 2020

  1. Merge pull request #54967 from volhovm/volhovm/clmagma

    clmagma: init at 1.3
    ryantm authored Jan 5, 2020
    Copy the full SHA
    f8cd096 View commit details
Showing with 76 additions and 0 deletions.
  1. +75 −0 pkgs/development/libraries/science/math/clmagma/default.nix
  2. +1 −0 pkgs/top-level/all-packages.nix
75 changes: 75 additions & 0 deletions pkgs/development/libraries/science/math/clmagma/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{ stdenv, fetchurl, gfortran, opencl-headers, clblas, ocl-icd, mkl, intel-ocl }:

with stdenv.lib;

let
version = "1.3.0";
incfile = builtins.toFile "make.inc.custom" ''
CC = g++
FORT = gfortran
ARCH = ar
ARCHFLAGS = cr
RANLIB = ranlib
OPTS = -fPIC -O3 -DADD_ -Wall
FOPTS = -fPIC -O3 -DADD_ -Wall -x f95-cpp-input
F77OPTS = -fPIC -O3 -DADD_ -Wall
LDOPTS = -fPIC
-include make.check-mkl
-include make.check-clblas
# Gnu mkl is not available I guess?
#LIB = -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lpthread -lm -fopenmp
LIB = -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lm -fopenmp
LIB += -lclBLAS -lOpenCL
LIBDIR = -L$(MKLROOT)/lib/intel64 \
-L$(MKLROOT)/../compiler/lib/intel64 \
-L$(clBLAS)/lib64
INC = -I$(clBLAS)/include
#-I$(AMDAPP)/include
'';
in stdenv.mkDerivation {
name = "clmagma-${version}";
src = fetchurl {
url = "http://icl.cs.utk.edu/projectsfiles/magma/cl/clmagma-${version}.tar.gz";
sha256 = "1n27ny0xhwirw2ydn46pfcwy53gzia9zbam4irx44fd4d7f9ydv7";
name = "clmagma-${version}.tar.gz";
};

buildInputs = [
gfortran
clblas
opencl-headers
ocl-icd
mkl
intel-ocl
];

enableParallelBuilding=true;

MKLROOT = "${mkl}";
clBLAS = "${clblas}";

# Otherwise build looks for it in /run/opengl-driver/etc/OpenCL/vendors,
# which is not available.
OPENCL_VENDOR_PATH="${intel-ocl}/etc/OpenCL/vendors";

preBuild = ''
# By default it tries to use GPU, and thus fails for CPUs
sed -i "s/CL_DEVICE_TYPE_GPU/CL_DEVICE_TYPE_DEFAULT/" interface_opencl/clmagma_runtime.cpp
sed -i "s%/usr/local/clmagma%/$out%" Makefile.internal
cp ${incfile} make.inc
'';

meta = with stdenv.lib; {
description = "Matrix Algebra on GPU and Multicore Architectures, OpenCL port";
license = licenses.bsd3;
homepage = http://icl.cs.utk.edu/magma/index.html;
platforms = platforms.linux;
maintainers = with maintainers; [ volhovm ];
};
}
1 change: 1 addition & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
@@ -23883,6 +23883,7 @@ in
lie = callPackage ../applications/science/math/LiE { };

magma = callPackage ../development/libraries/science/math/magma { };
clmagma = callPackage ../development/libraries/science/math/clmagma { };

mathematica = callPackage ../applications/science/math/mathematica { };
mathematica9 = callPackage ../applications/science/math/mathematica/9.nix { };