From b3dcd8c936eac0076c3efa5f8ee3b04b3d0f8b4e Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Sun, 3 Dec 2023 13:26:43 +0100 Subject: [PATCH 1/3] Switch to 'semolina' for MinRoot implementation. --- .gitmodules | 6 +++--- build.sh | 8 ++++---- semolina | 1 + sloth-pasta | 1 - 4 files changed, 8 insertions(+), 8 deletions(-) create mode 160000 semolina delete mode 160000 sloth-pasta diff --git a/.gitmodules b/.gitmodules index a2f16dc..bc6f196 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/build.sh b/build.sh index a116596..4325c37 100755 --- a/build.sh +++ b/build.sh @@ -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 @@ -48,12 +48,12 @@ case `uname -s` in ;; 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 \ diff --git a/semolina b/semolina new file mode 160000 index 0000000..1416f87 --- /dev/null +++ b/semolina @@ -0,0 +1 @@ +Subproject commit 1416f872f84a02372d68d2d6460de83e551f0df9 diff --git a/sloth-pasta b/sloth-pasta deleted file mode 160000 index 2829425..0000000 --- a/sloth-pasta +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2829425a29753139e89dafbe2a0704a96b2f8971 From f6b8fd6065f02019b0b350a6a262d40b0d0f7691 Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Sun, 3 Dec 2023 13:48:20 +0100 Subject: [PATCH 2/3] .github/workflows/macos.yml: download GMP from ftp.gnu.org. --- .github/workflows/macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index edf7a7a..db63f8f 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -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 From 6e138b96f86544caaf8ff8142660299793feccda Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Sun, 3 Dec 2023 14:59:29 +0100 Subject: [PATCH 3/3] build.sh: pick up gmp from homebrew if available. --- build.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 4325c37..a5755f1 100755 --- a/build.sh +++ b/build.sh @@ -40,8 +40,14 @@ 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