Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change include paths to rely on standard system include paths when installed. #22

Open
nathan-at-least opened this issue Dec 22, 2015 · 0 comments

Comments

@nathan-at-least
Copy link

The #include directives assume that the directory ./src/ or the installed directory $(PREFIX)/include/libsnark (see Makefile L282 at 0b928a7b (latest on branch master)) are on the include path. This is non-standard and complicates detecting this library with GNU autoconf.

The zcash configure.ac L704-L718 at 108650a5 (latest on branch zc.v0.11.2.latest) demonstrates the difficulty of working around this issue for dependent programs that use autoconf:

# libsnark header layout is broken unless cpp's -I is passed with the
# libsnark directory, so for now we use this hideous workaround:
echo 'Hunting for libsnark include directory...'
[LIBSNARK_INCDIR="$(echo "$CPPFLAGS" | sed 's,^.*-I\([^ ]*/include\).*$,\1/libsnark,')"]
if test -d "$LIBSNARK_INCDIR"; then
   echo "Found libsnark include directory: $LIBSNARK_INCDIR"
else
    AC_MSG_ERROR(libsnark include directory not found)
fi

CPPFLAGS="-I$LIBSNARK_INCDIR $CPPFLAGS"

# Now check for libsnark compilability using traditional autoconf tests:
AC_CHECK_HEADER([libsnark/gadgetlib1/gadget.hpp],,AC_MSG_ERROR(libsnark headers missing))
AC_CHECK_LIB([snark],[main],LIBSNARK_LIBS=-lsnark, [AC_MSG_ERROR(libsnark missing)], [-lgmpxx])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants