scotch: enable some platform

pull/5293/head
star9029 4 months ago
parent 6b600a1a0e
commit a48fb5fdc9
  1. 98
      packages/s/scotch/patches/7.0.5/cmake.patch
  2. 18
      packages/s/scotch/xmake.lua

@ -0,0 +1,98 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ce3c5ba..b05667f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,7 +42,7 @@
############################################################
cmake_minimum_required(VERSION 3.10)
-project(SCOTCH LANGUAGES C Fortran)
+project(SCOTCH LANGUAGES C)
# Add module directory
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
diff --git a/src/esmumps/CMakeLists.txt b/src/esmumps/CMakeLists.txt
index 7d2fb92..fa2ca12 100644
--- a/src/esmumps/CMakeLists.txt
+++ b/src/esmumps/CMakeLists.txt
@@ -135,6 +135,7 @@ install(TARGETS esmumps
EXPORT esmumpsTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
# Dummy PTEsMUMPS library file
@@ -169,4 +170,5 @@ install(TARGETS ptesmumps
EXPORT ptesmumpsTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
diff --git a/src/libscotch/CMakeLists.txt b/src/libscotch/CMakeLists.txt
index f314d3a..e539ab9 100644
--- a/src/libscotch/CMakeLists.txt
+++ b/src/libscotch/CMakeLists.txt
@@ -359,7 +359,7 @@ set(SCOTCH_C_SOURCES
library_context_graph_f.c
library_context_f.c
#library_errcom.c
- #library_error.c
+ library_error.c
#library_error_exit.c
library_f.h
library_geom.c
@@ -833,6 +833,7 @@ foreach(_target ${TARGETS_LIST})
EXPORT ${_target}Targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
if (BUILD_PTSCOTCH)
@@ -847,6 +848,7 @@ foreach(_target ${TARGETS_LIST})
EXPORT pt${_target}Targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif()
diff --git a/src/libscotchmetis/CMakeLists.txt b/src/libscotchmetis/CMakeLists.txt
index e08fe6a..ac8b089 100644
--- a/src/libscotchmetis/CMakeLists.txt
+++ b/src/libscotchmetis/CMakeLists.txt
@@ -127,13 +127,15 @@ foreach(version 3 5)
EXPORT scotchmetisTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
else()
install(TARGETS scotchmetisv${version}
COMPONENT libscotch
EXPORT scotchmetisTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
endforeach(version 3 5)
@@ -204,13 +206,15 @@ if(BUILD_PTSCOTCH)
EXPORT ptscotchparmetisTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
else()
install(TARGETS ptscotchparmetisv${version}
COMPONENT libptscotch
EXPORT ptscotchparmetisTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
endforeach(version 3)
endif(BUILD_PTSCOTCH)

@ -1,23 +1,27 @@
package("scotch")
set_homepage("https://www.labri.fr/perso/pelegrin/scotch/")
set_description("Scotch: a software package for graph and mesh/hypergraph partitioning, graph clustering, and sparse matrix ordering")
add_urls("https://gitlab.inria.fr/scotch/scotch/-/archive/$(version)/scotch-$(version).zip",
"https://gitlab.inria.fr/scotch/scotch.git")
add_versions("v6.1.1", "21d001c390ec63ac60f987b9921f33cc1967b41cf07567e22cbf3253cda8962a")
add_versions("v7.0.5", "fd52e97844115dce069220bacbfb45fccdf83d425614b02b67b44cedf9d72640")
add_patches("7.0.5", "patches/7.0.5/cmake.patch", "5104181d78dcf31779ab70cae61bb80fa2f6f836ce5d73628ef9b2d074fb8d8c")
add_configs("zlib", {description = "Use ZLIB compression format.", default = true, type = "boolean"})
add_configs("lzma", {description = "Use LZMA compression format.", default = false, type = "boolean"})
add_configs("bz2", {description = "Use BZ2 compression format.", default = false, type = "boolean"})
if is_plat("linux") then
if is_plat("linux", "bsd") then
add_syslinks("pthread")
end
add_links("ptesmumps", "esmumps", "scotch", "scotcherr", "scotcherrexit", "scotchmetis", "scotchmetisv5", "scotchmetisv3")
on_load(function (package)
if package:version():ge("7.0.0") then
if package:gitref() or package:version():ge("7.0.0") then
package:add("deps", "cmake")
package:add("deps", "flex", "bison")
package:add("deps", "gfortran", {kind = "binary"})
@ -35,16 +39,18 @@ package("scotch")
end
end)
on_install("macosx", "linux", function (package)
if package:version():ge("7.0.0") then
on_install(function (package)
if package:gitref() or package:version():ge("7.0.0") then
local configs = {"-DENABLE_TESTS=OFF", "-DBUILD_PTSCOTCH=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DUSE_ZLIB=" .. (package:config("zlib") and "ON" or "OFF"))
table.insert(configs, "-DUSE_LZMA=" .. (package:config("lzma") and "ON" or "OFF"))
table.insert(configs, "-DUSE_BZ2=" .. (package:config("bz2") and "ON" or "OFF"))
if package:is_plat("windows") and package:config("shared") then
table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON")
end
import("package.tools.cmake").install(package, configs)
elseif package:is_plat("macosx", "linux") then
import("package.tools.make")

Loading…
Cancel
Save