|
|
564204d |
# Koji has two types of builders:
|
|
|
564204d |
# 16Gb + 6 cores
|
|
|
564204d |
# 128Gb + 48 cores
|
|
|
564204d |
# There's no way to choose either, so we rely on luck
|
|
|
564204d |
#
|
|
|
564204d |
# This needs about 15 gigs per thread, otherwise OOMs. So, we calculate the number of threads we can afford to use for make:
|
|
|
564204d |
# meminfo gives output in kB (1000 bytes)
|
|
|
564204d |
%global numthreads %(echo $(( $(cat /proc/meminfo | grep MemTotal | awk '{print $2}') / 15000000 )) )
|
|
|
564204d |
# But make sure it is > 0
|
|
|
564204d |
%if 0%{numthreads} == 0
|
|
|
564204d |
%global numthreads 1
|
|
|
564204d |
%endif
|
|
|
564204d |
|
|
|
564204d |
# If _smp_build_ncpus is not defined (on older rpms)
|
|
|
564204d |
# assume there's only one
|
|
|
564204d |
%if 0%{?_smp_build_ncpus} == 0
|
|
|
564204d |
%global _smp_build_ncpus 1
|
|
|
564204d |
%endif
|
|
|
564204d |
|
|
|
564204d |
# Use the smaller number of threads
|
|
|
564204d |
%if 0%{numthreads} > 0%{?_smp_build_ncpus}
|
|
|
564204d |
%global numthreads %{?_smp_build_ncpus}
|
|
|
564204d |
%endif
|
|
|
564204d |
|
|
|
564204d |
%global modname graph-tool
|
|
|
564204d |
%global pymodname graph_tool
|
|
|
564204d |
|
|
|
564204d |
%global _description %{expand:
|
|
|
564204d |
Graph-tool is an efficient Python module for manipulation and statistical
|
|
|
564204d |
analysis of graphs (a.k.a. networks). Contrary to most other python modules
|
|
|
564204d |
with similar functionality, the core data structures and algorithms are
|
|
|
564204d |
implemented in C++, making extensive use of template metaprogramming, based
|
|
|
564204d |
heavily on the Boost Graph Library. This confers it a level of performance that
|
|
|
564204d |
is comparable (both in memory usage and computation time) to that of a pure
|
|
|
564204d |
C/C++ library.
|
|
|
564204d |
|
|
|
564204d |
Please refer to https://graph-tool.skewed.de/static/doc/index.html for
|
|
|
564204d |
documentation.}
|
|
|
564204d |
|
|
|
564204d |
Name: python-%{modname}
|
|
|
564204d |
Version: 2.29
|
|
|
15648c6 |
Release: 2%{?dist}
|
|
|
564204d |
Summary: Efficient network analysis tool written in Python
|
|
|
564204d |
|
|
|
564204d |
License: GPLv3+
|
|
|
564204d |
URL: https://graph-tool.skewed.de/
|
|
|
564204d |
Source0: https://downloads.skewed.de/%{modname}/%{modname}-%{version}.tar.bz2
|
|
|
564204d |
|
|
|
15648c6 |
# Fails on i686: issue filed: https://git.skewed.de/count0/graph-tool/issues/617
|
|
|
15648c6 |
# https://bugzilla.redhat.com/show_bug.cgi?id=1771023
|
|
|
15648c6 |
# Fails on armv7hl: virtual memory exhausted
|
|
|
15648c6 |
# https://bugzilla.redhat.com/show_bug.cgi?id=1771024
|
|
|
15648c6 |
# Fails on ppc64le: note: variable tracking size limit exceeded with '-fvar-tracking-assignments', retrying without
|
|
|
15648c6 |
# https://bugzilla.redhat.com/show_bug.cgi?id=1771031
|
|
|
15648c6 |
# Fails on s390x: note: variable tracking size limit exceeded with '-fvar-tracking-assignments', retrying without
|
|
|
15648c6 |
# https://bugzilla.redhat.com/show_bug.cgi?id=1771034
|
|
|
15648c6 |
# Takes ~23 hours on x86_64 if we get unlucky and get a 6 core 16gig machine, ~4 hours if we get a 48 core 128gig machine
|
|
|
15648c6 |
# Takes ~45 hours on aarch64
|
|
|
15648c6 |
ExcludeArch: i686 armv7hl ppc64le s390x
|
|
|
15648c6 |
|
|
|
564204d |
# Workaround for https://git.skewed.de/count0/graph-tool/issues/613
|
|
|
564204d |
# CGAL 5.x is now header only
|
|
|
564204d |
# Required on F32+
|
|
|
564204d |
%if 0%{?fedora} >= 32
|
|
|
564204d |
Patch0: 0001-Use-header-only-CGAL-library.patch
|
|
|
564204d |
%endif
|
|
|
564204d |
|
|
|
564204d |
# Remove the compiler flags upstream tries to put
|
|
|
564204d |
Patch1: 0002-Remove-upstreams-flags.patch
|
|
|
564204d |
BuildRequires: git-core
|
|
|
564204d |
BuildRequires: autoconf
|
|
|
564204d |
BuildRequires: automake
|
|
|
564204d |
BuildRequires: libtool
|
|
|
564204d |
|
|
|
564204d |
%description %_description
|
|
|
564204d |
|
|
|
564204d |
%package -n python3-%{modname}
|
|
|
564204d |
Summary: %{summary}
|
|
|
564204d |
BuildRequires: python3-devel
|
|
|
564204d |
BuildRequires: boost-devel
|
|
|
564204d |
BuildRequires: boost-python3-devel
|
|
|
564204d |
BuildRequires: CGAL-devel
|
|
|
564204d |
BuildRequires: cairomm-devel
|
|
|
564204d |
BuildRequires: expat-devel
|
|
|
564204d |
BuildRequires: gcc-g++
|
|
|
564204d |
BuildRequires: gmp-devel
|
|
|
564204d |
BuildRequires: gtk3-devel
|
|
|
564204d |
BuildRequires: python3-cairo-devel
|
|
|
564204d |
BuildRequires: python3-devel
|
|
|
564204d |
BuildRequires: %{py3_dist scipy}
|
|
|
564204d |
BuildRequires: %{py3_dist matplotlib}
|
|
|
564204d |
BuildRequires: %{py3_dist numpy}
|
|
|
564204d |
BuildRequires: sparsehash-devel
|
|
|
564204d |
|
|
|
564204d |
Provides: graph-tool%{?_isa} = %{version}-%{release}
|
|
|
564204d |
|
|
|
564204d |
# Not a setuptools style project, but leaving this in
|
|
|
564204d |
%{?python_provide:%python_provide python3-%{modname}}
|
|
|
564204d |
|
|
|
564204d |
%description -n python3-%{modname} %_description
|
|
|
564204d |
|
|
|
564204d |
%prep
|
|
|
564204d |
%autosetup -S git -n %{modname}-%{version}
|
|
|
564204d |
# Remove shebangs
|
|
|
564204d |
find . -type f -name "*.py" -exec sed -i '/^#![ ]*\/usr\/bin\/env.*$/ d' {} 2>/dev/null ';'
|
|
|
564204d |
|
|
|
564204d |
|
|
|
564204d |
%build
|
|
|
564204d |
./autogen.sh
|
|
|
15648c6 |
%configure --with-python-module-path=%{python3_sitearch} --with-boost-libdir=%{_libdir}
|
|
|
564204d |
echo "Building with %{numthreads} of %{?_smp_build_ncpus} available CPUs"
|
|
|
564204d |
# Uses the latest value set by -j
|
|
|
564204d |
%make_build -j%{numthreads}
|
|
|
564204d |
|
|
|
564204d |
%install
|
|
|
564204d |
%make_install
|
|
|
564204d |
|
|
|
564204d |
# Remove installed doc sources
|
|
|
564204d |
rm -rf $RPM_BUILD_ROOT/%{_datadir}/doc/%{modname}
|
|
|
564204d |
|
|
|
564204d |
# Remove static objects
|
|
|
564204d |
find $RPM_BUILD_ROOT -name "*.la" -delete
|
|
|
564204d |
|
|
|
564204d |
|
|
|
564204d |
%files -n python3-%{modname}
|
|
|
564204d |
%license LICENSE
|
|
|
564204d |
%doc README.md ChangeLog AUTHORS
|
|
|
564204d |
%{python3_sitearch}/%{pymodname}
|
|
|
564204d |
%{_libdir}/pkgconfig/%{modname}-py%{python3_version}.pc
|
|
|
564204d |
|
|
|
564204d |
%changelog
|
|
|
15648c6 |
* Sat Nov 09 2019 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2.29-2
|
|
|
15648c6 |
- Exclude builds on arches: usually falls short of resources
|
|
|
15648c6 |
|
|
|
564204d |
* Fri Nov 01 2019 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2.29-1
|
|
|
564204d |
- Remove unneeded shebangs
|
|
|
564204d |
|
|
|
564204d |
* Tue Oct 22 2019 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2.29-1
|
|
|
564204d |
- Improve conditional to handle cases where _smp_build_ncpus is not defined
|
|
|
564204d |
- Correct conditional hack
|
|
|
564204d |
|
|
|
564204d |
* Tue Oct 15 2019 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2.29-1
|
|
|
564204d |
- Initial build
|