taco: init at 02-08-2022_unstable
taco: change python to python3 taco: fix python call taco: pass python as null default taco: add llvmPackages for darwin
This commit is contained in:
parent
671cb8e663
commit
a615eb5a75
54
pkgs/development/libraries/taco/default.nix
Normal file
54
pkgs/development/libraries/taco/default.nix
Normal file
|
@ -0,0 +1,54 @@
|
|||
{ 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.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";
|
||||
license = licenses.mit;
|
||||
homepage = "https://github.com/tensor-compiler/taco";
|
||||
maintainers = [ maintainers.sheepforce ];
|
||||
};
|
||||
}
|
13
pkgs/development/libraries/taco/taco.patch
Normal file
13
pkgs/development/libraries/taco/taco.patch
Normal file
|
@ -0,0 +1,13 @@
|
|||
diff --git a/test/tests-tensor_types.cpp b/test/tests-tensor_types.cpp
|
||||
index 39d1b30a..c507da81 100644
|
||||
--- a/test/tests-tensor_types.cpp
|
||||
+++ b/test/tests-tensor_types.cpp
|
||||
@@ -45,7 +45,7 @@ TYPED_TEST_P(VectorTensorTest, types) {
|
||||
ASSERT_EQ(t, a.getComponentType());
|
||||
ASSERT_EQ(1, a.getOrder());
|
||||
ASSERT_EQ(5, a.getDimension(0));
|
||||
- map<vector<int>,TypeParam> vals = {{{0}, 1.0}, {{2}, 2.0}};
|
||||
+ map<vector<int>,TypeParam> vals = {{{0}, (TypeParam)1.0}, {{2}, (TypeParam)2.0}};
|
||||
for (auto& val : vals) {
|
||||
a.insert(val.first, val.second);
|
||||
}
|
|
@ -22959,6 +22959,8 @@ with pkgs;
|
|||
|
||||
dbcsr = callPackage ../development/libraries/science/math/dbcsr { };
|
||||
|
||||
taco = callPackage ../development/libraries/taco { };
|
||||
|
||||
## libGL/libGLU/Mesa stuff
|
||||
|
||||
# Default libGL implementation, should provide headers and
|
||||
|
|
|
@ -11799,6 +11799,11 @@ self: super: with self; {
|
|||
|
||||
tabview = callPackage ../development/python-modules/tabview { };
|
||||
|
||||
taco = toPythonModule (pkgs.taco.override {
|
||||
inherit (self) python;
|
||||
enablePython = true;
|
||||
});
|
||||
|
||||
tadasets = callPackage ../development/python-modules/tadasets { };
|
||||
|
||||
tag-expressions = callPackage ../development/python-modules/tag-expressions { };
|
||||
|
|
Loading…
Reference in a new issue