GithubHelp home page GithubHelp logo

meilof / python-libsnark Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 4.0 153 KB

Python bindings for a minimal subset of libsnark

License: MIT License

Python 6.28% C++ 78.58% Batchfile 0.12% SWIG 15.02%

python-libsnark's People

Contributors

meilof avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

python-libsnark's Issues

Problem installing on Linux

I'm having trouble installing on Ubuntu 20.04.3 with pip install python-libsnark.
Here's the full output. Any ideas what's happening?

Collecting python-libsnark
  Using cached python-libsnark-0.3.3.tar.gz (61 kB)
Building wheels for collected packages: python-libsnark
  Building wheel for python-libsnark (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/circleci/.pyenv/versions/3.7.11/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o8uun16k/python-libsnark_1f40ce2c0e5b44d28aaf4b033636ea82/setup.py'"'"'; __file__='"'"'/tmp/pip-install-o8uun16k/python-libsnark_1f40ce2c0e5b44d28aaf4b033636ea82/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-7up1st2b
       cwd: /tmp/pip-install-o8uun16k/python-libsnark_1f40ce2c0e5b44d28aaf4b033636ea82/
  Complete output (22 lines):
  * To update the wrapper, use swig -python -c++ -o alt_bn128_wrap.cpp libsnark.i
  sh: 1: swig: not found
  /home/circleci/.local/lib/python3.7/site-packages/setuptools/dist.py:700: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
    % (opt, underscore_opt))
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.7
  creating build/lib.linux-x86_64-3.7/libsnark
  copying ./__init__.py -> build/lib.linux-x86_64-3.7/libsnark
  copying ./alt_bn128.py -> build/lib.linux-x86_64-3.7/libsnark
  copying ./setup-win32.py -> build/lib.linux-x86_64-3.7/libsnark
  running build_ext
  building 'libsnark._alt_bn128' extension
  creating build/temp.linux-x86_64-3.7
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/circleci/.pyenv/versions/3.7.11/include/python3.7m -c alt_bn128_wrap.cpp -o build/temp.linux-x86_64-3.7/alt_bn128_wrap.o -std=c++14 -Wno-sign-compare -Wno-delete-non-virtual-dtor -Wno-unused-variable -DCURVE_ALT_BN128 -DBN_SUPPORT_SNARK=1 -DMONTGOMERY_OUTPUT -DNO_PROCPS -I/usr/local/Cellar/[email protected]/1.1.1i/include
  alt_bn128_wrap.cpp:2827:10: fatal error: libff/algebra/curves/alt_bn128/alt_bn128_pp.hpp: No such file or directory
   2827 | #include <libff/algebra/curves/alt_bn128/alt_bn128_pp.hpp>
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for python-libsnark
  Running setup.py clean for python-libsnark
Failed to build python-libsnark
Installing collected packages: python-libsnark
    Running setup.py install for python-libsnark ... error
    ERROR: Command errored out with exit status 1:
     command: /home/circleci/.pyenv/versions/3.7.11/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o8uun16k/python-libsnark_1f40ce2c0e5b44d28aaf4b033636ea82/setup.py'"'"'; __file__='"'"'/tmp/pip-install-o8uun16k/python-libsnark_1f40ce2c0e5b44d28aaf4b033636ea82/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-i5ql3xbr/install-record.txt --single-version-externally-managed --compile --install-headers /home/circleci/.pyenv/versions/3.7.11/include/python3.7m/python-libsnark
         cwd: /tmp/pip-install-o8uun16k/python-libsnark_1f40ce2c0e5b44d28aaf4b033636ea82/
    Complete output (22 lines):
    * To update the wrapper, use swig -python -c++ -o alt_bn128_wrap.cpp libsnark.i
    sh: 1: swig: not found
    /home/circleci/.local/lib/python3.7/site-packages/setuptools/dist.py:700: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
      % (opt, underscore_opt))
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    creating build/lib.linux-x86_64-3.7/libsnark
    copying ./__init__.py -> build/lib.linux-x86_64-3.7/libsnark
    copying ./alt_bn128.py -> build/lib.linux-x86_64-3.7/libsnark
    copying ./setup-win32.py -> build/lib.linux-x86_64-3.7/libsnark
    running build_ext
    building 'libsnark._alt_bn128' extension
    creating build/temp.linux-x86_64-3.7
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/circleci/.pyenv/versions/3.7.11/include/python3.7m -c alt_bn128_wrap.cpp -o build/temp.linux-x86_64-3.7/alt_bn128_wrap.o -std=c++14 -Wno-sign-compare -Wno-delete-non-virtual-dtor -Wno-unused-variable -DCURVE_ALT_BN128 -DBN_SUPPORT_SNARK=1 -DMONTGOMERY_OUTPUT -DNO_PROCPS -I/usr/local/Cellar/[email protected]/1.1.1i/include
    alt_bn128_wrap.cpp:2827:10: fatal error: libff/algebra/curves/alt_bn128/alt_bn128_pp.hpp: No such file or directory
     2827 | #include <libff/algebra/curves/alt_bn128/alt_bn128_pp.hpp>
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/circleci/.pyenv/versions/3.7.11/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o8uun16k/python-libsnark_1f40ce2c0e5b44d28aaf4b033636ea82/setup.py'"'"'; __file__='"'"'/tmp/pip-install-o8uun16k/python-libsnark_1f40ce2c0e5b44d28aaf4b033636ea82/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-i5ql3xbr/install-record.txt --single-version-externally-managed --compile --install-headers /home/circleci/.pyenv/versions/3.7.11/include/python3.7m/python-libsnark Check the logs for full command output.

PEP 517 Supported Builds

Problem

The pyproject.toml format, defined in PEP 518 and elaborated in here has become the dominant interface for packaging. PEP 517 build systems, such as poetry-core and its build backend poetry.core.masonry.api are unable to install python-libsnark via the PyPi package as well as direct from source given that python-libsnark does not currently support PEP 517 builds. So far, even direct pip installs into environments which were managed by Poetry are also failing.

Proposed Next Steps

Utilizing setuptools to help with compatibility it appears that utilizing the existing setup.py is still an option as long as a minimal pyproject.toml is present and the project metadata is present. See Building Extension Modules on the setuptools documentation for a reference. Additional backwards compatibility with setup.py and setup.cfg methods while supporting PEP 517 systems can be seen in the pip repository.

It seems that this should help in maintaining backwards compatibility while supporting modern build systems. As such I would propose a minor version bump, pushing the version to 0.4.0 given that PEP 517 build is the added functionality, and a dividing line would be formed between PEP 517 and non-PEP 517 builds of python-libsnark

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.