Skip to content

Commit 8767237

Browse files
authored
add onednn (#1103)
* add onednn * update llvm-mingw * update binutils * fix onednn * fix binutils
1 parent 4b82b7c commit 8767237

File tree

3 files changed

+67
-16
lines changed

3 files changed

+67
-16
lines changed

packages/b/binutils/xmake.lua

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package("binutils")
77

88
set_urls("https://ftp.gnu.org/gnu/binutils/binutils-$(version).tar.xz",
99
"https://ftpmirror.gnu.org/binutils/binutils-$(version).tar.xz")
10-
10+
add_versions("2.38", "e316477a914f567eccc34d5d29785b8b0f5a10208d36bbacedcc39048ecfe024")
1111
add_versions("2.34", "f00b0e8803dc9bab1e2165bd568528135be734df3fabf8d0161828cd56028952")
1212

1313
if is_plat("mingw") and is_subhost("msys") then
@@ -20,26 +20,28 @@ package("binutils")
2020

2121
on_install("@linux", "@macosx", "@msys", function (package)
2222
local configs = {"--disable-debug",
23-
"--disable-dependency-tracking",
24-
"--enable-deterministic-archives",
25-
"--infodir=" .. package:installdir("share/info"),
26-
"--mandir=" .. package:installdir("share/man"),
27-
"--disable-werror",
28-
"--enable-interwork",
29-
"--enable-multilib",
30-
"--enable-64-bit-bfd",
31-
"--enable-targets=all"}
23+
"--disable-dependency-tracking",
24+
"--enable-deterministic-archives",
25+
"--infodir=" .. package:installdir("share/info"),
26+
"--mandir=" .. package:installdir("share/man"),
27+
"--disable-werror",
28+
"--enable-interwork",
29+
"--enable-multilib",
30+
"--enable-64-bit-bfd",
31+
"--enable-targets=all"}
3232
if package:is_plat("linux") then
3333
table.insert(configs, "--with-sysroot=/")
3434
table.insert(configs, "--enable-gold")
3535
table.insert(configs, "--enable-plugins")
3636
end
3737
-- fix 'makeinfo' is missing on your system.
38-
io.replace("binutils/Makefile.in", "SUBDIRS = doc po", "SUBDIRS = ")
39-
-- fix multiple definition of `program_name'
40-
io.replace("binutils/srconv.c", "char *program_name;", "extern char *program_name;", {plain = true})
41-
io.replace("binutils/sysdump.c", "char *program_name;", "extern char *program_name;", {plain = true})
42-
io.replace("binutils/coffdump.c", "char * program_name;", "extern char *program_name;", {plain = true})
38+
io.replace("binutils/Makefile.in", "SUBDIRS =.-po", "SUBDIRS = ")
39+
if package:version():le("2.34") then
40+
-- fix multiple definition of `program_name'
41+
io.replace("binutils/srconv.c", "char *program_name;", "extern char *program_name;", {plain = true})
42+
io.replace("binutils/sysdump.c", "char *program_name;", "extern char *program_name;", {plain = true})
43+
io.replace("binutils/coffdump.c", "char * program_name;", "extern char *program_name;", {plain = true})
44+
end
4345
import("package.tools.autoconf").install(package, configs)
4446
end)
4547

packages/l/llvm-mingw/xmake.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,33 @@ package("llvm-mingw")
99
set_urls("https://github.com/mstorsjo/llvm-mingw/releases/download/$(version)/llvm-mingw-$(version)-ucrt-i686.zip")
1010
add_versions("20201020", "4f07721a81a3ba0980fc089e839d1f1a5784bbc8cee1332c15cf1b6ba24525d6")
1111
add_versions("20211002", "e4faaea995c980f4b0808cc4ec17d5ea9fc2c83449f0cb3a8af07e52abe26679")
12+
add_versions("20220323", "34889c54195c3d677c3751fd53fa49d005e9750651f3ce994817a3c7670e7eb5")
1213
elseif os.arch() == "arm64" then
1314
set_urls("https://github.com/mstorsjo/llvm-mingw/releases/download/$(version)/llvm-mingw-$(version)-ucrt-aarch64.zip")
1415
add_versions("20201020", "57d6e0fff94774ccd958a3d0174686189d3ec1cb5981eb4ea37fc82a007cc674")
15-
add_versions("20211002", "1f618c4323a7e64df8a97d4fe8a933e6c8bdc131c91f90b89888927ebd179f83 ")
16+
add_versions("20211002", "1f618c4323a7e64df8a97d4fe8a933e6c8bdc131c91f90b89888927ebd179f83")
17+
add_versions("20220323", "f8d7d30a5eb50e9e9769d8c544644e6d25c822913e0944b21c94b75421942085")
1618
elseif os.arch():find("arm.*") then
1719
set_urls("https://github.com/mstorsjo/llvm-mingw/releases/download/$(version)/llvm-mingw-$(version)-ucrt-armv7.zip")
1820
add_versions("20201020", "c086562124fc79e157d2cb01eacd7bd3e937d488bacdac138ee45ed6a39d3b6c")
1921
add_versions("20211002", "a37c4cbd4b7c53f7c931d4ca84e1f9847315b528129310fefeafae48edd65407")
22+
add_versions("20220323", "1008e8eeef74194c4662bef5a2afa4691a31d894fdad8ebf2ddc27dbf6e98c86")
2023
else
2124
set_urls("https://github.com/mstorsjo/llvm-mingw/releases/download/$(version)/llvm-mingw-$(version)-ucrt-x86_64.zip")
2225
add_versions("20201020", "8f619911b61554d0394537305157f63284fab949ad0abed137b84440689fa77e")
2326
add_versions("20211002", "cd0c506789eb2fd3179836e55a7dd13ceade810ec094aeec28fa5a531423e7f8")
27+
add_versions("20220323", "3014a95e4ec4d5c9d31f52fbd6ff43174a0d9c422c663de7f7be8c2fcc9d837a")
2428
end
2529
elseif is_host("linux") then
2630
-- Built on Ubuntu but hopefully run on other distributions
2731
if os.arch() == "x86_64" then
2832
set_urls("https://github.com/mstorsjo/llvm-mingw/releases/download/$(version)/llvm-mingw-$(version)-ucrt-ubuntu-18.04-x86_64.tar.xz")
2933
add_versions("20211002", "30e9400783652091d9278ce21e5c170d01a5f44e4f1a25717b63cd9ad9fbe13b")
34+
add_versions("20220323", "6d69ab28a3a9a2b7159178ff11cae8545fd44c9343573900fcf60434539695d8")
3035
elseif os.arch() == "arm64" then
3136
set_urls("https://github.com/mstorsjo/llvm-mingw/releases/download/$(version)/llvm-mingw-$(version)-ucrt-ubuntu-18.04-aarch64.tar.xz")
3237
add_versions("20211002", "9a26079af16713894e8a11c77e38896c4040b98daceca4408333bd1053c1a3d5")
38+
add_versions("20220323", "89d4dc4515d7203b658f8257b19943a4055831a3738ed79bc179a1abcc83cde6")
3339
end
3440
end
3541

packages/o/onednn/xmake.lua

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package("onednn")
2+
3+
set_homepage("https://oneapi-src.github.io/oneDNN/")
4+
set_description("oneAPI Deep Neural Network Library")
5+
set_license("Apache-2.0")
6+
7+
add_urls("https://github.com/oneapi-src/oneDNN/archive/refs/tags/$(version).tar.gz",
8+
"https://github.com/oneapi-src/oneDNN.git")
9+
add_versions("v2.5.4", "a463ab05129e3e307333ff49d637568fa6ae1fb81742f40918b618e8ef714987")
10+
11+
add_configs("shared", {description = "Build shared library.", default = true, type = "boolean"})
12+
add_configs("cpu_runtime", {description = "Defines the threading runtime for CPU engines.", default = "seq", type = "string", values = {"none", "omp", "tbb", "seq", "threadpool", "dpcpp"}})
13+
add_configs("gpu_runtime", {description = "Defines the offload runtime for GPU engines.", default = "none", type = "string", values = {"none", "ocl", "dpcpp"}})
14+
15+
add_deps("cmake")
16+
on_load("windows|x64", "macosx", "linux|x86_64", function (package)
17+
local cpu_runtime = package:config("cpu_runtime")
18+
if cpu_runtime == "omp" then
19+
package:add("deps", "openmp")
20+
elseif cpu_runtime == "tbb" then
21+
package:add("deps", "tbb")
22+
end
23+
local gpu_runtime = package:config("gpu_runtime")
24+
if gpu_runtime == "ocl" then
25+
package:add("deps", "opencl")
26+
end
27+
end)
28+
29+
on_install("windows|x64", "macosx", "linux|x86_64", function (package)
30+
local configs = {"-DDNNL_BUILD_TESTS=OFF", "-DDNNL_BUILD_EXAMPLES=OFF"}
31+
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
32+
table.insert(configs, "-DDNNL_LIBRARY_TYPE=" .. (package:config("shared") and "SHARED" or "STATIC"))
33+
import("package.tools.cmake").install(package, configs)
34+
end)
35+
36+
on_test(function (package)
37+
assert(package:check_cxxsnippets({test = [[
38+
#include "oneapi/dnnl/dnnl.hpp"
39+
void test() {
40+
dnnl::engine eng(dnnl::engine::kind::cpu, 0);
41+
}
42+
]]}, {configs = {languages = "c++14"}}))
43+
end)

0 commit comments

Comments
 (0)