Compare commits
27 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
dc00a7f9ef | ||
|
064151361c | ||
|
ae2cda16d2 | ||
|
0e67324ae6 | ||
|
76ad2a4ef1 | ||
|
c4d26caeaf | ||
|
e240bc6e8a | ||
|
7a458a5150 | ||
|
d02751bf3b | ||
|
d12f3380c4 | ||
|
c02f637a80 | ||
|
65cb17befd | ||
|
10973cf706 | ||
|
70daebcefd | ||
|
7771b77dc9 | ||
|
ae5f05be70 | ||
|
b94607ebe3 | ||
|
989387bde6 | ||
|
40c13fc13f | ||
|
e6b8f6848a | ||
|
3dd8fdb83e | ||
|
491fb84a1a | ||
|
f77c80cdf4 | ||
|
b586844472 | ||
|
9591927163 | ||
|
f8bc268df3 | ||
|
db85dc6492 |
5
.gitignore
vendored
5
.gitignore
vendored
@ -1 +1,6 @@
|
||||
/llvmlite-0.37.0.tar.gz
|
||||
/llvmlite-0.39.1.tar.gz
|
||||
/llvmlite-0.40.0.tar.gz
|
||||
/llvmlite-0.40.1.tar.gz
|
||||
/llvmlite-0.41.0.tar.gz
|
||||
/llvmlite-0.41.1.tar.gz
|
||||
|
@ -1,47 +1,50 @@
|
||||
%bcond_without tests
|
||||
|
||||
%global forgeurl https://github.com/numba/llvmlite
|
||||
%bcond tests 1
|
||||
# Sphinx-generated HTML documentation is not suitable for packaging; see
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion.
|
||||
#
|
||||
# We can generate PDF documentation as a substitute.
|
||||
%bcond doc_pdf 1
|
||||
|
||||
Name: python-llvmlite
|
||||
Version: 0.37.0
|
||||
Version: 0.41.1
|
||||
Release: %{autorelease}
|
||||
Summary: Lightweight LLVM Python binding for writing JIT compilers
|
||||
|
||||
%forgemeta
|
||||
# The entire source is BSD-2-Clause, except:
|
||||
# - The bundled versioneer.py, and the _version.py it generates (which is
|
||||
# packaged) is LicenseRef-Fedora-Public-Domain. In later versions of
|
||||
# versioneer, this becomes CC0-1.0 and then Unlicense.
|
||||
# Public-domain text added to fedora-license-data in commit
|
||||
# 830d88d4d89ee5596839de5b2c1f48426488841f:
|
||||
# https://gitlab.com/fedora/legal/fedora-license-data/-/merge_requests/210
|
||||
# Additionally, the following does not affect the license of the binary RPMs:
|
||||
# - conda-recipes/appveyor/run_with_env.cmd is CC0-1.0; for distribution in
|
||||
# the source RPM, it is covered by “Existing uses of CC0-1.0 on code files
|
||||
# in Fedora packages prior to 2022-08-01, and subsequent upstream versions
|
||||
# of those files in those packages, continue to be allowed. We encourage
|
||||
# Fedora package maintainers to ask upstreams to relicense such files.”
|
||||
# https://gitlab.com/fedora/legal/fedora-license-data/-/issues/91#note_1151947383
|
||||
License: BSD-2-Clause AND LicenseRef-Fedora-Public-Domain
|
||||
|
||||
License: BSD
|
||||
URL: http://llvmlite.pydata.org/
|
||||
Source0: %{forgesource}
|
||||
%global forgeurl https://github.com/numba/llvmlite
|
||||
Source: %{forgeurl}/archive/v%{version}/llvmlite-%{version}.tar.gz
|
||||
|
||||
BuildRequires: pyproject-rpm-macros
|
||||
BuildRequires: python3-devel
|
||||
# 0.37.0 only supports llvm11
|
||||
BuildRequires: llvm11-devel
|
||||
|
||||
# 0.41.0 only supports llvm14
|
||||
BuildRequires: llvm14-devel
|
||||
BuildRequires: gcc-c++
|
||||
|
||||
%global _description %{expand:
|
||||
llvmlite provides a Python binding to LLVM for use in Numba.
|
||||
|
||||
Numba previously relied on llvmpy. While llvmpy exposed large parts of the
|
||||
LLVM C++ API for direct calls into the LLVM library, llvmlite takes an entirely
|
||||
different approach. Llvmlite starts from the needs of a JIT compiler and splits
|
||||
them into two decoupled tasks:
|
||||
|
||||
- Construction of a Module, function by function, Instruction by instruction.
|
||||
- Compilation and optimization of the module into machine code.
|
||||
|
||||
The construction of an LLVM module does not call the LLVM C++ API. Rather, it
|
||||
constructs the LLVM intermediate representation (IR) in pure Python. This is
|
||||
the role of the IR layer.
|
||||
|
||||
The compilation of an LLVM module takes the IR in textual form and feeds it
|
||||
into LLVM's parsing API. It then returns a thin wrapper around LLVM's C++
|
||||
module object. This is the role of the binding layer.
|
||||
|
||||
Once parsed, the module's source code cannot be modified, which loses the
|
||||
flexibility of the direct mapping of C++ APIs into Python that was provided by
|
||||
llvmpy but saves a great deal of maintenance.}
|
||||
llvmlite is a project originally tailored for Numba‘s needs, using the
|
||||
following approach:
|
||||
|
||||
• A small C wrapper around the parts of the LLVM C++ API we need that are not
|
||||
already exposed by the LLVM C API.
|
||||
• A ctypes Python wrapper around the C API.
|
||||
• A pure Python implementation of the subset of the LLVM IR builder that we
|
||||
need for Numba.}
|
||||
|
||||
%description %_description
|
||||
|
||||
@ -53,18 +56,20 @@ Summary: %{summary}
|
||||
|
||||
%package doc
|
||||
Summary: %{summary}
|
||||
BuildRequires: %{py3_dist sphinx}
|
||||
BuildRequires: %{py3_dist sphinx-rtd-theme}
|
||||
%if %{with doc_pdf}
|
||||
BuildRequires: make
|
||||
BuildRequires: python3dist(sphinx)
|
||||
BuildRequires: python3-sphinx-latex
|
||||
BuildRequires: latexmk
|
||||
# The HTML theme is imported in conf.py even when not generating HTML
|
||||
BuildRequires: python3dist(sphinx-rtd-theme)
|
||||
%endif
|
||||
|
||||
%description doc
|
||||
Documentation for %{name}.
|
||||
|
||||
%prep
|
||||
%forgesetup
|
||||
|
||||
# seems to be fine with 3.10 but we need to remove the guard
|
||||
# https://github.com/numba/llvmlite/issues/740
|
||||
sed -i 's/max_python_version =.*/max_python_version = "3.11"/' setup.py
|
||||
%autosetup -n llvmlite-%{version} -p1
|
||||
|
||||
# increase verbosity of tests to 2
|
||||
sed -i 's/\(def run_tests.*verbosity=\)1/\12/' llvmlite/tests/__init__.py
|
||||
@ -73,15 +78,20 @@ sed -i 's/\(def run_tests.*verbosity=\)1/\12/' llvmlite/tests/__init__.py
|
||||
# Can use something similar to correct/remove /usr/bin/python shebangs also
|
||||
# find . -type f -name "*.py" -exec sed -i '/^#![ ]*\/usr\/bin\/env.*$/ d' {} 2>/dev/null ';'
|
||||
|
||||
# No network access
|
||||
echo 'intersphinx_mapping.clear()' >> docs/source/conf.py
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires
|
||||
|
||||
%build
|
||||
export LLVM_CONFIG="%{_libdir}/llvm11/bin/llvm-config"
|
||||
export LLVM_CONFIG="%{_libdir}/llvm14/bin/llvm-config"
|
||||
%pyproject_wheel
|
||||
|
||||
make -C docs SPHINXBUILD=sphinx-build-3 html
|
||||
rm -rf docs/_build/html/{.doctrees,.buildinfo,_static/EMPTY} -vf
|
||||
%if %{with doc_pdf}
|
||||
%make_build -C docs latex SPHINXOPTS='-j%{?_smp_build_ncpus}'
|
||||
%make_build -C docs/_build/latex LATEXMKOPTS='-quiet'
|
||||
%endif
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
@ -89,7 +99,7 @@ rm -rf docs/_build/html/{.doctrees,.buildinfo,_static/EMPTY} -vf
|
||||
|
||||
%check
|
||||
%if %{with tests}
|
||||
LD_LIBRARY_PATH="%{buildroot}%{python3_sitearch}/llvmlite/binding/" PYTHONPATH="$PYTHONPATH:%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}" %{python3} runtests.py
|
||||
%{py3_test_envvars} %{python3} runtests.py
|
||||
%endif
|
||||
|
||||
%files -n python3-llvmlite -f %{pyproject_files}
|
||||
@ -97,7 +107,10 @@ LD_LIBRARY_PATH="%{buildroot}%{python3_sitearch}/llvmlite/binding/" PYTHONPATH="
|
||||
|
||||
%files doc
|
||||
%license LICENSE
|
||||
%doc docs/_build/html examples/
|
||||
%doc examples/
|
||||
%if %{with doc_pdf}
|
||||
%doc docs/_build/latex/llvmlite.pdf
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
%autochangelog
|
||||
|
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (llvmlite-0.37.0.tar.gz) = 665f486fd38c9cc4ee91b15fc75f33451ada6391fc9f1b371091ece844693e0cd8e23766400bf76d9879e8f10f53f4e21f8bb19f3ff1e01c4a95ce9004b0884a
|
||||
SHA512 (llvmlite-0.41.1.tar.gz) = 97ba6c97837ee2f4bd29d97fa3992dc2d316cac8aa8aee5dd653fa5b4261987613c83997a4d94d10eb5009c6976e202fd13ab37208b5fc1f4a6e6288d608b901
|
||||
|
Loading…
Reference in New Issue
Block a user