5 Commits

4 changed files with 53 additions and 192 deletions

View File

@@ -1,4 +0,0 @@
<multibuild>
<package>serial</package>
<package>gnu-hpc</package>
</multibuild>

20
metis-min-cmake-3.5.patch Normal file
View File

@@ -0,0 +1,20 @@
Index: metis-5.1.0/CMakeLists.txt
===================================================================
--- metis-5.1.0.orig/CMakeLists.txt
+++ metis-5.1.0/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.5)
project(METIS)
set(GKLIB_PATH "${CMAKE_SOURCE_DIR}/GKlib" CACHE PATH "path to GKlib")
Index: metis-5.1.0/GKlib/CMakeLists.txt
===================================================================
--- metis-5.1.0.orig/GKlib/CMakeLists.txt
+++ metis-5.1.0/GKlib/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.5)
project(GKlib)
get_filename_component(abs "." ABSOLUTE)

View File

@@ -1,3 +1,17 @@
-------------------------------------------------------------------
Wed Jul 16 11:29:00 UTC 2025 - Dominique Leuenberger <dimstar@opensuse.org>
- Add metis-min-cmake-3.5.patch: declare cmake 3.5 as minimal
required version in order to allow building using cmake 4, which
sets 3.5 as arbitrary lower limit. CMake 3.5 was release in 2016,
so we can get away with simply not caring for older things.
-------------------------------------------------------------------
Mon Mar 24 13:13:32 UTC 2025 - Nicolas Morey <nicolas.morey@suse.com>
- Disable and remove support for gnu-hpc build flavours (bsc#1239982)
- Remove upstream URL for Source0 as all links are dead.
-------------------------------------------------------------------
Wed Apr 3 07:48:00 UTC 2024 - Bernhard Wiedemann <bwiedemann@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package metis
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,117 +16,27 @@
#
%global flavor @BUILD_FLAVOR@%{nil}
%define vers 5.1.0
%define _vers 5_1_0
%define short_ver 5.1
%define src_ver %{version}
%define pname metis
%define somajor 5
%define libname lib%{name}%{somajor}
%if "%{flavor}" == ""
ExclusiveArch: do_not_build
%define package_name %pname
%bcond_with hpc
%endif
%if "%{flavor}" == "serial"
%bcond_with hpc
%endif
%if "%{flavor}" == "gnu-hpc"
%bcond_without hpc
%global compiler_family gnu
%undefine c_f_ver
%endif
%if "%{flavor}" == "gnu6-hpc"
%bcond_without hpc
%define compiler_family gnu
%define c_f_ver 6
%undefine mpi_flavor
%endif
%if "%{flavor}" == "gnu7-hpc"
%bcond_without hpc
%define compiler_family gnu
%define c_f_ver 7
%undefine mpi_flavor
%endif
%if "%{flavor}" == "gnu8-hpc"
%bcond_without hpc
%define compiler_family gnu
%define c_f_ver 8
%undefine mpi_flavor
%endif
%if "%{flavor}" == "gnu9-hpc"
%bcond_without hpc
%define compiler_family gnu
%define c_f_ver 9
%undefine mpi_flavor
%endif
%if "%{flavor}" == "gnu10-hpc"
%bcond_without hpc
%define compiler_family gnu
%define c_f_ver 10
%undefine mpi_flavor
%endif
%if %{without hpc}
%if 0%{!?package_name:1}
%define package_name %{pname}
%endif
%define p_prefix %_prefix
%define p_includedir %_includedir
%define p_libdir %_libdir
%define p_bindir %_bindir
%define p_mandir %_mandir
%define p_datadir %_datadir
%define p_infodir %_infodir
%define libname lib%{pname}%{somajor}
%else
%define package_name %{hpc_package_name %_vers}
%define p_prefix %hpc_prefix
%define p_includedir %hpc_includedir
%define p_libdir %hpc_libdir
%define p_bindir %hpc_bindir
%define p_mandir %hpc_mandir
%define p_datadir %hpc_datadir
%define p_infodir %hpc_infodir
%define libname lib%{pname}%{hpc_package_name_tail %{_vers}}
%{hpc_init -c %{compiler_family} %{?c_f_ver:-v %{c_f_ver}} %{?ext:-e %{ext}}}
%endif
Name: %{package_name}
Version: %{vers}
Name: metis
Version: 5.1.0
Release: 0
Summary: Serial Graph Partitioning and Fill-reducing Matrix Ordering
License: Apache-2.0
Group: Productivity/Scientific/Math
URL: http://glaros.dtc.umn.edu/gkhome/metis/metis/overview
Source0: http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/%{pname}-%{version}.tar.gz
Source0: %{name}-%{version}.tar.gz
# PATCH-FIX-OPENSUSE metis-cmake.patch
Patch1: metis-cmake.patch
# PATCH-FIX-OPENSUSE metis-programs-no-compilation-time.patch -- Fix W: file-contains-date-and-time
Patch2: metis-programs-no-compilation-time.patch
Patch3: metis-makefile-c-directives.patch
BuildRequires: cmake >= 2.8
# PATCH-FIX-OPENSUSE: require at least cmake 3.5 in order to allow building against cmake 4
Patch4: metis-min-cmake-3.5.patch
BuildRequires: cmake >= 3.5
BuildRequires: gcc
BuildRequires: gcc-c++
%if %{with hpc}
BuildRequires: %{compiler_family}%{?c_f_ver}-compilers-hpc-macros-devel
BuildRequires: lua-lmod
BuildRequires: suse-hpc
%hpc_requires
Requires: %libname = %version
%endif
Recommends: %{name}-doc = %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -137,8 +47,6 @@ and computing fill-reducing orderings of sparse matrices. The underlying algorit
used by METIS are based on a multilevel paradigm that, at the time, had been
shown to produce quality results and scale to large problems.
%{?with_hpc:%{hpc_master_package -L}}
%package -n %{libname}
Summary: Serial Graph Partitioning and Fill-reducing Matrix Ordering library
Group: System/Libraries
@@ -150,16 +58,10 @@ and computing fill-reducing orderings of sparse matrices. The underlying algorit
used by METIS are based on a multilevel paradigm that, at the time, had been
shown to produce quality results and scale to large problems.
%{?with_hpc:%{hpc_master_package -l -L}}
%package devel
Summary: Metis development files
Group: Development/Libraries/C and C++
Requires: %libname = %{version}
%if %{with hpc}
%hpc_requires_devel
Requires: %libname = %version
%endif
%description devel
METIS library provides to partitioning unstructured graphs and hypergraph
@@ -169,8 +71,6 @@ shown to produce quality results and scale to large problems.
This package provides development files.
%{?with_hpc:%{hpc_master_package -L devel}}
%package doc
Summary: Metis documentation
Group: Documentation/Other
@@ -182,8 +82,6 @@ and computing fill-reducing orderings of sparse matrices. The underlying algorit
used by METIS are based on a multilevel paradigm that, at the time, had been
shown to produce quality results and scale to large problems.
%{?with_hpc:%{hpc_master_package doc}}
%package examples
Summary: Metis examples
Group: Documentation/Other
@@ -194,113 +92,46 @@ METIS library provides to partitioning unstructured graphs and hypergraph
and computing fill-reducing orderings of sparse matrices. This package provides
graph files you can use to test Metis.
%{?with_hpc:%{hpc_master_package examples}}
%prep
%{?with_hpc: %hpc_debug}
%autosetup -p1 -n %{pname}-%{version}
%autosetup -p1 -n %{name}-%{version}
# set width (32 or 64 bits) of the elementary data type, see Install.txt
sed -i 's|#define IDXTYPEWIDTH 32|#define IDXTYPEWIDTH %{__isa_bits}|' include/metis.h
%build
%if %{with hpc}
%hpc_debug
%hpc_setup_compiler
%endif
make config shared=1 prefix=%{p_prefix} cflags="%{optflags} -fopenmp -pthread -fpie -pie" ldflags="-pie"
make config shared=1 prefix=%{_prefix} cflags="%{optflags} -fopenmp -pthread -fpie -pie" ldflags="-pie"
make %{?_smp_mflags}
%install
%{?with_hpc:%hpc_setup}
%{?with_hpc:%hpc_debug}
make install DESTDIR=%{buildroot}
%if %{with hpc}
%{hpc_write_pkgconfig}
%hpc_write_modules_files
#%%Module1.0#####################################################################
proc ModulesHelp { } {
puts stderr " "
puts stderr "This module loads the %{pname} library built with the %{compiler_family} compiler toolchain."
puts stderr "\nVersion %{version}\n"
}
module-whatis "Name: %{pname} built with %{compiler_family} toolchain"
module-whatis "Version: %{version}"
module-whatis "Category: runtime library"
module-whatis "Description: %{SUMMARY}"
module-whatis "%{url}"
set version %{version}
prepend-path PATH %{hpc_bindir}
prepend-path LD_LIBRARY_PATH %{hpc_libdir}
setenv %{hpc_upcase %pname}_DIR %{hpc_prefix}
setenv %{hpc_upcase %pname}_BIN %{hpc_bindir}
setenv %{hpc_upcase %pname}_LIB %{hpc_libdir}
prepend-path LIBRARY_PATH %{hpc_libdir}
if {[file isdirectory %{hpc_includedir}]} {
prepend-path CPATH %{hpc_includedir}
prepend-path C_INCLUDE_PATH %{hpc_includedir}
prepend-path CPLUS_INCLUDE_PATH %{hpc_includedir}
prepend-path INCLUDE %{hpc_includedir}
%hpc_modulefile_add_pkgconfig_path
setenv %{hpc_upcase %pname}_INC %{hpc_includedir}
}
family "%pname"
EOF
%endif
%check
pushd graphs
LD_LIBRARY_PATH=%{buildroot}%{p_libdir}:$LD_LIBRARY_PATH %{buildroot}%{p_bindir}/ndmetis mdual.graph
LD_LIBRARY_PATH=%{buildroot}%{p_libdir}:$LD_LIBRARY_PATH %{buildroot}%{p_bindir}/mpmetis metis.mesh 2
LD_LIBRARY_PATH=%{buildroot}%{p_libdir}:$LD_LIBRARY_PATH %{buildroot}%{p_bindir}/gpmetis test.mgraph 4
LD_LIBRARY_PATH=%{buildroot}%{p_libdir}:$LD_LIBRARY_PATH %{buildroot}%{p_bindir}/gpmetis copter2.graph 4
LD_LIBRARY_PATH=%{buildroot}%{p_libdir}:$LD_LIBRARY_PATH %{buildroot}%{p_bindir}/graphchk 4elt.graph
LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH %{buildroot}%{_bindir}/ndmetis mdual.graph
LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH %{buildroot}%{_bindir}/mpmetis metis.mesh 2
LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH %{buildroot}%{_bindir}/gpmetis test.mgraph 4
LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH %{buildroot}%{_bindir}/gpmetis copter2.graph 4
LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH %{buildroot}%{_bindir}/graphchk 4elt.graph
popd
cd graphs # cleanup after tests:
rm test.mgraph.part.4 metis.mesh.epart.2 metis.mesh.npart.2 copter2.graph.part.4 mdual.graph.iperm
%if %{without hpc}
%post -n %libname -p /sbin/ldconfig
%postun -n %libname -p /sbin/ldconfig
%else
%post -n %libname
/sbin/ldconfig -N %{p_libdir}
%postun -n %libname
/sbin/ldconfig -N %{p_libdir}
%hpc_module_delete_if_default
%endif
%files
%{?with_hpc:%dir %p_bindir}
%doc Changelog
%license LICENSE.txt
%{p_bindir}/*
%{_bindir}/*
%files -n %{libname}
%{?with_hpc:%hpc_dirs}
%{?hpc_modules_files}
%{p_libdir}/lib%{pname}.so.%{somajor}*
%{_libdir}/lib%{name}.so.%{somajor}*
%files devel
%{?with_hpc:%dir %{p_includedir}}
%{p_includedir}/%{pname}.h
%{p_libdir}/lib%{pname}.so
%{?with_hpc:%{hpc_pkgconfig_file -n %{pname}}}
%{_includedir}/%{name}.h
%{_libdir}/lib%{name}.so
%files doc
%doc manual/manual.pdf