Compare commits

...

4 Commits

Author SHA1 Message Date
Jordi Baylina
f25842f67c 0.5.7 2020-04-07 13:02:51 +02:00
Jordi Baylina
92399017df FIX: c tester in linux 2020-04-07 13:02:39 +02:00
Jordi Baylina
1463685b11 Merge pull request #57 from iden3/feature/c-tester-linux
add `-pthread` for linux g++ command
2020-04-07 13:00:51 +02:00
krlosMata
b107a11432 add -pthread for linux 2020-04-07 11:51:48 +02:00
3 changed files with 6 additions and 3 deletions

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "circom",
"version": "0.5.6",
"version": "0.5.7",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "circom",
"version": "0.5.6",
"version": "0.5.7",
"description": "Language to generate logic circuits",
"main": "index.js",
"directories": {

View File

@@ -42,11 +42,14 @@ async function c_tester(circomFile, _options) {
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 @@ async function c_tester(circomFile, _options) {
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")}` +