libsnark-tutorial icon indicating copy to clipboard operation
libsnark-tutorial copied to clipboard

Missing step to `git submodule init && git submodule update`

Open ralexstokes opened this issue 7 years ago • 4 comments

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.

ralexstokes avatar Oct 14 '18 20:10 ralexstokes

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

ralexstokes avatar Oct 14 '18 20:10 ralexstokes

I had to also manually go into /depends/libsnark and git submodule init && git submodule update to fetch the transitive deps FYI

ralexstokes avatar Oct 15 '18 17:10 ralexstokes

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!

ralexstokes avatar Oct 15 '18 17:10 ralexstokes

On Ubuntu (inside libsnark docker) I had to do

git submodule update --init --recursive

udibr avatar Mar 05 '19 19:03 udibr