From 18bbd36ec460ca84b56d9f5bc470cdcf9f23471a Mon Sep 17 00:00:00 2001 From: Hoildkv <42310255+xq114@users.noreply.github.com> Date: Wed, 23 Mar 2022 18:39:02 +0800 Subject: [PATCH] add onedpl (#1092) * add onedpl * improve openblas * improve magnum * improve zstd * add asm back --- packages/c/corrade/xmake.lua | 2 +- packages/m/magnum-extras/xmake.lua | 2 +- packages/m/magnum-integration/xmake.lua | 4 +-- packages/m/magnum-plugins/xmake.lua | 2 +- packages/m/magnum/xmake.lua | 2 +- packages/o/onedpl/xmake.lua | 46 +++++++++++++++++++++++++ packages/o/openblas/xmake.lua | 1 + packages/z/zstd/xmake.lua | 11 ++++-- 8 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 packages/o/onedpl/xmake.lua diff --git a/packages/c/corrade/xmake.lua b/packages/c/corrade/xmake.lua index c34124c89..78c24cad5 100644 --- a/packages/c/corrade/xmake.lua +++ b/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", diff --git a/packages/m/magnum-extras/xmake.lua b/packages/m/magnum-extras/xmake.lua index f28efe802..e0fe59b48 100644 --- a/packages/m/magnum-extras/xmake.lua +++ b/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", diff --git a/packages/m/magnum-integration/xmake.lua b/packages/m/magnum-integration/xmake.lua index 4b9cc0a82..943c1a0f0 100644 --- a/packages/m/magnum-integration/xmake.lua +++ b/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) diff --git a/packages/m/magnum-plugins/xmake.lua b/packages/m/magnum-plugins/xmake.lua index 896ba65b3..655290385 100644 --- a/packages/m/magnum-plugins/xmake.lua +++ b/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", diff --git a/packages/m/magnum/xmake.lua b/packages/m/magnum/xmake.lua index 83e53f4b7..2c3eb8a66 100644 --- a/packages/m/magnum/xmake.lua +++ b/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", diff --git a/packages/o/onedpl/xmake.lua b/packages/o/onedpl/xmake.lua new file mode 100644 index 000000000..101141f53 --- /dev/null +++ b/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 + #include + #include + #include + void test() { + const size_t size = 10000000; + std::vector 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) diff --git a/packages/o/openblas/xmake.lua b/packages/o/openblas/xmake.lua index c13866c66..9ef2b6e69 100644 --- a/packages/o/openblas/xmake.lua +++ b/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 diff --git a/packages/z/zstd/xmake.lua b/packages/z/zstd/xmake.lua index 42f8a2216..08456dc32 100644 --- a/packages/z/zstd/xmake.lua +++ b/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)