iden3 / circom

zkSnark circuit compiler
GNU General Public License v3.0
1.29k stars 245 forks source link

Build faild on macos m2max cmd :circom fibonacci.circom --r1cs --wasm --sym #280

Open lipangit opened 1 month ago

lipangit commented 1 month ago

pragma circom 2.0.6; template fibonacci(n) { signal input fib1; signal input fib2; signal output fibn; var a = fib1; var b = fib2; var c; for (var i = 2; i[angle brackets]n; i++) { c = a + b; a = b; b = c; } // Set the output fibn [angle brackets]== c * fib1; log(); } component main = fibonacci(1000);

log : Error: Parse error on line 1: pragma circom 2.0.6;template fibon ----------------^ Expecting 'EOF', 'function', 'IDENTIFIER', '(', ')', 'template', ',', 'if', 'else', 'for', ';', 'while', 'do', 'compute', 'return', 'include', '{', '}', '==>', '-->', '===', '?', ':', '||', '&&', '|', '^', '&', '==', '!=', '<=', '>=', '<', '>', '<<', '>>', '+', '-', '*', '/', '\', '%', '*', '++', '--', '!', '~', 'DECNUMBER', 'HEXNUMBER', 'var', 'signal', 'component', '[', ']', got '.' at Parser.parseError (/Users/lipan/.nvm/versions/node/v18.20.3/lib/node_modules/circom/parser/jaz.js:620:21) at Parser.parse (/Users/lipan/.nvm/versions/node/v18.20.3/lib/node_modules/circom/parser/jaz.js:687:22) at constructionPhase (/Users/lipan/.nvm/versions/node/v18.20.3/lib/node_modules/circom/src/construction_phase.js:79:22) at compile (/Users/lipan/.nvm/versions/node/v18.20.3/lib/node_modules/circom/src/compiler.js:71:5) at run (/Users/lipan/.nvm/versions/node/v18.20.3/lib/node_modules/circom/cli.js:119:11) at Object. (/Users/lipan/.nvm/versions/node/v18.20.3/lib/node_modules/circom/cli.js:140:1) at Module._compile (node:internal/modules/cjs/loader:1364:14) at Module._extensions..js (node:internal/modules/cjs/loader:1422:10) at Module.load (node:internal/modules/cjs/loader:1203:32) at Module._load (node:internal/modules/cjs/loader:1019:12) Parse error on line 1: pragma circom 2.0.6;template fibon ----------------^ Expecting 'EOF', 'function', 'IDENTIFIER', '(', ')', 'template', ',', 'if', 'else', 'for', ';', 'while', 'do', 'compute', 'return', 'include', '{', '}', '==>', '-->', '===', '?', ':', '||', '&&', '|', '^', '&', '==', '!=', '<=', '>=', '<', '>', '<<', '>>', '+', '-', '', '/', '\', '%', '**', '++', '--', '!', '~', 'DECNUMBER', 'HEXNUMBER', 'var', 'signal', 'component', '[', ']', got '.'

I can not build any circom file on my computer, quick start can not build, remix.ethereum.org works well.

lishiqian2333 commented 1 month ago

I removed the first line and it compiled: “pragma circom 2.0.6;” But after deleting it and compiling again no corresponding js file is generated