571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
56 lines
1.5 KiB
Nix
56 lines
1.5 KiB
Nix
{ stdenv
|
|
, lib
|
|
, fetchgit
|
|
, cmake
|
|
, llvmPackages
|
|
, enablePython ? false
|
|
, python ? null
|
|
}:
|
|
|
|
let pyEnv = python.withPackages (p: with p; [ numpy scipy ]);
|
|
|
|
in stdenv.mkDerivation rec {
|
|
pname = "taco";
|
|
version = "unstable-2022-08-02";
|
|
|
|
src = fetchgit {
|
|
url = "https://github.com/tensor-compiler/${pname}.git";
|
|
rev = "2b8ece4c230a5f0f0a74bc6f48e28edfb6c1c95e";
|
|
fetchSubmodules = true;
|
|
hash = "sha256-PnBocyRLiLALuVS3Gkt/yJeslCMKyK4zdsBI8BFaTSg=";
|
|
};
|
|
|
|
# Remove test cases from cmake build as they violate modern C++ expectations
|
|
patches = [ ./taco.patch ];
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
buildInputs = lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp;
|
|
|
|
propagatedBuildInputs = lib.optional enablePython pyEnv;
|
|
|
|
cmakeFlags = [
|
|
"-DOPENMP=ON"
|
|
] ++ lib.optional enablePython "-DPYTHON=ON" ;
|
|
|
|
postInstall = lib.strings.optionalString enablePython ''
|
|
mkdir -p $out/${python.sitePackages}
|
|
cp -r lib/pytaco $out/${python.sitePackages}/.
|
|
'';
|
|
|
|
# The standard CMake test suite fails a single test of the CLI interface.
|
|
doCheck = false;
|
|
|
|
# Cython somehow gets built with references to /build/.
|
|
# However, the python module works flawlessly.
|
|
dontFixup = enablePython;
|
|
|
|
meta = with lib; {
|
|
description = "Computes sparse tensor expressions on CPUs and GPUs";
|
|
mainProgram = "taco";
|
|
license = licenses.mit;
|
|
homepage = "https://github.com/tensor-compiler/taco";
|
|
maintainers = [ maintainers.sheepforce ];
|
|
};
|
|
}
|