Skip to content

Commit

Permalink
Merge pull request #70 from DeckerSU/patch-remove-libsnark
Browse files Browse the repository at this point in the history
Remove libsnark, libgmp, mini-gmp
  • Loading branch information
DeckerSU authored Jun 13, 2024
2 parents e2a182c + a305967 commit f7ab5f6
Show file tree
Hide file tree
Showing 191 changed files with 1,092 additions and 55,440 deletions.
11 changes: 5 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ src/zcash-gtest
src/zcash-tx
src/test/test_bitcoin

# Zcash utilities
src/zcash/GenerateParams
src/zcash/CreateJoinSplit

*zcashTest.pk
*zcashTest.vk

Expand Down Expand Up @@ -40,6 +36,7 @@ src/config/bitcoin-config.h
src/config/bitcoin-config.h.in
src/config/stamp-h1
share/setup.nsi
src/cryptoconditions/src/cryptoconditions-config.h.in

cache/
venv-mnf/
Expand All @@ -48,7 +45,7 @@ venv-mnf/
.dirstamp
.libs
.*.swp
*.*~*
*~
*.bak
*.rej
*.orig
Expand Down Expand Up @@ -134,5 +131,7 @@ src/komodod
src/qt/komodo-qt

# chain files for iguana
src/qt/*_7776
src/*_7776
*_7776

releases/
12 changes: 1 addition & 11 deletions KomodoOceanGUI.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ TEMPLATE = app
TARGET = KomodoOceanGUI
VERSION = 0.1.0.0

INCLUDEPATH += src src\qt src\libsnark src\protobuf src\secp256k1 src\secp256k1\include src\leveldb\include src\leveldb\helpers\memenv src\leveldb src\univalue\include src\libevent\include src\libevent\compat src\cryptoconditions\include src\cryptoconditions src\cryptoconditions\src\asn
INCLUDEPATH += src src\qt src\protobuf src\secp256k1 src\secp256k1\include src\leveldb\include src\leveldb\helpers\memenv src\leveldb src\univalue\include src\libevent\include src\libevent\compat src\cryptoconditions\include src\cryptoconditions src\cryptoconditions\src\asn

MINIUPNPC_INCLUDE_PATH = src\miniupnpc

windows:INCLUDEPATH += depends\libgmp_6.1.1_msvc14\include
windows:INCLUDEPATH += depends\BDB_6.2.32\include depends\db-6.2.23\build_windows
windows:INCLUDEPATH += depends\libsodium-1.0.15-msvc\include
windows:INCLUDEPATH += depends\boost_1_65_1 depends\boost_1_65_1\boost
Expand Down Expand Up @@ -329,13 +328,6 @@ SOURCES += src\protobuf\google\protobuf\any.cc \
src\libevent\signal.c \
src\libevent\strlcpy.c \
src\libevent\win32select.c \
src\libsnark\algebra\curves\alt_bn128\alt_bn128_g1.cpp \
src\libsnark\algebra\curves\alt_bn128\alt_bn128_g2.cpp \
src\libsnark\algebra\curves\alt_bn128\alt_bn128_init.cpp \
src\libsnark\algebra\curves\alt_bn128\alt_bn128_pairing.cpp \
src\libsnark\algebra\curves\alt_bn128\alt_bn128_pp.cpp \
src\libsnark\common\profiling.cpp \
src\libsnark\common\utils.cpp \
src\main.cpp \
src\merkleblock.cpp \
src\metrics.cpp \
Expand Down Expand Up @@ -643,14 +635,12 @@ LIBS += -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -l
windows:LIBS += -lboost_chrono$$BOOST_LIB_SUFFIX
LIBS += -lrustzcash

Release:LIBS += -ldepends\libgmp_6.1.1_msvc14\lib\x64\gmp
Release:LIBS += -ldepends\libsodium-1.0.15-msvc\x64\Release\v140\dynamic\libsodium
Release:LIBS += -ldepends\libcurl-master\lib\dll-release-x64\libcurl
Release:LIBS += -ldepends\db-6.2.23\build_windows\x64\Release\libdb62
Release:LIBS += -llibcryptoMD -llibsslMD
Release:LIBS += -ldepends\pthreads-master\dll\x64\Release\pthreads

Debug:LIBS += -ldepends\libgmp_6.1.1_msvc14\lib\x64\gmp
Debug:LIBS += -ldepends\libsodium-1.0.15-msvc\x64\Debug\v140\dynamic\libsodium
Debug:LIBS += -ldepends\libcurl-master\lib\dll-debug-x64\libcurl_debug
Debug:LIBS += -ldepends\db-6.2.23\build_windows\x64\Debug\libdb62d
Expand Down
123 changes: 0 additions & 123 deletions build-aux/m4/ax_openmp.m4

This file was deleted.

73 changes: 4 additions & 69 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ if test x$use_pkgconfig = xyes; then
)
else
# BUG: Fix this:
echo 'BUG: configure does not yet check for the following dependencies if pkg-config is not on the system: libcrypto++, libgmp'
echo 'BUG: configure does not yet check for the following dependencies if pkg-config is not on the system: libcrypto++'

AC_CHECK_HEADER([openssl/crypto.h],,AC_MSG_ERROR(libcrypto headers missing))
AC_CHECK_LIB([crypto], [main],CRYPTO_LIBS=-lcrypto, AC_MSG_ERROR(libcrypto missing))
Expand Down Expand Up @@ -950,43 +950,6 @@ AC_CHECK_DECLS([EVP_MD_CTX_new],,,[AC_INCLUDES_DEFAULT
])
CXXFLAGS="${save_CXXFLAGS}"

# These packages don't provide pkgconfig config files across all
# platforms, so we use older autoconf detection mechanisms:
if test x$TARGET_OS = xdarwin; then
AC_CHECK_HEADER([gmp.h],,AC_MSG_ERROR(libgmp headers missing))
AC_CHECK_LIB([gmp],[__gmpn_sub_n],GMP_LIBS=-lgmp, [AC_MSG_ERROR(libgmp missing)])

AC_CHECK_HEADER([gmpxx.h],,AC_MSG_ERROR(libgmpxx headers missing))
AC_CHECK_LIB([gmpxx],[main],GMPXX_LIBS=-lgmpxx, [AC_MSG_ERROR(libgmpxx missing)])
fi

#AC_CHECK_HEADER([gmp.h],,AC_MSG_ERROR(libgmp headers missing))
#AC_CHECK_LIB([gmp],[[__gmpn_sub_n]],GMP_LIBS=-lgmp, [AC_MSG_ERROR(libgmp missing)])

#AC_CHECK_HEADER([gmpxx.h],,AC_MSG_ERROR(libgmpxx headers missing))
#AC_CHECK_LIB([gmpxx],[main],GMPXX_LIBS=-lgmpxx, [AC_MSG_ERROR(libgmpxx missing)])

# 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)
echo "libsnark include directory not found ($LIBSNARK_INCDIR)"
fi

CPPFLAGS="-I$LIBSNARK_INCDIR $CPPFLAGS"

# Now check for libsnark compilability using traditional autoconf tests:
if test x$TARGET_OS = xdarwin; then
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])
fi
#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])

RUST_LIBS="-lrustzcash"
case $host in
*mingw*)
Expand All @@ -996,42 +959,17 @@ case $host in
;;
esac

dnl Check for OpenMP support
AX_OPENMP(
[AC_DEFINE(HAVE_OPENMP, 1, [Define if OpenMP is enabled])
AM_CONDITIONAL([HAVE_OPENMP], [true])
CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS"],
[AC_MSG_WARN([OpenMP not supported, disabling multithreading])
AC_DEFINE(HAVE_OPENMP, 0, [Define if OpenMP is enabled])
AM_CONDITIONAL([HAVE_OPENMP], [false])])

# Gitian uses a config.site that sets depends_prefix, and then sets --prefix=/
# build.sh just uses --prefix
if test x$depends_prefix != x; then
LIBSNARK_DEPINST="$depends_prefix"
else
LIBSNARK_DEPINST="$prefix"
fi

# Additional Zcash flags
AX_CHECK_COMPILE_FLAG([-fwrapv],[CXXFLAGS="$CXXFLAGS -fwrapv"])
AX_CHECK_COMPILE_FLAG([-fno-strict-aliasing],[CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"])
AX_CHECK_COMPILE_FLAG([-Wno-builtin-declaration-mismatch],[CXXFLAGS="$CXXFLAGS -Wno-builtin-declaration-mismatch"],,[[$CXXFLAG_WERROR]])

# if test x$TARGET_OS = xdarwin; then
# LIBZCASH_LIBS="-lgmp -lgmpxx -lboost_system-mt -lcrypto -lsodium $RUST_LIBS"
# elif test x$TARGET_OS != xwindows; then
# LIBZCASH_LIBS="-lgmp -lgmpxx -lboost_system -lcrypto -lsodium $RUST_LIBS"
# else
# LIBZCASH_LIBS="-lgmp -lgmpxx -lboost_system-mt-s -lcrypto -lsodium $RUST_LIBS"
# fi

LIBZCASH_LIBS="-lgmp -lgmpxx $BOOST_SYSTEM_LIB -lcrypto -lsodium $RUST_LIBS"
LIBZCASH_LIBS="$BOOST_SYSTEM_LIB -lcrypto -lsodium $RUST_LIBS"

CXXFLAGS_TEMP="$CXXFLAGS"
LIBS_TEMP="$LIBS"
CXXFLAGS="$CXXFLAGS $SSL_CFLAGS $CRYPTO_CFLAGS"
LIBS="$LIBS $SSL_LIBS $CRYPTO_LIBS $GMP_LIBS $GMPXX_LIBS"
LIBS="$LIBS $SSL_LIBS $CRYPTO_LIBS"
AC_CHECK_HEADER([openssl/ec.h],, AC_MSG_ERROR(OpenSSL ec header missing),)
CXXFLAGS="$CXXFLAGS_TEMP"
LIBS="$LIBS_TEMP"
Expand Down Expand Up @@ -1249,9 +1187,6 @@ AC_SUBST(LEVELDB_ATOMIC_CPPFLAGS)
AC_SUBST(LEVELDB_ATOMIC_CXXFLAGS)
AC_SUBST(MINIUPNPC_CPPFLAGS)
AC_SUBST(MINIUPNPC_LIBS)
AC_SUBST(GMP_LIBS)
AC_SUBST(GMPXX_LIBS)
AC_SUBST(LIBSNARK_DEPINST)
AC_SUBST(LIBZCASH_LIBS)
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py])
AC_CONFIG_FILES([qa/pull-tester/run-komodod-for-test.sh],[chmod +x qa/pull-tester/run-komodod-for-test.sh])
Expand Down Expand Up @@ -1281,7 +1216,7 @@ unset PKG_CONFIG_LIBDIR
PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP"

ac_configure_args="${ac_configure_args} --disable-shared --with-pic --with-bignum=no --enable-module-recovery"
AC_CONFIG_SUBDIRS([src/secp256k1 src/snark src/univalue src/cryptoconditions src/cc])
AC_CONFIG_SUBDIRS([src/secp256k1 src/univalue src/cryptoconditions src/cc])

AC_OUTPUT

Expand Down
44 changes: 0 additions & 44 deletions depends/packages/libgmp.mk

This file was deleted.

Loading

0 comments on commit f7ab5f6

Please sign in to comment.