libsnark-tutorial
libsnark-tutorial copied to clipboard
Missing step to `git submodule init && git submodule update`
Following the tutorial directly, I had to do this step before the step to build with cmake.
If you try to build and see that libsnark is missing a CMakeLists.txt file then you should run git submodule init && git submodule update after git clone.
This is on macOS but shouldn't matter.
This comment is macOS specific -- for those following along on that OS:
https://github.com/scipr-lab/libsnark/issues/99 https://github.com/scipr-lab/libsnark/issues/86
I had to also manually go into /depends/libsnark and git submodule init && git submodule update to fetch the transitive deps FYI
Ok -- for completeness sake and anyone having issues. You'll need to brew install anything missing and do the submodule dance I described above.
Then, here is what I used to get it to finally build:
LD_LIBRARY_PATH=/usr/local/opt/openssl/lib:"${LD_LIBRARY_PATH}"
CPATH=/usr/local/opt/openssl/include:"${CPATH}"
PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig:"${PKG_CONFIG_PATH}"
export LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH
CPPFLAGS=-I/usr/local/opt/openssl/include LDFLAGS=-L/usr/local/opt/openssl/lib PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig cmake -DWITH_PROCPS=OFF -DWITH_SUPERCOP=OFF -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ ..
And while this sounds silly, the first time I ran the cmake command it failed, but then I ran it a second time and it was all good. Now, running the tests seems to be passing!
On Ubuntu (inside libsnark docker) I had to do
git submodule update --init --recursive