Bladeren bron

add onedpl (#1092)

* add onedpl

* improve openblas

* improve magnum

* improve zstd

* add asm back
Hoildkv 3 jaren geleden
bovenliggende
commit
18bbd36ec4

+ 1 - 1
packages/c/corrade/xmake.lua

@@ -1,7 +1,7 @@
 package("corrade")
 
     set_homepage("https://magnum.graphics/corrade/")
-    set_description("Cor­rade is a mul­ti­plat­form util­i­ty li­brary writ­ten in C++11/C++14.")
+    set_description("Corrade is a multiplatform utility library written in C++11/C++14.")
     set_license("MIT")
 
     add_urls("https://github.com/mosra/corrade/archive/refs/tags/$(version).zip",

+ 1 - 1
packages/m/magnum-extras/xmake.lua

@@ -1,7 +1,7 @@
 package("magnum-extras")
 
     set_homepage("https://magnum.graphics/")
-    set_description("Extras for magnum, Light­weight and mod­u­lar C++11/C++14 graph­ics mid­dle­ware for games and data visu­al­iz­a­tion.")
+    set_description("Extras for magnum, Lightweight and modular C++11/C++14 graphics middleware for games and data visualization.")
     set_license("MIT")
 
     add_urls("https://github.com/mosra/magnum-extras/archive/refs/tags/$(version).zip",

+ 2 - 2
packages/m/magnum-integration/xmake.lua

@@ -1,7 +1,7 @@
 package("magnum-integration")
 
     set_homepage("https://magnum.graphics/")
-    set_description("Integration libraries for magnum, Light­weight and mod­u­lar C++11/C++14 graph­ics mid­dle­ware for games and data visu­al­iz­a­tion.")
+    set_description("Integration libraries for magnum, Lightweight and modular C++11/C++14 graphics middleware for games and data visualization.")
     set_license("MIT")
 
     add_urls("https://github.com/mosra/magnum-integration/archive/refs/tags/$(version).zip",
@@ -33,7 +33,7 @@ package("magnum-integration")
         for _, integration in ipairs(integrations) do
             table.insert(configs, "-DWITH_" .. integration:upper() .. "=" .. (package:config(integration) and "ON" or "OFF"))
         end
-        import("package.tools.cmake").install(package, configs, {packagedeps = packagedeps})
+        import("package.tools.cmake").install(package, configs)
     end)
 
     on_test(function (package)

+ 1 - 1
packages/m/magnum-plugins/xmake.lua

@@ -1,7 +1,7 @@
 package("magnum-plugins")
 
     set_homepage("https://magnum.graphics/")
-    set_description("Plugins for magnum, C++11/C++14 graph­ics mid­dle­ware for games and data visu­al­iz­a­tion.")
+    set_description("Plugins for magnum, C++11/C++14 graphics middleware for games and data visualization.")
     set_license("MIT")
 
     add_urls("https://github.com/mosra/magnum-plugins/archive/refs/tags/$(version).zip",

+ 1 - 1
packages/m/magnum/xmake.lua

@@ -1,7 +1,7 @@
 package("magnum")
 
     set_homepage("https://magnum.graphics/")
-    set_description("Light­weight and mod­u­lar C++11/C++14 graph­ics mid­dle­ware for games and data visu­al­iz­a­tion.")
+    set_description("Lightweight and modular C++11/C++14 graphics middleware for games and data visualization.")
     set_license("MIT")
 
     add_urls("https://github.com/mosra/magnum/archive/refs/tags/$(version).zip",

+ 46 - 0
packages/o/onedpl/xmake.lua

@@ -0,0 +1,46 @@
+package("onedpl")
+
+    set_kind("library", {headeronly = true})
+    set_homepage("https://www.intel.com/content/www/us/en/developer/tools/oneapi/dpc-library.html")
+    set_description("oneAPI DPC++ Library")
+
+    add_urls("https://github.com/oneapi-src/oneDPL/archive/refs/tags/oneDPL-$(version)-release.tar.gz")
+    add_versions("2021.6.1", "4995fe2ed2724b89cdb52c4b6c9af22e146b48d2561abdafdaaa06262dbd67c4")
+
+    add_configs("backend", {description = "Choose threading backend.", default = "tbb", type = "string", values = {"tbb", "dpcpp", "dpcpp_only", "omp", "serial"}})
+
+    add_deps("cmake")
+    on_load("windows", "linux", function (package)
+        local backend = package:config("backend")
+        if backend == "tbb" or backend == "dpcpp" then
+            package:add("deps", "tbb")
+        elseif backend == "omp" then
+            package:add("deps", "openmp")
+        end
+        if package:is_plat("windows") then
+            package:add("cxxflags", "/Zc:__cplusplus")
+        end
+    end)
+
+    on_install("windows", "linux", function (package)
+        io.replace("CMakeLists.txt", "add_subdirectory(test)", "", {plain = true})
+        local configs = {}
+        table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
+        table.insert(configs, "-DONEDPL_BACKEND=" .. package:config("backend"))
+        import("package.tools.cmake").install(package, configs)
+    end)
+
+    on_test(function (package)
+        assert(package:check_cxxsnippets({test = [[
+            #include <oneapi/dpl/algorithm>
+            #include <oneapi/dpl/execution>
+            #include <oneapi/dpl/numeric>
+            #include <vector>
+            void test() {
+                const size_t size = 10000000;
+                std::vector<double> v1(size), v2(size);
+                double res = std::transform_reduce(oneapi::dpl::execution::par_unseq,
+                                                   v1.cbegin(), v1.cend(), v2.cbegin(), .0);
+            }
+        ]]}, {configs = {languages = "c++17"}}))
+    end)

+ 1 - 0
packages/o/openblas/xmake.lua

@@ -2,6 +2,7 @@ package("openblas")
 
     set_homepage("http://www.openblas.net/")
     set_description("OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.")
+    set_license("BSD-3-Clause")
 
     if is_plat("windows") then
         if is_arch("x64", "x86_64") then

+ 9 - 2
packages/z/zstd/xmake.lua

@@ -2,6 +2,7 @@ package("zstd")
 
     set_homepage("https://www.zstd.net/")
     set_description("Zstandard - Fast real-time compression algorithm")
+    set_license("BSD-3-Clause")
 
     set_urls("https://github.com/facebook/zstd/archive/$(version).tar.gz",
              "https://github.com/facebook/zstd.git")
@@ -9,6 +10,12 @@ package("zstd")
     add_versions("v1.5.0", "0d9ade222c64e912d6957b11c923e214e2e010a18f39bec102f572e693ba2867")
     add_versions("v1.5.2", "f7de13462f7a82c29ab865820149e778cbfe01087b3a55b5332707abf9db4a6e")
 
+    on_load("windows", function (package)
+        if package:config("shared") then
+            package:add("defines", "ZSTD_DLL_IMPORT=1")
+        end
+    end)
+
     on_install(function (package)
         io.writefile("xmake.lua", ([[
             set_version("%s")
@@ -19,10 +26,11 @@ package("zstd")
                 add_files("lib/common/*.c")
                 add_files("lib/compress/*.c")
                 add_files("lib/decompress/*.c")
+                add_files("lib/dictBuilder/*.c")
                 add_headerfiles("lib/*.h")
                 add_defines("XXH_NAMESPACE=ZSTD_")
                 if is_kind("shared") and is_plat("windows") then
-                    add_defines("ZSTD_DLL_EXPORT")
+                    add_defines("ZSTD_DLL_EXPORT=1")
                 end
                 on_config(function (target)
                     if target:is_arch("x64", "x86_64") and target:has_tool("cc", "clang", "gcc") then
@@ -32,7 +40,6 @@ package("zstd")
                     end
                 end)
         ]]):format(package:version_str()))
-
         import("package.tools.xmake").install(package)
     end)