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

+74
+54
pkgs/development/libraries/taco/default.nix
···
··· 1 + { stdenv 2 + , lib 3 + , fetchgit 4 + , cmake 5 + , llvmPackages 6 + , enablePython ? false 7 + , python ? null 8 + }: 9 + 10 + let pyEnv = python.withPackages (p: with p; [ numpy scipy ]); 11 + 12 + in stdenv.mkDerivation rec { 13 + pname = "taco"; 14 + version = "unstable-2022-08-02"; 15 + 16 + src = fetchgit { 17 + url = "https://github.com/tensor-compiler/${pname}.git"; 18 + rev = "2b8ece4c230a5f0f0a74bc6f48e28edfb6c1c95e"; 19 + fetchSubmodules = true; 20 + hash = "sha256-PnBocyRLiLALuVS3Gkt/yJeslCMKyK4zdsBI8BFaTSg="; 21 + }; 22 + 23 + # Remove test cases from cmake build as they violate modern C++ expectations 24 + patches = [ ./taco.patch ]; 25 + 26 + nativeBuildInputs = [ cmake ]; 27 + 28 + buildInputs = lib.optional stdenv.isDarwin llvmPackages.openmp; 29 + 30 + propagatedBuildInputs = lib.optional enablePython pyEnv; 31 + 32 + cmakeFlags = [ 33 + "-DOPENMP=ON" 34 + ] ++ lib.optional enablePython "-DPYTHON=ON" ; 35 + 36 + postInstall = lib.strings.optionalString enablePython '' 37 + mkdir -p $out/${python.sitePackages} 38 + cp -r lib/pytaco $out/${python.sitePackages}/. 39 + ''; 40 + 41 + # The standard CMake test suite fails a single test of the CLI interface. 42 + doCheck = false; 43 + 44 + # Cython somehow gets built with references to /build/. 45 + # However, the python module works flawlessly. 46 + dontFixup = enablePython; 47 + 48 + meta = with lib; { 49 + description = "Computes sparse tensor expressions on CPUs and GPUs"; 50 + license = licenses.mit; 51 + homepage = "https://github.com/tensor-compiler/taco"; 52 + maintainers = [ maintainers.sheepforce ]; 53 + }; 54 + }
+13
pkgs/development/libraries/taco/taco.patch
···
··· 1 + diff --git a/test/tests-tensor_types.cpp b/test/tests-tensor_types.cpp 2 + index 39d1b30a..c507da81 100644 3 + --- a/test/tests-tensor_types.cpp 4 + +++ b/test/tests-tensor_types.cpp 5 + @@ -45,7 +45,7 @@ TYPED_TEST_P(VectorTensorTest, types) { 6 + ASSERT_EQ(t, a.getComponentType()); 7 + ASSERT_EQ(1, a.getOrder()); 8 + ASSERT_EQ(5, a.getDimension(0)); 9 + - map<vector<int>,TypeParam> vals = {{{0}, 1.0}, {{2}, 2.0}}; 10 + + map<vector<int>,TypeParam> vals = {{{0}, (TypeParam)1.0}, {{2}, (TypeParam)2.0}}; 11 + for (auto& val : vals) { 12 + a.insert(val.first, val.second); 13 + }
+2
pkgs/top-level/all-packages.nix
··· 22959 22960 dbcsr = callPackage ../development/libraries/science/math/dbcsr { }; 22961 22962 ## libGL/libGLU/Mesa stuff 22963 22964 # Default libGL implementation, should provide headers and
··· 22959 22960 dbcsr = callPackage ../development/libraries/science/math/dbcsr { }; 22961 22962 + taco = callPackage ../development/libraries/taco { }; 22963 + 22964 ## libGL/libGLU/Mesa stuff 22965 22966 # Default libGL implementation, should provide headers and
+5
pkgs/top-level/python-packages.nix
··· 11799 11800 tabview = callPackage ../development/python-modules/tabview { }; 11801 11802 tadasets = callPackage ../development/python-modules/tadasets { }; 11803 11804 tag-expressions = callPackage ../development/python-modules/tag-expressions { };
··· 11799 11800 tabview = callPackage ../development/python-modules/tabview { }; 11801 11802 + taco = toPythonModule (pkgs.taco.override { 11803 + inherit (self) python; 11804 + enablePython = true; 11805 + }); 11806 + 11807 tadasets = callPackage ../development/python-modules/tadasets { }; 11808 11809 tag-expressions = callPackage ../development/python-modules/tag-expressions { };