Giter Site home page Giter Site logo

c2mpc's People

Contributors

mkskeller avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

btautist sbellem

c2mpc's Issues

Unable to run user defined program

I'm attempting to run my own program using the provided docker file. However, I'm running into issues doing so.

Here is the program (regex.c) in question:

#include <stdio.h>

int match(char* YYCURSOR) {
    char* YYMARKER;

    while (1) {
        char yych;

        yych = *YYCURSOR;
        switch (yych) {
            case 'a':
                goto yy2;
            default:
                goto yy5;
        }

yy2:
    ++YYCURSOR;
    yych = *YYCURSOR;
    switch (yych) {
        case 'b':
            goto yy2;
        case 'c':
        case 'd':
            goto yy7;
        default:
            goto yy4;
    }
yy4:
yy5:
    ++YYCURSOR;
    {return 0;}
yy7:
    ++YYCURSOR;
    {return 1;}

    }
}

int main() {
    char* test = "a";
    long res = match(test);


    return res;
}

Here is the modified Dockerfile:

FROM ubuntu:14.04
RUN apt-get update
RUN apt-get install -y clang-3.3 llvm-3.3 python3.5 python3-pip wget
RUN LLVM_CONFIG_PATH=/usr/bin/llvm-config-3.3 pip3 install llvmpy
RUN wget https://github.com/data61/MP-SPDZ/releases/download/v0.2.6/mp-spdz-0.2.6.tar.xz
RUN tar xJvf mp-spdz-0.2.6.tar.xz
RUN ln -s mp-spdz-0.2.6 mp-spdz
ADD machine.py mp-spdz/Compiler
ADD compile.sh *.c mcompile.py ./
RUN OPT=opt-3.3 ./compile.sh -N 10 -o mp-spdz/Programs/Source regex.c
WORKDIR mp-spdz
RUN python3.5 ./compile.py regex.c10 --insecure
RUN Scripts/tldr.sh
RUN Scripts/setup-ssl.sh
RUN Scripts/rep-field.sh regex.c10

Here is the error I get when running the modified Dockerfile:

Step 12/15 : RUN python3.5 ./compile.py regex.c10 --insecure
 ---> Running in aa12cead5fc2
Default bit length: 64
Default security parameter: 40
Compiling file /mp-spdz-0.2.6/Programs/Source/regex.c10.mpc
Traceback (most recent call last):
  File "./compile.py", line 109, in <module>
    main()
  File "./compile.py", line 106, in main
    compilation()
  File "./compile.py", line 94, in compilation
    prog = Compiler.run(args, options)
  File "/mp-spdz-0.2.6/Compiler/compilerLib.py", line 28, in run
    exec(compile(open(prog.infile).read(), prog.infile, 'exec'), VARS)
  File "/mp-spdz-0.2.6/Programs/Source/regex.c10.mpc", line 49
    <function BasicBlock.store_direct.<locals>.<lambda> at 0x7f669ff58268> , # 26
    ^
SyntaxError: invalid syntax
The command '/bin/sh -c python3.5 ./compile.py regex.c10 --insecure' returned a non-zero code: 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.