diff --git a/Programs/Source/test_args.mpc b/Programs/Source/test_args.mpc new file mode 100644 index 00000000..88a3a803 --- /dev/null +++ b/Programs/Source/test_args.mpc @@ -0,0 +1,31 @@ +from Compiler.library import print_ln +from Compiler.types import Matrix, sint +from Compiler.compilerLib import Compiler + + +usage = "usage: %prog [options] [args]" +compiler = Compiler(usage=usage) +compiler.parser.add_option("--rows", dest="rows") +compiler.parser.add_option("--columns", dest="columns") +compiler.parse_args() +if not compiler.options.rows: + compiler.parser.error("--rows required") +if not compiler.options.columns: + compiler.parser.error("--columns required") + + +@compiler.register_function('testmpc') +def main(compiler): + numrows = int(compiler.options.rows) + numcolumns = int(compiler.options.columns) + rows = range(numrows) + reports = Matrix(numrows, numcolumns, sint) + reports.assign_vector( + sint.get_input_from(0, size=numrows * numcolumns) + ) + for row in rows: + print_ln(f"report[{row}]: %s", reports[row].reveal()) + + +if __name__ == "__main__": + compiler.compile_func() diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..5e850bc5 --- /dev/null +++ b/setup.py @@ -0,0 +1,7 @@ +from setuptools import setup, find_packages + +setup( + name='mp-spdz-compiler', + version='0.1.0', + packages=find_packages(include=['Compiler', 'Compiler.*']) +)