update libtorch (#669)

* update libtorch

* update harfbuzz

* fix matplot++
pull/670/head
Hoildkv 3 years ago committed by GitHub
parent 2f39c823fa
commit 353ee495e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/f/faad2/xmake.lua
  2. 3
      packages/f/field3d/xmake.lua
  3. 37
      packages/h/harfbuzz/xmake.lua
  4. 21
      packages/l/libtorch/xmake.lua
  5. 5
      packages/m/matplotplusplus/xmake.lua
  6. 1
      packages/m/meson/xmake.lua

@ -14,7 +14,7 @@ package("faad2")
end
on_install("windows", function (package)
if is_plat("windows") then
if package:is_plat("windows") then
local vs = import("core.tool.toolchain").load("msvc"):config("vs")
if tonumber(vs) < 2019 then
raise("Your compiler is too old to use this library.")

@ -13,6 +13,7 @@ package("field3d")
add_deps("hdf5", "openexr 2.x")
if is_plat("windows") then
add_defines("WIN32")
add_syslinks("shlwapi")
end
@ -23,7 +24,7 @@ package("field3d")
end)
on_install("windows", "macosx", "linux", function (package)
if is_plat("windows") then
if package:is_plat("windows") then
local vs = import("core.tool.toolchain").load("msvc"):config("vs")
if tonumber(vs) < 2019 then
raise("Your compiler is too old to use this library.")

@ -8,31 +8,46 @@ package("harfbuzz")
"https://github.com/harfbuzz/harfbuzz.git")
add_versions("2.8.1", "b3f17394c5bccee456172b2b30ddec0bb87e9c5df38b4559a973d14ccd04509d")
add_versions("2.9.0", "bf5d5bad69ee44ff1dd08800c58cb433e9b3bf4dad5d7c6f1dec5d1cf0249d04")
add_versions("3.0.0", "55f7e36671b8c5569b6438f80efed2fd663298f785ad2819e115b35b5587ef69")
add_configs("icu", {description = "Use the ICU library.", default = false, type = "boolean"})
add_configs("icu", {description = "Enable ICU library unicode functions.", default = false, type = "boolean"})
add_configs("freetype", {description = "Enable freetype interop helpers.", default = true, type = "boolean"})
add_deps("meson")
if not is_plat("windows") then
add_deps("freetype")
end
add_includedirs("include", "include/harfbuzz")
on_load("windows", "linux", "macosx", function (package)
if package:config("icu") then
package:add("deps", "icu4c")
end
if package:config("freetype") then
package:add("deps", "freetype")
end
end)
on_install("windows", "linux", "macosx", function (package)
local configs = {"-Dtests=disabled", "-Ddocs=disabled", "-Dbenchmark=disabled", "-Dcairo=disabled", "-Dfontconfig=disabled", "-Dglib=disabled", "-Dgobject=disabled"}
import("package.tools.meson")
local configs = {"-Dtests=disabled", "-Ddocs=disabled", "-Dbenchmark=disabled", "-Dcairo=disabled", "-Dglib=disabled", "-Dgobject=disabled"}
table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static"))
if package:config("icu") then
table.insert(configs, "-Dicu=enabled")
end
table.insert(configs, "-Dicu=" .. (package:config("icu") and "enabled" or "disabled"))
table.insert(configs, "-Dfreetype=" .. (package:config("freetype") and "enabled" or "disabled"))
local envs = meson.buildenvs(package)
if package:is_plat("windows") then
table.insert(configs, "-Dfreetype=disabled")
for _, dep in ipairs(package:orderdeps()) do
local fetchinfo = dep:fetch()
if fetchinfo then
for _, includedir in ipairs(fetchinfo.includedirs or fetchinfo.sysincludedirs) do
envs.INCLUDE = (envs.INCLUDE or "") .. path.envsep() .. includedir
end
for _, linkdir in ipairs(fetchinfo.linkdirs) do
envs.LIB = (envs.LIB or "") .. path.envsep() .. linkdir
end
end
end
end
import("package.tools.meson").install(package, configs)
meson.install(package, configs, {envs = envs})
end)
on_test(function (package)
assert(package:has_cfuncs("hb_buffer_add_utf8", {includes = "harfbuzz/hb.h"}))
assert(package:has_cfuncs("hb_buffer_add_utf8", {includes = "hb.h"}))
end)

@ -7,9 +7,11 @@ package("libtorch")
add_urls("https://github.com/pytorch/pytorch.git")
add_versions("v1.8.0", "37c1f4a7fef115d719104e871d0cf39434aa9d56")
add_versions("v1.8.1", "56b43f4fec1f76953f15a627694d4bba34588969")
add_versions("v1.8.2", "e0495a7aa104471d95dc85a1b8f6473fbcc427a8")
add_versions("v1.9.0", "d69c22dd61a2f006dcfe1e3ea8468a3ecaf931aa")
add_versions("v1.9.1", "dfbd030854359207cb3040b864614affeace11ce")
add_patches("v1.9.0", path.join(os.scriptdir(), "patches", "1.9.0", "gcc11.patch"), "4191bb3296f18f040c230d7c5364fb160871962d6278e4ae0f8bc481f27d8e4b")
add_patches("1.9.x", path.join(os.scriptdir(), "patches", "1.9.0", "gcc11.patch"), "4191bb3296f18f040c230d7c5364fb160871962d6278e4ae0f8bc481f27d8e4b")
add_configs("python", {description = "Build python interface.", default = false, type = "boolean"})
add_configs("ninja", {description = "Use ninja as build tool.", default = true, type = "boolean"})
@ -46,6 +48,13 @@ package("libtorch")
on_install("windows|x64", "macosx", "linux", function (package)
import("package.tools.cmake")
if package:is_plat("windows") then
local vs = import("core.tool.toolchain").load("msvc"):config("vs")
if tonumber(vs) < 2019 then
raise("Your compiler is too old to use this library.")
end
end
-- tackle link flags
local has_cuda = package:dep("cuda"):exists() and package:dep("nvtx"):exists()
local libnames = {"torch", "torch_cpu"}
@ -72,10 +81,12 @@ package("libtorch")
package:add("links", lib)
end
end
package:add("links", "fbgemm")
package:add("links", "asmjit")
package:add("links", "cpuinfo")
package:add("links", "clog")
if not package:config("shared") then
for _, lib in ipairs({"nnpack", "pytorch_qnnpack", "qnnpack", "XNNPACK", "caffe2_protos", "protobuf-lite", "protobuf", "protoc", "onnx", "onnx_proto", "foxi_loader", "pthreadpool", "eigen_blas", "fbgemm", "cpuinfo", "clog", "dnnl", "mkldnn", "sleef", "asmjit", "fmt"}) do
package:add("links", lib)
end
end
package:add("links", "kineto")
-- some patches to the third-party cmake files
io.replace("third_party/fbgemm/CMakeLists.txt", "PRIVATE FBGEMM_STATIC", "PUBLIC FBGEMM_STATIC", {plain = true})

@ -18,6 +18,9 @@ package("matplotplusplus")
for config, dep in pairs(configdeps) do
add_configs(config, {description = "Enable " .. config .. " support.", default = (config == "zlib"), type = "boolean"})
end
if is_plat("windows") then
add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
end
add_deps("cmake")
add_deps("nodesoup")
@ -33,7 +36,7 @@ package("matplotplusplus")
end)
on_install("windows", "macosx", "linux", function (package)
if is_plat("windows") then
if package:is_plat("windows") then
local vs = import("core.tool.toolchain").load("msvc"):config("vs")
if tonumber(vs) < 2019 then
raise("Your compiler is too old to use this library.")

@ -7,6 +7,7 @@ package("meson")
add_urls("https://github.com/mesonbuild/meson/releases/download/$(version)/meson-$(version).tar.gz",
"https://github.com/mesonbuild/meson.git")
add_versions("0.59.2", "13dee549a7ba758b7e33ce7719f28d1d337a98d10d378a4779ccc996f5a2fc49")
add_versions("0.59.1", "db586a451650d46bbe10984a87b79d9bcdc1caebf38d8e189f8848f8d502356d")
add_versions("0.58.1", "3144a3da662fcf79f1e5602fa929f2821cba4eba28c2c923fe0a7d3e3db04d5d")
add_versions("0.58.0", "f4820df0bc969c99019fd4af8ca5f136ee94c63d8a5ad67e7eb73bdbc9182fdd")

Loading…
Cancel
Save