Commit Graph

188 Commits

Author SHA1 Message Date
Madars Virza 3dba4fa61e Include/exclude the right things.
Include *.tcc files in the list of files to be installed and exclude
tests and examples. The original commit got the CMake syntax wrong,
excluding *.tcc files and including examples.
2016-05-29 18:46:58 -04:00
Alexander Chernyakhovsky ab4d165854 Remove test targets from "all"
Since the tests take a while to compile and link, and install depends
on all, users would have to build the tests even if they don't need
them. Create a new "check" target that has the tests in it, and remove
the tests from all.
2016-05-29 17:40:05 -04:00
Madars Virza 5447786cd5 Fix typo in README. 2016-05-22 20:55:43 +03:00
Eran Tromer bb83c1ba95 README: minor fixes 2016-05-22 20:55:43 +03:00
Eran Tromer ab067ec9ae README: update description of dependencies and tested configurations 2016-05-22 20:55:43 +03:00
Eran Tromer 7873aec530 CMake: use CCache if available 2016-05-22 20:55:43 +03:00
Eran Tromer e8d4934813 Enable BINARY_OUTPUT by default 2016-05-22 20:55:43 +03:00
Eran Tromer 12352b60d4 CMake: add -DOPT=FLAGS=... 2016-05-22 20:55:43 +03:00
Eran Tromer e5cad8b352 CMake: don't build supercopy if WITH_SUPERCOP=OFF, and don't build BN128 dependencies if CURVE isn't BN128 2016-05-22 20:55:43 +03:00
Eran Tromer 0b3d563504 CMake: add flags for USE_ASM, BINARY_OUTPUT and MONTGOMERY_OUTPUT 2016-05-22 20:55:43 +03:00
Eran Tromer 5ecbab0a65 README: clarify build instructions 2016-05-22 20:55:43 +03:00
Eran Tromer a958bb7eb4 CMake: fix -DCURVE option 2016-05-22 20:55:43 +03:00
Eran Tromer d02974f60e CMake: fix -DPERFORMANCE 2016-05-22 20:55:43 +03:00
Eran Tromer c647e6217c README: clarify build instructions 2016-05-22 20:55:43 +03:00
Alexander Chernyakhovsky f5894bf774 Introduce a CMake-based build system
This change removes prepare-depends.sh and Makefile, replacing it with
a CMake-based build system and git submodules of the needed
dependencies.

Notably, this simplifies the build of libsnark to be just
  git clone --recursive git://github.com/scipr-lab/libsnark.git
  cd libsnark
  mkdir build && cd build && cmake .. && make

Since CMake also supports Ninja (apt-get install ninja-build on Debian
and derivatives), an even faster build could be obtained by using
  cmake -GNinja .. && ninja

README.md has been updated to reflect the new build system.

All options supported by the Makefile are also supported by the CMake.

As an added benefit, users of libsnark can embed libsnark as a git
submodule and add it to their CMakeLists.txt, without having to
install it.

This change is a rebase of the earlier patch sent to the scipr-lab
developers, updated for new features introduced since then.
2016-05-22 20:55:43 +03:00
Eran Tromer c833e32605 Mark additional intentionally unused arguments as such. 2016-05-22 20:55:16 +03:00
Madars Virza 98feb46e31 Raise an exception of getBit() is used with incompatible field type.
This fixes #23.
2016-05-22 20:55:08 +03:00
Madars Virza 183859120d Add a missing check for linear_combination::is_valid(). 2016-05-22 20:55:03 +03:00
Madars Virza c7177e61fc Fix signed/unsigned integer comparisons in gadgetlib2 tests. 2016-05-22 20:54:57 +03:00
Madars Virza b8a82cb2ca Mark intentionally unused arguments as such. 2016-05-22 20:54:42 +03:00
Madars Virza 7b7d7afc99 Add more debug assertions for multi-exponentiation. 2016-05-22 20:54:35 +03:00
Eran Tromer ea7c5468af Merge pull request #35 from ThisIsNotOfficialCodeItsJustForks/add-iota-header
Include header required for std::iota.
2016-05-22 20:42:01 +03:00
Taylor Hornby c437365ec9 Include header required for std::iota. 2016-05-18 10:49:58 -06:00
Madars Virza 0896e82163 Add static library files to .gitignore 2016-04-06 20:42:02 -04:00
Madars Virza 30dd11ddc5 Add pp-zkSNARK with security proof in the generic group model, based on [Gro16]. 2016-04-06 20:40:51 -04:00
Eran Tromer 0b928a7b36 README.md: comment about OMP_NUM_THREADS 2015-11-23 18:45:31 +02:00
Madars Virza 40fb45d2dd backtrace is glibc-specific extension, so only use it when available.
This fixes building libsnark on musl libc-based Linux systems such as
Alpine Linux.
2015-10-30 20:55:26 -07:00
Eran Tromer 69f312f149 Avoid need for "-lzm" when linking, by including libzm.a into libsnark.a and libsnark.so.
This means users of libsnark no longer need to remember to add -lzm if and only if libsnark was built with CURVE=B128.

'make install' now installs library files selectively (libsnark.* and maybe supercop.a but not libzm.a).
2015-10-17 16:51:20 +03:00
Eran Tromer 12a6214c05 README: avoid # signs that confuse markdown_py 2015-10-17 16:47:48 +03:00
Eran Tromer 5494e838e5 README.md: add explanations about using libsnark as a library 2015-10-15 04:39:03 +03:00
Eran Tromer 4c6d456652 Makefile: minor cleanup 2015-10-15 04:39:03 +03:00
Eran Tromer a19e4f2ff0 Makefile: build libsnark.a once and then reuse it for libsnark.so and all executables
This get much cleaner and shorter g++ commands during build, and removes some possibly-buggy dependencies.
2015-10-15 03:42:04 +03:00
Eran Tromer 3f202f173a Makefile: fix `make install` (issue #15, fixing commit 001b8cbb8d) and other small Makefile fixes. 2015-10-14 02:04:03 +03:00
Eran Tromer 001b8cbb8d Makefile: fix $(LIB_OBJS) in `make install`. This fixed issue #15. 2015-10-13 23:59:04 +03:00
Madars Virza d69bc496e5 Fix a typo in the Makefile. This fixes #14. 2015-10-13 13:16:47 -07:00
Eran Tromer 12c6e21658 Extend profiling code to print parallelism (CPU_time / real_time).
Also tweak formatting formatting of block entry to drop "[0]} and better align with block exit.
Tested only on Linux, might generate compile or (informative) runtime errors on other platforms.
2015-10-13 14:09:38 +03:00
Eran Tromer 8a7512af33 Minor addition to profiling output: annotate whole FFTs (including multiplication by coset, etc.) 2015-10-13 14:09:38 +03:00
Eran Tromer 321a3b687d Use *all* cores for batch/multiexponentiation (was capped at 4).
This speeds up proving by x1.4 to x1.6 on several tested platforms with 6 or 8 cores.
2015-10-13 14:07:41 +03:00
Eran Tromer e2f9fe2949 Makefile fix (*.d cleaning was broken) 2015-10-04 20:26:36 +03:00
Eran Tromer 0c9bd4e205 Makefile fixes
* Use and clean up .d(ependency) files for executables's objects too.
* Rename OBJS and SRCS to LIB_OBJS and LIB_SRCS to clarify these don't include executables.
* Also, add index to libsnark.a and allow it as a target even if doing a non-static build.
2015-10-04 04:26:38 +03:00
Eran Tromer 032f8b1858 Makefile fixes
- Avoid unnecessarily rebuilding executables with unchanged dependencies (bug introduced by commit 998a2373)
- Avoid unnecessarily rebuilding GTest
- Tweak spacing and comments
2015-10-03 18:28:04 +03:00
Eran Tromer fcc4e584a5 "make clean" fix: also delete files that wouldn't be compiled due to NO_{GTEST,SUPERCOP} flags 2015-10-03 06:58:18 +03:00
Eran Tromer e42b38fdae Makefile: use -O3 in PERFORMANCE=1 2015-10-03 04:21:23 +03:00
Eran Tromer 51a5e1c4bd Makefile fix: use our custom g++ rule for executable's .o files too.
This adds the missing -MMD (to trigger recompilation when headers change) and beautifies the parameter order.
2015-10-03 04:21:23 +03:00
Eran Tromer 47ed57669e README.md tweaks 2015-10-03 04:21:23 +03:00
Eran Tromer 2e6fd83e3b README.md updates:
- Reflect many of the recent additions and refactoring in libsnark
  (at least at the level of brief mentions and pointers).
- More build instructions/hints.
- Minor cleanups.
2015-10-02 14:27:44 -04:00
Eran Tromer 998a23735a Makefile and prepare-depends improvements
- Refactor CXXFLAGS so that feature flags and optimization flags can be easily overriden from command line
- Add NO_SUPERCOP=1 option
- Avoid need to manually create ./depinst directory when ./prepare-depends is not needed (i.e., when BN128 and SUPERCOP are not used)
- Fix the flags for static build
- Build executables that need GTest even if we used an existing GTest rather than compiling it
- Minor cleanups and comments
2015-10-02 14:27:44 -04:00
Eran Tromer f403f084dc Fixed 32-bit compilation (std::max needs compatible arguments) 2015-10-02 14:27:44 -04:00
Eran Tromer b9f5cc0611 Fix building with CURVE=MNT4 and CURVE=MNT6 2015-10-02 14:27:44 -04:00
Madars Virza c0699fa8c4 Merge pull request #11 from mbbarbosa/adsnark
adsnark extension to libsnark
2015-09-09 22:23:36 -04:00