pepper-project / pequin

A system for verifying outsourced computations, and applying SNARKs. Simplified release of the main Pepper codebase.
Other
122 stars 46 forks source link

Gadget compilation fails #28

Closed cnasikas closed 5 years ago

cnasikas commented 5 years ago

Hi,

The command make gadget fails with the following message

g++ -m64 -std=c++11 -DCURVE_ALT_BN128 -DBN_SUPPORT_SNARK -DBINARY_OUTPUT -DMONTGOMERY_OUTPUT -DNO_PROCPS -DUSE_ASM -DDB_NUM_ADDRESSES=1024 -DDB_HASH_NUM_BITS=1216 -DRAM_CELL_NUM_BITS=32 -DFAST_RAM_WORD_WIDTH=64 -DFAST_RAM_ADDRESS_WIDTH=32 -DFOLDER_TMP=\"/tmp/vagrant/tmp_state\" -UBINARY_OUTPUT -DNAME=\"\" -I./include -I. -I/home/vagrant/pepper_deps/include -I../thirdparty/libsnark -I../thirdparty/libsnark/depends/libff -I../thirdparty/libsnark/depends/libfqfft  ext_gadget_bridge.cpp  -o bin/gadget.o  obj/common/sha1.o  obj/common/sha256.o  obj/common/utility.o  obj/common/measurement.o  obj/common/mpnvector.o  obj/common/mpnclass.o  obj/common/mpnops.o  obj/common/math.o  obj/common/memory.o  obj/common/waksman_router.o   obj/storage/hasher.o  obj/storage/ram_impl.o  obj/storage/kyoto_block_store.o  obj/storage/leveldb_block_store.o  obj/storage/configurable_block_store.o  obj/storage/null_hash.o  obj/storage/ggh_hash.o  obj/storage/exo.o  obj/storage/db_util.o  obj/storage/external_sort.o  obj/storage/db_block_store.o  obj/include/db.o  obj/include/binary_tree.o  obj/include/binary_tree_int_int.o  obj/include/binary_tree_int_hash_t.o  obj/include/fix_t.o  obj/include/avl_tree.o  obj/libv/computation_p.o  obj/libv/exogenous_checker.o  -L/home/vagrant/pepper_deps/lib -L../thirdparty/libsnark/build/libsnark -L../thirdparty/libsnark/build/depends/libff/libff -L../thirdparty/libsnark/build/depends -lsnark -lff -lzm -lgmp -lgmpxx -lpapi -lrt -lleveldb -lkyotocabinet -Wl,-rpath,/home/vagrant/pepper_deps/lib/
cc -L/home/vagrant/pepper_deps/lib -L../thirdparty/libsnark/build/libsnark -L../thirdparty/libsnark/build/depends/libff/libff -L../thirdparty/libsnark/build/depends -lsnark -lff -lzm -lgmp -lgmpxx -lpapi -lrt -lleveldb -lkyotocabinet -Wl,-rpath,/home/vagrant/pepper_deps/lib/  gadget.o   -o gadget
cc: error: gadget.o: No such file or directory
<builtin>: recipe for target 'gadget' failed
make: *** [gadget] Error 1

The problem seems to be in second line cc - ... gadget.o -o gadget. Should the gadget.o be bin/gadget.o?

I haven't edited ext_gadget_bridge.cpp or any other relevant files. Also @jimouris faces the same problem.

@fleupold Can you provide detailed steps on how to run your PR #20?

Thanks in advance

fleupold commented 5 years ago

You have to call make with the corresponding gadgetID.

E.g. make gadget0 will create /bin/gadget0, which can be called in your pepper code using ext_gadget(..., 0);

I'll add this clarification to the readme.

jimouris commented 5 years ago

@fleupold Thanks for the clarification, make gadget0 works fine.

cnasikas commented 5 years ago

Thanks a lot!