forked from iden3/circomlib
-
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.
Merge pull request iden3#12 from fluidex/master
macos (x86_64) support for cpp backend; use template to generate makefile
- Loading branch information
Showing
5 changed files
with
75 additions
and
48 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
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,4 +1,5 @@ | ||
#include <iomanip> | ||
#include <sstream> | ||
#include <assert.h> | ||
#include "calcwit.hpp" | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
CC=g++ | ||
CFLAGS=-std=c++11 -O3 -I. | ||
DEPS_HPP = circom.hpp calcwit.hpp fr.hpp | ||
DEPS_O = main.o calcwit.o fr.o fr_asm.o | ||
|
||
ifeq ($(shell uname),Darwin) | ||
NASM=nasm -fmacho64 --prefix _ | ||
endif | ||
ifeq ($(shell uname),Linux) | ||
NASM=nasm -felf64 | ||
endif | ||
|
||
all: {{run_name}} | ||
|
||
%.o: %.cpp $(DEPS_HPP) | ||
$(CC) -c $< $(CFLAGS) | ||
|
||
fr_asm.o: fr.asm | ||
$(NASM) fr.asm -o fr_asm.o | ||
|
||
{{run_name}}: $(DEPS_O) {{run_name}}.o | ||
$(CC) -o {{run_name}} *.o -lgmp {{#if has_parallelism}}-pthread{{/if}} |