From d09cd552c3ba4e88a36343c443340683c1cbde04 Mon Sep 17 00:00:00 2001 From: Hoildkv <42310255+xq114@users.noreply.github.com> Date: Fri, 20 Aug 2021 21:13:20 +0800 Subject: [PATCH] add libfuse, libfabric, ucx, mpich (#579) * update autoconf * update leptonica * add libxnvctrl * add libfuse * add libfabric * add ucx * add mpich --- packages/a/autoconf/xmake.lua | 15 ++++++----- packages/g/gmp/xmake.lua | 6 ++++- packages/l/leptonica/xmake.lua | 1 + packages/l/libfabric/xmake.lua | 27 +++++++++++++++++++ packages/l/libfuse/xmake.lua | 24 +++++++++++++++++ packages/l/libxnvctrl/xmake.lua | 40 +++++++++++++++++++++++++++ packages/m/m4/xmake.lua | 2 ++ packages/m/mpich/xmake.lua | 48 +++++++++++++++++++++++++++++++++ packages/u/ucx/xmake.lua | 31 +++++++++++++++++++++ 9 files changed, 187 insertions(+), 7 deletions(-) create mode 100644 packages/l/libfabric/xmake.lua create mode 100644 packages/l/libfuse/xmake.lua create mode 100644 packages/l/libxnvctrl/xmake.lua create mode 100644 packages/m/mpich/xmake.lua create mode 100644 packages/u/ucx/xmake.lua diff --git a/packages/a/autoconf/xmake.lua b/packages/a/autoconf/xmake.lua index b849d027a..a4af834f6 100644 --- a/packages/a/autoconf/xmake.lua +++ b/packages/a/autoconf/xmake.lua @@ -4,12 +4,15 @@ package("autoconf") set_homepage("https://www.gnu.org/software/autoconf/autoconf.html") set_description("An extensible package of M4 macros that produce shell scripts to automatically configure software source code packages.") - if is_host("macosx", "linux") then - add_urls("http://ftp.gnu.org/gnu/autoconf/autoconf-$(version).tar.gz", - "https://mirrors.ustc.edu.cn/gnu/autoconf/autoconf-$(version).tar.gz", - "git://git.sv.gnu.org/autoconf") - add_versions("2.69", "954bd69b391edc12d6a4a51a2dd1476543da5c6bbf05a95b59dc0dd6fd4c2969") - add_versions("2.68", "eff70a2916f2e2b3ed7fe8a2d7e63d72cf3a23684b56456b319c3ebce0705d99") + add_urls("http://ftp.gnu.org/gnu/autoconf/autoconf-$(version).tar.gz", + "https://mirrors.ustc.edu.cn/gnu/autoconf/autoconf-$(version).tar.gz", + "git://git.sv.gnu.org/autoconf") + add_versions("2.68", "eff70a2916f2e2b3ed7fe8a2d7e63d72cf3a23684b56456b319c3ebce0705d99") + add_versions("2.69", "954bd69b391edc12d6a4a51a2dd1476543da5c6bbf05a95b59dc0dd6fd4c2969") + add_versions("2.71", "431075ad0bf529ef13cb41e9042c542381103e80015686222b8a9d4abef42a1c") + + if is_host("linux") then + add_extsources("apt::autoconf") end add_deps("m4") diff --git a/packages/g/gmp/xmake.lua b/packages/g/gmp/xmake.lua index cec715e63..7ac9d82f6 100644 --- a/packages/g/gmp/xmake.lua +++ b/packages/g/gmp/xmake.lua @@ -7,7 +7,11 @@ package("gmp") add_urls("https://gmplib.org/download/gmp/gmp-$(version).tar.xz") add_versions("6.2.1", "fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2") - add_deps("autoconf") + if is_plat("linux") then + add_extsources("apt::libgmp-dev") + end + + add_deps("m4") on_install("macosx", "linux", function (package) local configs = {} diff --git a/packages/l/leptonica/xmake.lua b/packages/l/leptonica/xmake.lua index a94c73431..be33a5bd9 100644 --- a/packages/l/leptonica/xmake.lua +++ b/packages/l/leptonica/xmake.lua @@ -7,6 +7,7 @@ package("leptonica") add_urls("https://github.com/DanBloomberg/leptonica/archive/$(version).tar.gz", "https://github.com/DanBloomberg/leptonica.git") add_versions("1.80.0", "3952b974ec057d24267aae48c54bca68ead8275604bf084a73a4b953ff79196e") + add_versions("1.81.1", "e9dd2100194843a20bbb980ad8b94610558d47f623861bc80ac967f2d2ecb879") add_deps("cmake") add_deps("libwebp", {configs = {img2webp = true, webpmux = true}}) diff --git a/packages/l/libfabric/xmake.lua b/packages/l/libfabric/xmake.lua new file mode 100644 index 000000000..29f226f74 --- /dev/null +++ b/packages/l/libfabric/xmake.lua @@ -0,0 +1,27 @@ +package("libfabric") + + set_homepage("https://ofiwg.github.io/libfabric/") + set_description("Open Fabric Interfaces") + set_license("BSD-2-Clause") + + add_urls("https://github.com/ofiwg/libfabric/releases/download/v$(version)/libfabric-$(version).tar.bz2") + add_versions("1.13.0", "0c68264ae18de5c31857724c754023351614330bd61a50b40cef2b5e8f63ab28") + + if is_plat("linux") then + add_syslinks("pthread", "dl", "rt") + add_extsources("apt::libfabric-dev") + end + + on_install("macosx", "linux", function (package) + local configs = {} + table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) + table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes")) + if package:config("pic") ~= false then + table.insert(configs, "--with-pic") + end + import("package.tools.autoconf").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("fi_getinfo", {includes = "rdma/fabric.h"})) + end) diff --git a/packages/l/libfuse/xmake.lua b/packages/l/libfuse/xmake.lua new file mode 100644 index 000000000..d18c90c8b --- /dev/null +++ b/packages/l/libfuse/xmake.lua @@ -0,0 +1,24 @@ +package("libfuse") + + set_homepage("https://github.com/libfuse/libfuse") + set_description("FUSE (Filesystem in Userspace) is an interface for userspace programs to export a filesystem to the Linux kernel.") + set_license("GPL-2.0") + + add_urls("https://github.com/libfuse/libfuse/releases/download/fuse-$(version)/fuse-$(version).tar.xz") + add_versions("3.10.4", "9365b74fd8471caecdb3cc5adf25a821f70a931317ee9103d15bd39089e3590d") + + if is_plat("linux") then + add_extsources("apt::fuse3") + add_syslinks("pthread", "dl", "rt") + end + + add_deps("meson") + on_install("linux", function (package) + local configs = {"-Dtests=false", "-Dexamples=false", "-Dutils=false"} + table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) + import("package.tools.meson").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("fuse_version", {configs = {defines = {"FUSE_USE_VERSION=30"}}, includes = "fuse3/fuse.h"})) + end) diff --git a/packages/l/libxnvctrl/xmake.lua b/packages/l/libxnvctrl/xmake.lua new file mode 100644 index 000000000..90dc0ea0e --- /dev/null +++ b/packages/l/libxnvctrl/xmake.lua @@ -0,0 +1,40 @@ +package("libxnvctrl") + + set_homepage("https://www.nvidia.com/en-us/drivers/unix/") + set_description("NVIDIA driver control panel") + + if is_plat("linux") then + add_extsources("apt::libxnvctrl-dev") + end + + on_fetch("linux", function (package, opt) + if opt.system then + import("lib.detect.find_path") + import("lib.detect.find_library") + + -- init search paths + local paths = { + "/usr" + } + + -- find library + local result = {links = {}, linkdirs = {}, includedirs = {}} + local arch = package:is_arch("x86_64") and "x86_64" or "x86" + local archsuffix = arch .. "-linux-gnu" + local linkinfo = find_library("XNVCtrl", paths, {suffixes = {"lib", path.join("lib", archsuffix)}}) + if linkinfo then + table.insert(result.linkdirs, linkinfo.linkdir) + table.insert(result.links, "XNVCtrl") + end + result.linkdirs = table.unique(result.linkdirs) + + -- find headers + local path = find_path("NVCtrl/NVCtrl.h", paths, {suffixes = "include"}) + if path then + table.insert(result.includedirs, path) + end + if #result.includedirs > 0 and #result.linkdirs > 0 then + return result + end + end + end) diff --git a/packages/m/m4/xmake.lua b/packages/m/m4/xmake.lua index 15ff5cc5f..9b2928ff6 100644 --- a/packages/m/m4/xmake.lua +++ b/packages/m/m4/xmake.lua @@ -13,6 +13,8 @@ package("m4") -- fix crash from usage of %n in dynamic format strings on High Sierra -- patch credit to Jeremy Huddleston Sequoia add_patches("1.4.18", path.join(os.scriptdir(), "patches", "1.4.18", "secure_snprintf.patch"), "c0a408fbffb7255fcc75e26bd8edab116fc81d216bfd18b473668b7739a4158e") + elseif is_host("linux") then + add_extsources("apt::m4") end on_install("@macosx", "@linux", "@msys", "@cygwin", function (package) diff --git a/packages/m/mpich/xmake.lua b/packages/m/mpich/xmake.lua new file mode 100644 index 000000000..9b929141b --- /dev/null +++ b/packages/m/mpich/xmake.lua @@ -0,0 +1,48 @@ +package("mpich") + + set_homepage("https://www.mpich.org/") + set_description("MPICH is a high performance and widely portable implementation of the Message Passing Interface (MPI) standard.") + + add_urls("http://www.mpich.org/static/downloads/$(version)/mpich-$(version).tar.gz") + add_versions("3.4.2", "5c19bea8b84e8d74cca5f047e82b147ff3fba096144270e3911ad623d6c587bf") + + add_configs("device", {description = "Specify the communication device for MPICH.", default = "ofi", type = "string", values = {"ofi", "ucx"}}) + add_configs("x11", {description = "Use the X Window System.", default = false, type = "boolean"}) + + if is_plat("linux") then + add_extsources("apt::libmpich-dev") + add_syslinks("pthread", "dl", "rt") + end + + add_deps("hwloc") + on_load("macosx", "linux", function (package) + if package:config("x11") then + package:add("deps", "libx11") + package:add("deps", "libxnvctrl", {system = true, optional = true}) + end + end) + + on_install("macosx", "linux", function (package) + local configs = {"--disable-fortran", + "--without-slurm", + "--without-xpmem", + "--without-hcoll", + "--without-blcr", + "--without-papi", + "--without-pmix"} + table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) + table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes")) + if package:config("pic") ~= false then + table.insert(configs, "--with-pic") + end + table.insert(configs, "--with-device=ch4:" .. package:config("device")) + table.insert(configs, "--with-hwloc-prefix=" .. package:dep("hwloc"):installdir()) + table.insert(configs, "--with-x=" .. (package:config("x11") and "yes" or "no")) + import("package.tools.autoconf").install(package, configs) + package:addenv("PATH", "bin") + end) + + on_test(function (package) + os.vrun("mpicc --version") + assert(package:has_cfuncs("MPI_Init", {includes = "mpi.h"})) + end) diff --git a/packages/u/ucx/xmake.lua b/packages/u/ucx/xmake.lua new file mode 100644 index 000000000..24739a710 --- /dev/null +++ b/packages/u/ucx/xmake.lua @@ -0,0 +1,31 @@ +package("ucx") + + set_homepage("https://openucx.org/") + set_description("Unified Communication X") + set_license("BSD-3-Clause") + + add_urls("https://github.com/openucx/ucx/releases/download/v$(version)/ucx-$(version).tar.gz") + add_versions("1.11.0", "b7189b69fe0e16e3c03784ef674e45687a9c520750bd74a45125c460ede37647") + + add_configs("cuda", {description = "Enable CUDA support.", default = false, type = "boolean"}) + + on_load("linux", function (package) + if package:config("cuda") then + package:add("deps", "cuda") + end + end) + + on_install("linux", function (package) + local configs = {"--disable-doxygen-doc", "--without-java", "--without-rte", "--without-fuse3", "--without-gdrcopy", "--without-rdmacm", "--without-knem", "--without-xpmem", "--without-ugni"} + if package:config("cuda") then + local cuda = package:dep("cuda"):fetch() + table.insert(configs, "--with-cuda=" .. path.directory(cuda.sysincludedirs[1])) + else + table.insert(configs, "--without-cuda") + end + import("package.tools.autoconf").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("ucp_get_version_string", {includes = "ucp/api/ucp.h"})) + end)