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 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..a5755f1 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 @@ -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 \ 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