Skip to content

Commit

Permalink
update openblas, metis and rapidjson (#3124)
Browse files Browse the repository at this point in the history
* update openblas

* update metis

* update rapidjson

* fix metis

* revert stat.h
  • Loading branch information
xq114 authored Jan 18, 2024
1 parent 4c1a452 commit 4493a9e
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 11 deletions.
61 changes: 61 additions & 0 deletions packages/m/metis/patches/5.2.1/gklib.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a15d19a..7fb5cd0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,11 +3,7 @@ project(METIS C)

set(SHARED FALSE CACHE BOOL "build a shared library")

-if(MSVC)
- set(METIS_INSTALL FALSE)
-else()
- set(METIS_INSTALL TRUE)
-endif()
+set(METIS_INSTALL TRUE)

# Configure libmetis library.
if(SHARED)
@@ -16,7 +12,7 @@ else()
set(METIS_LIBRARY_TYPE STATIC)
endif(SHARED)

-include(./conf/gkbuild.cmake)
+include(${GKLIB_PATH}/GKlibSystem.cmake)

# METIS' custom options
#option(IDX64 "enable 64 bit ints" OFF)
@@ -37,8 +33,8 @@ include(./conf/gkbuild.cmake)

# Add include directories.
# i.e., the -I equivalent
-include_directories(build/xinclude)
-include_directories(${GKLIB_PATH}/include)
+include_directories(include)
+include_directories(${GKLIB_PATH})
include_directories(${CMAKE_INSTALL_PREFIX}/include)

# List of paths that the compiler will search for library files.
@@ -47,6 +43,5 @@ link_directories(${GKLIB_PATH}/lib)
link_directories(${CMAKE_INSTALL_PREFIX}/lib)

# Recursively look for CMakeLists.txt in subdirs.
-add_subdirectory("build/xinclude")
+add_subdirectory("include")
add_subdirectory("libmetis")
-add_subdirectory("programs")
diff --git a/libmetis/CMakeLists.txt b/libmetis/CMakeLists.txt
index fc6cec6..e713c2c 100644
--- a/libmetis/CMakeLists.txt
+++ b/libmetis/CMakeLists.txt
@@ -5,7 +5,10 @@ include_directories(.)
file(GLOB metis_sources *.c)

# Build libmetis.
-add_library(metis ${METIS_LIBRARY_TYPE} ${metis_sources})
+if (MSVC)
+ set(GKlib_sources ${GKlib_sources} ${GKLIB_PATH}/win32/adapt.c)
+endif (MSVC)
+add_library(metis ${METIS_LIBRARY_TYPE} ${metis_sources} ${GKlib_sources})

if(METIS_INSTALL)
install(TARGETS metis
29 changes: 19 additions & 10 deletions packages/m/metis/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,33 @@ package("metis")

set_homepage("http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
set_description("Serial Graph Partitioning and Fill-reducing Matrix Ordering")
set_license("Apache-2.0")

add_urls("https://github.com/xq114/METIS/archive/v$(version).tar.gz")
add_versions("5.1.1", "945d381d3b50ca70ac93f0daf32c80e6f16f11514879d5ff1438aa82c20a0ba5")
add_urls("https://github.com/KarypisLab/METIS/archive/refs/tags/$(version).tar.gz")
add_versions("v5.2.1", "1a4665b2cd07edc2f734e30d7460afb19c1217c2547c2ac7bf6e1848d50aff7a")

add_patches("5.2.1", "patches/5.2.1/gklib.patch", "63e5035241f23ee664800ec1811ea8baa69895c71ec007ab1a95103a290c11eb")
add_resources("5.2.1", "gklib", "https://github.com/KarypisLab/GKlib.git", "8bd6bad750b2b0d90800c632cf18e8ee93ad72d7")

add_deps("cmake")
add_configs("long_index", {description = "Use 64-bit uint as index.", default = false, type = "boolean"})
add_configs("double", {description = "Use double precision floats.", default = true, type = "boolean"})

add_deps("cmake")
if is_plat("linux") then
add_syslinks("m")
end
on_install("windows", "macosx", "linux", function (package)
if package:config("long_index") then
io.gsub(path.join("include", "metis.h"), "define IDXTYPEWIDTH %d+", "define IDXTYPEWIDTH 64")
end
if package:config("double") then
io.gsub(path.join("include", "metis.h"), "define REALTYPEWIDTH %d+", "define REALTYPEWIDTH 64")
end
local idx_width = package:config("long_index") and 64 or 32
io.gsub(path.join("include", "metis.h"), "//#define IDXTYPEWIDTH %d+", "#define IDXTYPEWIDTH " .. idx_width)
local real_width = package:config("double") and 64 or 32
io.gsub(path.join("include", "metis.h"), "//#define REALTYPEWIDTH %d+", "#define REALTYPEWIDTH " .. real_width)
io.replace(path.join(package:resourcefile("gklib"), "gk_arch.h"), "gk_ms_stdint.h", "stdint.h", {plain = true})
io.replace(path.join(package:resourcefile("gklib"), "gk_arch.h"), "gk_ms_inttypes.h", "inttypes.h", {plain = true})

local configs = {}
table.insert(configs, "-DSHARED=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DDEBUG=" .. (package:debug() and "ON" or "OFF"))
table.insert(configs, "-DSHARED=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DGKLIB_PATH=" .. package:resourcefile("gklib"):gsub("\\", "/"))
import("package.tools.cmake").install(package, configs)
end)

Expand Down
3 changes: 3 additions & 0 deletions packages/o/openblas/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package("openblas")
add_versions("0.3.21", "ecf1853ce92696fb8531c941c50e983ea8fa673c118a87298a075c045d52a3ca")
add_versions("0.3.23", "e3a82e60db8d6197228790567e7cf74f2c421a65b29f848977a07b5457debdaa")
add_versions("0.3.24", "6335128ee7117ea2dd2f5f96f76dafc17256c85992637189a2d5f6da0c608163")
add_versions("0.3.26", "859c510a962a30ef1b01aa93cde26fdb5fb1050f94ad5ab2802eba3731935e06")
elseif is_arch("x86") then
add_urls("https://github.com/OpenMathLib/OpenBLAS/releases/download/v$(version)/OpenBLAS-$(version)-x86.zip")
add_versions("0.3.15", "bcde933737b477813eaac290de5cb8756d3b42199e8ef5f44b23ae5f06fe0834")
Expand All @@ -26,6 +27,7 @@ package("openblas")
add_versions("0.3.20", "0ee249246af7ce2fd66f86cb9350f5f5a7b97496b9b997bfd0680048dd194158")
add_versions("0.3.21", "936416a0fec5506af9cf040c9de5c7edbd0ff18b53431799d1a43e47f9eba64e")
add_versions("0.3.24", "92f8e0c73e1eec3c428b210fbd69b91e966f8cf1f998f3b60a52f024b2bf9d27")
add_versions("0.3.26", "9c3d48c3c21cd2341d642a63ee8a655205587befdab46462df7e0104d6771f67")
end

add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true})
Expand All @@ -41,6 +43,7 @@ package("openblas")
add_versions("0.3.21", "f36ba3d7a60e7c8bcc54cd9aaa9b1223dd42eaf02c811791c37e8ca707c241ca")
add_versions("0.3.23", "5d9491d07168a5d00116cdc068a40022c3455bf9293c7cb86a65b1054d7e5114")
add_versions("0.3.24", "ceadc5065da97bd92404cac7254da66cc6eb192679cf1002098688978d4d5132")
add_versions("0.3.26", "4e6e4f5cb14c209262e33e6816d70221a2fe49eb69eaf0a06f065598ac602c68")

add_configs("fortran", {description = "Compile with fortran enabled.", default = is_plat("linux"), type = "boolean"})
add_configs("openmp", {description = "Compile with OpenMP enabled.", default = not is_plat("macosx"), type = "boolean"})
Expand Down
3 changes: 2 additions & 1 deletion packages/r/rapidjson/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package("rapidjson")

set_homepage("https://github.com/Tencent/rapidjson")
set_description("RapidJSON is a JSON parser and generator for C++.")
set_license("MIT")

set_urls("https://github.com/Tencent/rapidjson/archive/$(version).zip",
"https://github.com/Tencent/rapidjson.git")

add_versions("2023.12.6", "6089180ecb704cb2b136777798fa1be303618975")
add_versions("2022.7.20", "27c3a8dc0e2c9218fe94986d249a12b5ed838f1d")
add_versions("v1.1.0", "8e00c38829d6785a2dfb951bb87c6974fa07dfe488aa5b25deec4b8bc0f6a3ab")
-- This commit is used in arrow 7.0.0 https://github.com/apache/arrow/blob/release-7.0.0/cpp/thirdparty/versions.txt#L80
Expand Down

0 comments on commit 4493a9e

Please sign in to comment.