initc3 / HoneyBadgerMPC

Robust MPC-based confidentiality layer for blockchains
GNU General Public License v3.0
131 stars 64 forks source link

Error at setup.py #375

Closed liorko87 closed 4 years ago

liorko87 commented 5 years ago

I'm trying to build the package by using make dist. During the build, I received this error:

python setup.py sdist bdist_wheel
  File "setup.py", line 58
    long_description = f"\n{f.read()}"
                                     ^
SyntaxError: invalid syntax
Makefile:76: recipe for target 'dist' failed
make: *** [dist] Error 1

When I changed these lines at Makefile, it works:

git diff Makefile
diff --git a/Makefile b/Makefile
index 3e93846..5c54f4c 100644
--- a/Makefile
+++ b/Makefile
@@ -73,11 +73,11 @@ release: clean ## package and upload a release
        twine upload dist/*

 dist: clean ## builds source and wheel package
-       python setup.py sdist bdist_wheel
+       python3 setup.py sdist bdist_wheel
        ls -l dist

 install: clean ## install the package to the active Python's site-packages
-       python setup.py install
+       python3 setup.py install

 ipc:
        sh scripts/launch_ipc.sh

Python version: Python 3.6.8 (default, Aug 20 2019, 17:12:48)

During the execution of the script, I received another error:

building 'honeybadgermpc.ntl._hbmpc_ntl_helpers' extension
creating build/temp.linux-x86_64-3.6/honeybadgermpc
creating build/temp.linux-x86_64-3.6/honeybadgermpc/ntl
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I./honeybadgermpc/ntl -I/usr/include/python3.6m -c honeybadgermpc/ntl/hbmpc_ntl_helpers.cpp -o build/temp.linux-x86_64-3.6/honeybadgermpc/ntl/hbmpc_ntl_helpers.o -std=c++11 -O3 -pthread -fopenmp -march=native
In file included from honeybadgermpc/ntl/hbmpc_ntl_helpers.cpp:654:0:
honeybadgermpc/ntl/rsdecode_impl.h:19:1: error: ‘mutex’ does not name a type
 mutex _interp_mutex;
sanket1729 commented 5 years ago

Hi, we usually encourage docker based deployment for trying to HoneyBadgerMPC. A couple of comments when using python3.7. This is being fixed in #376, but I would highly recommend trying out the docker install instructions

liorko87 commented 5 years ago

Hi @sanket1729 , I changed the line as you suggested but I received a different error as I stated above:

building 'honeybadgermpc.ntl._hbmpc_ntl_helpers' extension
creating build/temp.linux-x86_64-3.6/honeybadgermpc
creating build/temp.linux-x86_64-3.6/honeybadgermpc/ntl
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I./honeybadgermpc/ntl -I/usr/include/python3.6m -c honeybadgermpc/ntl/hbmpc_ntl_helpers.cpp -o build/temp.linux-x86_64-3.6/honeybadgermpc/ntl/hbmpc_ntl_helpers.o -std=c++11 -O3 -pthread -fopenmp -march=native
In file included from honeybadgermpc/ntl/hbmpc_ntl_helpers.cpp:654:0:
honeybadgermpc/ntl/rsdecode_impl.h:19:1: error: ‘mutex’ does not name a type
 mutex _interp_mutex;

I cannot use docker because I'm doing benchmark to my protocol.

sanket1729 commented 5 years ago

Hi @liorko87 can you check out #376 for building this? I think that fixes your issue?

In particular, did you change include the #include line?

sanket1729 commented 5 years ago

@liorko87 Can you test with the latest master?

liorko87 commented 5 years ago

@sanket1729 I pulled the latest version from the dev branch. I got another error this time:

build/temp.linux-x86_64-3.6/lib_solver.cpp:496:10: fatal error: flint/flint.h: No such file or directory
 #include <flint/flint.h>
sanket1729 commented 4 years ago

This is needed otherwise the build for the power sum solver will fail.This is a known issue in the version of libflint-dev in apt. https://github.com/wbhart/flint2/issues/217 Can you run sed -i '30c #include "flint/flint.h"' /usr/include/flint/flintxx/flint_classes.h

liorko87 commented 4 years ago

Thanks it works after I run your command and sudo apt install libflint