diff --git a/.github/workflows/test-linux-asm.yaml b/.github/workflows/test-linux-asm.yaml deleted file mode 100644 index 7ec18e9..0000000 --- a/.github/workflows/test-linux-asm.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: test prover linux build with asm optimizations - -on: - push: - branches: - - main - - develop - pull_request: - branches: - - main - - develop - -jobs: - test: - strategy: - matrix: - go-version: [ 1.18.x ] - runs-on: ubuntu-latest - steps: - - name: Install Go - if: success() - uses: actions/setup-go@v3 - with: - go-version: ${{ matrix.go-version }} - cache: false - - name: Checkout code - uses: actions/checkout@v2 - - name: Print CPU Info - run: cat /proc/cpuinfo - - name: Run tests - # rapidsnark_asm build tag enables asm optimizations - run: cd tests && go test -tags rapidsnark_asm -v -covermode=count - diff --git a/prover/README.md b/prover/README.md index c75f9ae..116642a 100644 --- a/prover/README.md +++ b/prover/README.md @@ -27,19 +27,20 @@ For the following architectures, pre-built vendored libraries are included: ## Performance optimization on x86_64 hardware -Rapidsnark has optimization for recent x86_64 processors that gives ~2x speed boost, but older hardware may lack support for ADX and BMI2 instruction sets used. +Rapidsnark has optimization for recent x86_64 processors that gives ~2x speed boost, +but older hardware may lack support for ADX and BMI2 instruction sets used. +If you have such hardware, you may want to disable assembly optimizations by +specifying `rapidsnark_noasm` build tag. By default, optimizations are ON. -MacOS build has it enabled. But for linux we disabled the optimization (at least for now, because GitHub Actions may use old hardware). - -To **enable** optimization on linux use `rapidsnark_asm` build tag: +MacOS build there is no way to disable assembly optimizations with build tags. +You need to build your custom library with disabled optimizations. And +build the library with `dynamic` tag to use it instead of vendored one. ```shell -go build -tags rapidsnark_asm -go test -tags rapidsnark_asm +go build -tags rapidsnark_noasm +go test -tags rapidsnark_noasm ``` -In the future we may change default behaviour, so to force disable optimizations use `rapidsnark_noasm` build tag. - ## Performance optimization on arm64 hardware We used NEON instruction set, and it is always enabled, so no build tags are needed. diff --git a/prover/build_linux_amd64.go b/prover/build_linux_amd64.go index eb7fe6b..86b74d2 100644 --- a/prover/build_linux_amd64.go +++ b/prover/build_linux_amd64.go @@ -1,7 +1,7 @@ -//go:build !dynamic && !rapidsnark_noasm && !rapidsnark_asm +//go:build !dynamic && !rapidsnark_noasm package prover // #cgo CFLAGS: -DUSE_VENDORED_RAPIDSNARK -// #cgo LDFLAGS: ${SRCDIR}/rapidsnark_vendor/librapidsnark-linux-amd64-noasm.a ${SRCDIR}/rapidsnark_vendor/libgmp-linux-amd64.a -lstdc++ -fopenmp +// #cgo LDFLAGS: ${SRCDIR}/rapidsnark_vendor/librapidsnark-linux-amd64.a ${SRCDIR}/rapidsnark_vendor/libgmp-linux-amd64.a -lstdc++ -fopenmp import "C" diff --git a/prover/build_linux_amd64_asm.go b/prover/build_linux_amd64_asm.go deleted file mode 100644 index 27c30ff..0000000 --- a/prover/build_linux_amd64_asm.go +++ /dev/null @@ -1,7 +0,0 @@ -//go:build linux && amd64 && !dynamic && rapidsnark_asm && !rapidsnark_noasm - -package prover - -// #cgo CFLAGS: -DUSE_VENDORED_RAPIDSNARK -// #cgo LDFLAGS: ${SRCDIR}/rapidsnark_vendor/librapidsnark-linux-amd64.a ${SRCDIR}/rapidsnark_vendor/libgmp-linux-amd64.a -lstdc++ -fopenmp -import "C" diff --git a/prover/build_linux_amd64_noasm.go b/prover/build_linux_amd64_noasm.go index e85d088..761e699 100644 --- a/prover/build_linux_amd64_noasm.go +++ b/prover/build_linux_amd64_noasm.go @@ -1,4 +1,4 @@ -//go:build linux && amd64 && !dynamic && rapidsnark_noasm && !rapidsnark_asm +//go:build linux && amd64 && !dynamic && rapidsnark_noasm package prover