Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
shell: bash
run: |
if [ ! -f libft4222/build/libgmp.a ]; then
curl -sSf https://gmplib.org/download/gmp/gmp-6.2.1.tar.xz | tar xf -
curl -sSf https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz | tar xf -
cd gmp-6.2.1
make distclean || true
env CFLAGS="-arch arm64" ./configure --disable-shared --host=aarch64-apple-darwin
Expand Down
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "sloth-pasta"]
path = sloth-pasta
url = https://github.com/supranational/sloth-pasta
[submodule "semolina"]
path = semolina
url = https://github.com/supranational/semolina
18 changes: 12 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/sh

# Copyright Supranational LLC
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

#!/bin/bash

set -e
set -x

Expand Down Expand Up @@ -40,20 +40,26 @@ case `uname -s` in
if [ -f libft4222/build/libgmp.a ]; then
CFLAGS="-arch x86_64 -arch arm64"
CXXFLAGS="-arch x86_64 -arch arm64"
elif [ `sysctl -n hw.optional.adx 2>/dev/null` = "1" ]; then
CFLAGS="-D__ADX__"
else
if [ "`sysctl -n hw.optional.adx 2>/dev/null`" = "1" ]; then
CFLAGS="-D__ADX__"
fi
if pkg-config gmp 2>/dev/null; then
CXXFLAGS="`pkg-config gmp --cflags`"
extra_ldflags="`pkg-config gmp --libs-only-L` $extra_ldflags"
fi
fi
;;
*) echo "Unsupported OS"; exit 1
;;
esac

if [ ! -d sloth-pasta/src ]; then
if [ ! -d semolina/src ]; then
git submodule init
git submodule update
fi

${CC:-cc} ${CFLAGS} -g -O -c sloth-pasta/src/pasta_vdf.c sloth-pasta/src/assembly.S
${CC:-cc} ${CFLAGS} -g -O -c semolina/src/pasta_vdf.c semolina/src/assembly.S
trap 'rm -f pasta_vdf.o assembly.o' 0
rm -f minroot
${CXX:-c++} ${CXXFLAGS} -std=c++11 -pthread -g -O -o minroot -Wall -Wextra \
Expand Down
1 change: 1 addition & 0 deletions semolina
Submodule semolina added at 1416f8
1 change: 0 additions & 1 deletion sloth-pasta
Submodule sloth-pasta deleted from 282942