make.matrix errors

May 2 at 9:35 AM
Hi, I am doing Master program, and I need Pinocchio for my work
I set in App.py (to use polynomial, one-matrix and two-matrix), then I run "build-test-matrix.py", this worked fine, and "make -f make.matrix" but this command shows errors:

/tmp/ccwv9ni4.s: Assembler messages:
/tmp/ccwv9ni4.s:145: Error: operand type mismatch for push'
/tmp/ccwv9ni4.s:145: Error: operand type mismatch for
pop'
make.matrix:21: recipe for target 'build/qsp-test-two-matrix-p0.o' failed
make: *** [build/qsp-test-two-matrix-p0.o] Error 1

Can you help me on this?
Thank you
Coordinator
May 3 at 4:19 AM
Can you provide more context for your output? Or for your build environment in general? When I run make, I get:
code/ccompiler/input$ make
mkdir build
gcc -o build/make-random-header make-random-header.c
build/make-random-header build/random-header-4-28.h 4 28
python ../src/vercomp.py one-matrix.c --arith build/one-matrix-p0-b110.arith --bit-width 110 --cpparg _Ibuild/ _DPARAM=0 _DBIT_WIDTH=110 _include build/random-header-4-28.h --ignore-overflow True
...
At a guess, it sounds like there's a problem with your standard C compiler. We used gcc, so you may see different results with other compilers. You may also need to tailor the GetRDTSC call in qsp-test.c for your particular platform.
May 3 at 2:07 PM
Edited May 3 at 2:13 PM
Thank you for your response
I am using Cygwin64, run on Windows 10 Pro. I also installed cygwin32 toolchains as required.
In App.py, I set to use one-matrix and polynomial, so It would be as follow:
@classmethod
  def defaultApps(cls):
    apps = [#App("factorial"),
      #App("two-matrix", ignore_overflow=True),
      App("one-matrix", ignore_overflow=True),
      #App("eqtest")
      App("polynomial", ignore_overflow=True)
      #App("image-kernel"),
      #App("floyd"),
      #App("lgca", bitwidths=[32]),
      #App("sha", params=[0], bitwidths=[32], cached_construction=True),
      #App("sha", params=[1], bitwidths=[32], cached_construction=True),
      ]
    return apps
Then, I run ../ccompiler/src/build-test-matrix.py from ../ccompiler/input/. This worked fine !
After that, I run "make -f make.matrix" in ../ccompiler/input, but I got the errors

gcc -m32 -g -I../../common -Ibuild/ -o build/one-matrix-p0-b32 build/one-matrix-                                         p0-b32-native.o build/one-matrix-p0-b32-test.o build/qsp-test-one-matrix-p0.o bu                                         ild/wire-io.o build/print-matrix.o
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/gcc/x86_64-pc-cygwin/5.3.0//libgcc_s.dll.a when searchin                                         g for -lgcc_s
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/gcc/x86_64-pc-cygwin/5.3.0/libgcc_s.dll.a when searching                                          for -lgcc_s
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/gcc/x86_64-pc-cygwin/5.3.0//libgcc_s.dll.a when searchin                                         g for -lgcc_s
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/gcc/x86_64-pc-cygwin/5.3.0/libgcc_s.dll.a when searching                                          for -lgcc_s
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot                                          find -lgcc_s
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/gcc/x86_64-pc-cygwin/5.3.0//libgcc.a when searching for                                          -lgcc
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/gcc/x86_64-pc-cygwin/5.3.0//libgcc.a when searching for                                          -lgcc
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/gcc/x86_64-pc-cygwin/5.3.0/libgcc.a when searching for -                                         lgcc
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/gcc/x86_64-pc-cygwin/5.3.0/libgcc.a when searching for -                                         lgcc
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/gcc/x86_64-pc-cygwin/5.3.0//libgcc.a when searching for                                          -lgcc
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/gcc/x86_64-pc-cygwin/5.3.0/libgcc.a when searching for -                                         lgcc
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot                                          find -lgcc
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot                                          find -lcygwin
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/w32api/libadvapi32.a when searching for -ladvapi32
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/w32api/libadvapi32.a when searching for -ladvapi32
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/w32api/libadvapi32.a when searching for -ladvapi32
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot                                          find -ladvapi32
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/w32api/libshell32.a when searching for -lshell32
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/w32api/libshell32.a when searching for -lshell32
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/w32api/libshell32.a when searching for -lshell32
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot                                          find -lshell32
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/w32api/libuser32.a when searching for -luser32
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/w32api/libuser32.a when searching for -luser32
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/w32api/libuser32.a when searching for -luser32
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot                                          find -luser32
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/w32api/libkernel32.a when searching for -lkernel32
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/w32api/libkernel32.a when searching for -lkernel32
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/w32api/libkernel32.a when searching for -lkernel32
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot                                          find -lkernel32
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/gcc/x86_64-pc-cygwin/5.3.0//libgcc_s.dll.a when searchin                                         g for -lgcc_s
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/gcc/x86_64-pc-cygwin/5.3.0/libgcc_s.dll.a when searching                                          for -lgcc_s
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/gcc/x86_64-pc-cygwin/5.3.0//libgcc_s.dll.a when searchin                                         g for -lgcc_s
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/gcc/x86_64-pc-cygwin/5.3.0/libgcc_s.dll.a when searching                                          for -lgcc_s
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot                                          find -lgcc_s
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/gcc/x86_64-pc-cygwin/5.3.0//libgcc.a when searching for                                          -lgcc
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/gcc/x86_64-pc-cygwin/5.3.0//libgcc.a when searching for                                          -lgcc
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/gcc/x86_64-pc-cygwin/5.3.0/libgcc.a when searching for -                                         lgcc
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/gcc/x86_64-pc-cygwin/5.3.0/libgcc.a when searching for -                                         lgcc
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/gcc/x86_64-pc-cygwin/5.3.0//libgcc.a when searching for                                          -lgcc
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: skippin                                         g incompatible /usr/lib/gcc/x86_64-pc-cygwin/5.3.0/libgcc.a when searching for -                                         lgcc
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot                                          find -lgcc
collect2: error: ld returned 1 exit status
make.matrix:29: recipe for target 'build/one-matrix-p0-b32' failed
make: *** [build/one-matrix-p0-b32] Error 1
Because I run on 64-bit machine, so I put -m32 after all gcc in make.in and src/build-test-matrix.py
May 3 at 2:14 PM
Edited May 3 at 2:20 PM
I do as instructed in this

Hope to see your reply
Coordinator
May 4 at 6:16 AM
I'd suggest you start by running things using the 32-bit version of Cygwin, rather than 64-bit. There seems to be a problem with your 64-bit installation, as the lines you show above all mention x86_64-pc-cygwin, which I believe is the 64-bit toolchain, not the 32-bit. This step isn't really PInocchio specific. It's just trying to run gcc on some fairly generic C code. If you get to the point where you can do that in your Cygwin environment, then I would expect this step to work as well. This step is also just for the purposes of compiling the native version for performance comparison purposes. If you aren't interested in that, you could just comment out this step, so the cryptographic portions can run.
May 4 at 7:25 PM
Thank you for your support
I managed to run it under Ubuntu 16.04

Best reagards
Coordinator
May 5 at 5:06 AM
Great, glad to hear it! If you had to take any special steps, please feel free to post them here, so others can learn from your experience.
May 9 at 1:49 PM
I have another question.
About the one-matrix, as I compiled it into circuit, the values of matrix is fixed to [[2,2],[1,0]] (denoted in one-matrix,c,p). Is there any way to modify these values?
Same question for polynomial
Coordinator
May 9 at 5:06 PM
If you'd like a larger matrix, you can adjust the params setting in common/App.py, or you can directly change the values in one-matrix-ifc.h. The actual values in the matrix are chosen at random by running make-random-header.exe. The random header shows up in the build/ directory. If you want specific values, you can edit it there and then rebuild the circuit.
May 13 at 6:16 PM
Hi,
Is pinocchio-v0.5.3 the latest version you got? Because when I generate a polynomial with a degree of 100, I used the command
./pinocchio-v0.5.3.exe --qap --dv --file poly-100.arith --input poly-input.txt --output output --mem 4 --keys key --verify
but it still gives me a segmentation fault
Coordinator
May 13 at 11:22 PM
How many variables did you use for your polynomial? With k variables, and degree d, you're going to end up creating (d+1)^k terms. If you use more than 3 I suspect you're going to run into memory problems, which might result in a segmentation fault. I might suggest confirming that you can run with smaller settings before ramping up to larger ones.
May 14 at 12:39 PM
Edited May 14 at 2:27 PM
I only use 1 variable
and also, it seems the degree of 1000000 does not work properly? I tried but it did not generate me a circuit
Coordinator
May 18 at 4:24 AM
In common/App.py, I have:
if (params==None): params = [0]
and
App("polynomial", ignore_overflow=True)
uncommented. In polynomial-ifc.h, I have:
       #if PARAM==0
        #define DEGREE          100
        #define VARIABLES       1
        #define COEFFICIENTS 101    
In code/ccompiler/input, I run:
../src/build-test-matrix.py
Running:
pinocchio-v0.5.3.exe --qap --dv --file build/polynomial-p0-b32.arith --input build/poly-input.txt --output build/poly-output.txt --mem 4  --bits 32
succeeds.

Does that match what you've done? If not, you may want to adjust accordingly. In general, I'd recommend starting out with small existing examples and then gradually changing them and scaling them up.
May 19 at 12:55 PM
I can run this as well, but the point is --verify option, as mentioned in the discussion of azerty123