forked from baking-bad/stone-prover
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Fedora packaging workflow and scripts
- Loading branch information
Showing
3 changed files
with
55 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,15 @@ | ||
#!/bin/bash | ||
# Fix dependencies | ||
set -o xtrace | ||
set -e | ||
set -eo pipefail | ||
|
||
# Detect OS and architecture | ||
os=$(uname | tr '[:upper:]' '[:lower:]') | ||
arch=$(uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) | ||
# Install dependencies | ||
dnf install -y clang gcc-c++ libstdc++-devel libcxx libcxx-devel \ | ||
ncurses-compat-libs elfutils-devel gmp-devel python3-devel wget git | ||
|
||
# Fedora-specific installation | ||
if [ "$os" == "linux" ] && [ -f /etc/fedora-release ]; then | ||
echo "Detected Fedora" | ||
|
||
# Clean and update Fedora packages | ||
sudo dnf clean all | ||
sudo dnf update -y | ||
|
||
# Install dependencies | ||
sudo dnf install -y clang gcc-c++ libstdc++-devel libcxx libcxx-devel \ | ||
ncurses-compat-libs elfutils-devel gmp-devel python3-devel wget git | ||
|
||
# Install Python dependencies | ||
pip install cpplint pytest numpy sympy==1.12.1 cairo-lang==0.12.0 | ||
|
||
# Install Bazelisk (Bazel wrapper) | ||
wget "https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-linux-amd64" | ||
chmod 755 "bazelisk-linux-amd64" | ||
sudo mv "bazelisk-linux-amd64" /bin/bazelisk | ||
|
||
else | ||
echo "$os is either not Fedora or not supported." | ||
exit 1 | ||
fi | ||
|
||
# Clone the stone-prover repository | ||
git clone https://github.com/baking-bad/stone-prover.git /tmp/stone-prover | ||
|
||
# Move into the stone-prover directory | ||
cd /tmp/stone-prover || exit | ||
# Install Python dependencies | ||
pip install cpplint pytest numpy sympy==1.12.1 cairo-lang==0.12.0 | ||
|
||
# Build with Bazel, specifying C++17 compatibility | ||
bazelisk build --cpu=$arch //... --cxxopt='-std=c++17' | ||
|
||
# Run tests | ||
bazelisk test --cpu=$arch //... --cxxopt='-std=c++17' | ||
bazelisk build //... --cxxopt='-std=c++17' | ||
|
||
# Create symbolic links for the built binaries | ||
ln -s /tmp/stone-prover/build/bazelbin/src/starkware/main/cpu/cpu_air_prover /usr/local/bin/cpu_air_prover | ||
ln -s /tmp/stone-prover/build/bazelbin/src/starkware/main/cpu/cpu_air_verifier /usr/local/bin/cpu_air_verifier | ||
# Run tests (comment out if tests are too resource-intensive for CI) | ||
# bazelisk test //... --cxxopt='-std=c++17' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,33 @@ | ||
Name: stone-prover | ||
Version: 1.0.0 | ||
Release: 1%{?dist} | ||
Summary: High-performance proof verification tool | ||
Name: stone-prover | ||
Version: %{version} | ||
Release: 1%{?dist} | ||
Summary: High-performance proof verification tool | ||
|
||
License: MIT | ||
BuildArch: x86_64 | ||
License: MIT | ||
URL: https://github.com/baking-bad/stone-prover | ||
Source0: %{name}-%{version}.tar.gz | ||
|
||
# Build dependencies | ||
BuildRequires: gcc, make, bazelisk, rpm-build, python3-pip | ||
Requires: libtinfo5, libdw-dev, libgmp3-dev, python3, python3-numpy, python3-sympy | ||
BuildRequires: gcc gcc-c++ make bazel python3-devel gmp-devel elfutils-libelf-devel | ||
Requires: python3 python3-numpy python3-sympy gmp elfutils-libelf | ||
|
||
%description | ||
Stone-prover is a high-performance proof verification tool. | ||
|
||
%prep | ||
git clone https://github.com/baking-bad/stone-prover.git /tmp/stone-prover | ||
%autosetup -n %{name}-%{version} | ||
|
||
%build | ||
cd /tmp/stone-prover | ||
bazelisk build --cpu=%{_arch} //... | ||
./build.sh | ||
|
||
%install | ||
mkdir -p %{buildroot}/usr/local/bin | ||
install -m 755 /tmp/stone-prover/build/bazelbin/src/starkware/main/cpu/cpu_air_prover %{buildroot}/usr/local/bin/cpu_air_prover | ||
install -m 755 /tmp/stone-prover/build/bazelbin/src/starkware/main/cpu/cpu_air_verifier %{buildroot}/usr/local/bin/cpu_air_verifier | ||
mkdir -p %{buildroot}%{_bindir} | ||
install -m 755 bazel-bin/src/starkware/main/cpu/cpu_air_prover %{buildroot}%{_bindir}/cpu_air_prover | ||
install -m 755 bazel-bin/src/starkware/main/cpu/cpu_air_verifier %{buildroot}%{_bindir}/cpu_air_verifier | ||
|
||
%files | ||
/usr/local/bin/cpu_air_prover | ||
/usr/local/bin/cpu_air_verifier | ||
%{_bindir}/cpu_air_prover | ||
%{_bindir}/cpu_air_verifier | ||
|
||
%changelog | ||
* Wed Oct 02 2024 Your Name <[email protected]> - 1.0.0-1 | ||
- Initial RPM package for stone-prover. | ||
* Wed Oct 02 2024 Your Name <[email protected]> - %{version}-1 | ||
- Initial RPM package for stone-prover. |