arnaucube
arnaucube/circomPublic Self-hosted repository
Merge pull request #57 from iden3/feature/c-tester-linux

add `-pthread` for linux g++ command
Jordi Baylina jordi@baylina.cat
Tue, 07 Apr 2020 13:00:51 +0200
commit

1463685b115f5bb9c270152cfd72649fad0d7223

parent

a1ae6e4a441fa23f159046acac72e56885eda023

1 files changed, 4 insertions(+), 1 deletions(-)

jump to
M ports/c/tester.js → ports/c/tester.js

@@ -42,11 +42,14 @@ await fs.promises.writeFile(path.join(dir.path, "fr.asm"), source.asm, "utf8");

await fs.promises.writeFile(path.join(dir.path, "fr.h"), source.h, "utf8"); await fs.promises.writeFile(path.join(dir.path, "fr.c"), source.c, "utf8"); + let pThread = ""; + if (process.platform === "darwin") { await exec("nasm -fmacho64 --prefix _ " + ` ${path.join(dir.path, "fr.asm")}` ); } else if (process.platform === "linux") { + pThread = "-pthread"; await exec("nasm -felf64 " + ` ${path.join(dir.path, "fr.asm")}` );

@@ -54,7 +57,7 @@ } else throw("Unsupported platform");

const cdir = path.join(path.dirname(require.resolve("circom_runtime")), "c"); - await exec("g++" + + await exec("g++" + ` ${pThread}` ` ${path.join(cdir, "main.cpp")}` + ` ${path.join(cdir, "calcwit.cpp")}` + ` ${path.join(cdir, "utils.cpp")}` +