Issue with building libsnark as a library

95 views
Skip to first unread message

Hasini Gunasinghe

unread,
Jan 24, 2018, 12:30:20 PM1/24/18
to libsnark
Hi All,

I am trying to build libsnark as a library, in order to link it to my application. I followed the instructions given in the README file, however I am facing the same issue over and over even though I tried several workarounds. I would highly appreciate any insights in resolving this issue.

I was able to compile libsnark source successfully on Mac OS Sierra (10.12.6) with the command: 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

Ho
wever, when I try to build it as a library, using the command given in README file: DESTDIR=/install/path make install, I get the following error:

libsnark/depends/libsnark-supercop/src/crypto_core/aes128encrypt/openssl/core.c:1:10: fatal error: 'openssl/aes.h' file not found
#include <openssl/aes.h>

I understand this is because the build system can not find the openssl location on Mac. I supplied the CFLAGS and LDFLAGS to the make command
as I did in the cmake command above. However, it still gives the same error. I also tried setting those flags using export command which does
not work either.
I tried disabling the building of supercop with
WITH_SUPERCOP=OFF, as mentioned in the README file. The command I tried for this is: DESTDIR=../../myfirstZKSNARK/ make install WITH_SUPERCOP=OFF. However, it does not seem to disable building libsnark-supercop. There should be something wrong with my command.

Any insights on resolving this issue is highly appreciated.

Thank you.
Hasini.

Hasini Gunasinghe

unread,
Jan 25, 2018, 2:45:37 PM1/25/18
to libsnark
This is to update that I was able to build libsnark as a library by combining the cmake command for compiling and make command for installing the library together and supplying the flags and options to the cmake command, instead of trying to run the make command separately as mentioned in the Readme file. Following is the command that worked for me, in order to build and install the library:

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 && DESTDIR=../../myfirstZKSNARK/ make install

Thanks,
Hasini.
Reply all
Reply to author
Forward
0 new messages