COVERAGE_INFO = baseline_filtered_combined.info baseline.info block_test.info \
leveldb_baseline.info test_bitcoin_filtered.info total_coverage.info \
baseline_filtered.info block_test_filtered.info \
- leveldb_baseline_filtered.info test_bitcoin_coverage.info test_bitcoin.info \
- zcash-gtest.info zcash-gtest_filtered.info zcash-gtest_coverage.info
+ leveldb_baseline_filtered.info test_bitcoin_coverage.info test_bitcoin.info
+# zcash-gtest.info zcash-gtest_filtered.info zcash-gtest_coverage.info
dist-hook:
-$(MAKE) -C $(top_distdir)/src/leveldb clean
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/*.h" \
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/boost/*" \
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gmock/*" \
- "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gtest/*" \
- "$(abs_builddir)/src/gtest/*" \
"$(abs_builddir)/src/test/*" \
-o $@
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/*.h" \
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/boost/*" \
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gmock/*" \
- "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gtest/*" \
- "$(abs_builddir)/src/gtest/*" \
"$(abs_builddir)/src/test/*" \
-o $@
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/*.h" \
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/boost/*" \
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gmock/*" \
- "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gtest/*" \
- "$(abs_builddir)/src/gtest/*" \
"$(abs_builddir)/src/test/*" \
-o $@
-zcash-gtest.info: baseline_filtered_combined.info
- $(MAKE) -C src/ zcash-gtest_check
- $(LCOV) -c -d $(abs_builddir)/src -t zcash-gtest -o $@
- $(LCOV) -z -d $(abs_builddir)/src
- $(LCOV) -z -d $(abs_builddir)/src/leveldb
-
-zcash-gtest_filtered.info: zcash-gtest.info
- $(LCOV) -r $< "/usr/include/*" \
- "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/*.h" \
- "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/boost/*" \
- "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gmock/*" \
- "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gtest/*" \
- "$(abs_builddir)/src/gtest/*" \
- "$(abs_builddir)/src/test/*" \
- -o $@
block_test.info: test_bitcoin_filtered.info
$(MKDIR_P) qa/tmp
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/*.h" \
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/boost/*" \
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gmock/*" \
- "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gtest/*" \
- "$(abs_builddir)/src/gtest/*" \
"$(abs_builddir)/src/test/*" \
-o $@
test_bitcoin_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info
- $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -o $@
+ $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -o $@
-zcash-gtest_coverage.info: baseline_filtered_combined.info zcash-gtest_filtered.info
- $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a zcash-gtest_filtered.info -o $@
-
-total_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info zcash-gtest_filtered.info block_test_filtered.info
- $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -a zcash-gtest_filtered.info -a block_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt
+total_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info block_test_filtered.info
+ $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -a block_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt
test_bitcoin.coverage/.dirstamp: test_bitcoin_coverage.info
- $(GENHTML) -s $< -o $(@D)
- @touch $@
-
-zcash-gtest.coverage/.dirstamp: zcash-gtest_coverage.info
- $(GENHTML) -s $< -o $(@D)
- @touch $@
-
-cov-zcash: zcash-gtest.coverage/.dirstamp
+ $(GENHTML) -s $< -o $(@D)
+ @touch $@
total.coverage/.dirstamp: total_coverage.info
- $(GENHTML) -s $< -o $(@D)
- @touch $@
+ $(GENHTML) -s $< -o $(@D)
+ @touch $@
-cov: test_bitcoin.coverage/.dirstamp cov-zcash total.coverage/.dirstamp
+cov: test_bitcoin.coverage/.dirstamp total.coverage/.dirstamp
endif
--- /dev/null
+First off you need Apple's Xcode (at least version 7, preferably 8.x) and the Xcode Command Line Tools:
+
+https://itunes.apple.com/us/app/xcode/id497799835?mt=12
+
+And Homebrew:
+
+http://brew.sh/
+
+And this is the list of brew packages you'll need installed:
+
+```shell
+brew tap discoteq/discoteq; brew install flock
+brew install autoconf autogen automake
+brew tap homebrew/versions; brew install homebrew/versions/gcc5
+brew install binutils
+brew install protobuf
+brew install coreutils
+brew install wget
+```
+
+Get all that installed, then run:
+
+```shell
+git clone https://github.com/j-cimb-barker/komodo.git
+cd komodo
+git checkout dev
+./zcutil/build-mac.sh
+```
+When you are done building, you need to do a few things in the [Configuration](https://github.com/zcash/zcash/wiki/1.0-User-Guide#configuration) section of the Zcash User Guide differently because we are on the Mac. All instances of `~/.zcash` need to be replaced by `~/Library/Application\ Support/Zcash`
+The fetch-params.sh script, however, has already been altered to fetch the proving keys into the correct directory to conform to Mac specific naming conventions.
+
+Happy Building
[AS_HELP_STRING([--enable-hardening],
[attempt to harden the resulting executables (default is yes)])],
[use_hardening=$enableval],
- [use_hardening=yes])
+ [use_hardening=no])
AC_ARG_ENABLE([reduce-exports],
[AS_HELP_STRING([--enable-reduce-exports],
fi
fi
- AC_CHECK_PROG([BREW],brew, brew)
- if test x$BREW = xbrew; then
+dnl AC_CHECK_PROG([BREW],brew, brew)
+dnl if test x$BREW = xbrew; then
dnl These Homebrew packages may be keg-only, meaning that they won't be found
dnl in expected paths because they may conflict with system files. Ask
dnl Homebrew where each one is located, then adjust paths accordingly.
dnl It's safe to add these paths even if the functionality is disabled by
dnl the user (--without-wallet or --without-gui for example).
- openssl_prefix=`$BREW --prefix openssl 2>/dev/null`
- bdb_prefix=`$BREW --prefix berkeley-db4 2>/dev/null`
- qt5_prefix=`$BREW --prefix qt5 2>/dev/null`
- if test x$openssl_prefix != x; then
- PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
- export PKG_CONFIG_PATH
- fi
- if test x$bdb_prefix != x; then
- CPPFLAGS="$CPPFLAGS -I$bdb_prefix/include"
- LIBS="$LIBS -L$bdb_prefix/lib"
- fi
- if test x$qt5_prefix != x; then
- PKG_CONFIG_PATH="$qt5_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
- export PKG_CONFIG_PATH
- fi
- fi
+dnl openssl_prefix=`$BREW --prefix openssl 2>/dev/null`
+dnl bdb_prefix=`$BREW --prefix berkeley-db4 2>/dev/null`
+dnl qt5_prefix=`$BREW --prefix qt5 2>/dev/null`
+dnl if test x$openssl_prefix != x; then
+dnl PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
+dnl export PKG_CONFIG_PATH
+dnl fi
+dnl if test x$bdb_prefix != x; then
+dnl CPPFLAGS="$CPPFLAGS -I$bdb_prefix/include"
+dnl LIBS="$LIBS -L$bdb_prefix/lib"
+dnl fi
+dnl if test x$qt5_prefix != x; then
+dnl PKG_CONFIG_PATH="$qt5_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
+dnl export PKG_CONFIG_PATH
+dnl fi
+dnl fi
else
case $build_os in
*darwin*)
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])
-LIBZCASH_LIBS="-lsnark -lgmp -lgmpxx -lboost_system-mt -lcrypto -lsodium -fopenmp"
+LIBZCASH_LIBS="-lsnark -lgmp -lgmpxx -lboost_system-mt -lcrypto -lsodium"
CXXFLAGS_TEMP="$CXXFLAGS"
LIBS_TEMP="$LIBS"
-build_darwin_CC: = $(shell xcrun -f clang)
-build_darwin_CXX: = $(shell xcrun -f clang++)
+build_darwin_CC = gcc-5
+build_darwin_CXX = g++-5
build_darwin_AR: = $(shell xcrun -f ar)
build_darwin_RANLIB: = $(shell xcrun -f ranlib)
build_darwin_STRIP: = $(shell xcrun -f strip)
build_darwin_NM: = $(shell xcrun -f nm)
build_darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool)
build_darwin_SHA256SUM = shasum -a 256
-build_darwin_DOWNLOAD = curl --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -L -o
+build_darwin_DOWNLOAD = wget --timeout=$(DOWNLOAD_CONNECT_TIMEOUT) --tries=$(DOWNLOAD_RETRIES) -nv -O
#darwin host on darwin builder. overrides darwin host preferences.
-darwin_CC=$(shell xcrun -f clang) -mmacosx-version-min=$(OSX_MIN_VERSION)
-darwin_CXX:=$(shell xcrun -f clang++) -mmacosx-version-min=$(OSX_MIN_VERSION)
+darwin_CC= gcc-5
+darwin_CXX= g++-5
darwin_AR:=$(shell xcrun -f ar)
darwin_RANLIB:=$(shell xcrun -f ranlib)
darwin_STRIP:=$(shell xcrun -f strip)
OSX_SDK_VERSION=10.9
OSX_SDK=$(SDK_PATH)/MacOSX$(OSX_SDK_VERSION).sdk
LD64_VERSION=241.9
-darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION)
-darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION)
+darwin_CC=gcc-5 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION)
+darwin_CXX=g++-5 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION)
darwin_CFLAGS=-pipe
darwin_CXXFLAGS=$(darwin_CFLAGS)
$(package)_config_opts=--layout=tagged --build-type=complete --user-config=user-config.jam
$(package)_config_opts+=threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1
$(package)_config_opts_linux=threadapi=pthread runtime-link=shared
-$(package)_config_opts_darwin=--toolset=darwin-4.2.1 runtime-link=shared
+$(package)_config_opts_darwin=--toolset=gcc threadapi=pthread runtime-link=shared
$(package)_config_opts_mingw32=binary-format=pe target-os=windows threadapi=win32 runtime-link=static
$(package)_config_opts_x86_64_mingw32=address-model=64
$(package)_config_opts_i686_mingw32=address-model=32
$(package)_config_opts_i686_linux=address-model=32 architecture=x86
$(package)_toolset_$(host_os)=gcc
$(package)_archiver_$(host_os)=$($(package)_ar)
-$(package)_toolset_darwin=darwin
-$(package)_archiver_darwin=$($(package)_libtool)
+$(package)_toolset_darwin=gcc
$(package)_config_libraries=chrono,filesystem,program_options,system,thread,test
$(package)_cxxflags=-fvisibility=hidden
$(package)_cxxflags_linux=-fPIC
endef
define $(package)_build_cmds
- ./b2 -d2 -j2 -d1 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) stage
+ ./b2 -d2 -j2 -d1 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) cxxflags=-std=c++11 stage
endef
define $(package)_stage_cmds
- ./b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) install
+ ./b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) cxxflags=-std=c++11 install
endef
+++ /dev/null
-# url=https://github.com/google/googlemock/archive/release-1.7.0.tar.gz
-
-package=googlemock
-$(package)_version=1.7.0
-$(package)_dependencies=googletest
-
-$(package)_download_path=https://github.com/google/$(package)/archive/
-$(package)_file_name=$(package)-$($(package)_version).tar.gz
-$(package)_download_file=release-$($(package)_version).tar.gz
-$(package)_sha256_hash=3f20b6acb37e5a98e8c4518165711e3e35d47deb6cdb5a4dd4566563b5efd232
-
-define $(package)_build_cmds
- $(MAKE) -C make GTEST_DIR='$(host_prefix)' CXXFLAGS='-fPIC' gmock-all.o
-endef
-
-
-define $(package)_stage_cmds
- install -D ./make/gmock-all.o $($(package)_staging_dir)$(host_prefix)/lib/libgmock.a && \
- cp -a ./include $($(package)_staging_dir)$(host_prefix)/include
-endef
+++ /dev/null
-package=googletest
-$(package)_version=1.7.0
-$(package)_download_path=https://github.com/google/$(package)/archive/
-$(package)_file_name=$(package)-$($(package)_version).tar.gz
-$(package)_download_file=release-$($(package)_version).tar.gz
-$(package)_sha256_hash=f73a6546fdf9fce9ff93a5015e0333a8af3062a152a9ad6bcb772c96687016cc
-
-define $(package)_build_cmds
- $(MAKE) -C make CXXFLAGS=-fPIC gtest.a
-endef
-
-define $(package)_stage_cmds
- install -D ./make/gtest.a $($(package)_staging_dir)$(host_prefix)/lib/libgtest.a && \
- cp -a ./include $($(package)_staging_dir)$(host_prefix)/include
-endef
package=libsnark
$(package)_version=0.1
-$(package)_download_path=https://github.com/zcash/$(package)/archive/
+$(package)_download_path=https://github.com/radix42/$(package)/archive/
$(package)_file_name=$(package)-$($(package)_git_commit).tar.gz
$(package)_download_file=$($(package)_git_commit).tar.gz
-$(package)_sha256_hash=9422b1a2a94e6b8be61f07af7f146087c2a7d70b208d07ad076622225aa7f0e4
-$(package)_git_commit=2e6314a9f7efcd9af1c77669d7d9a229df86a777
+$(package)_sha256_hash=9dbd5b44d3443e86463e934bfe1023cab4ca5948f8d74c23a67d9535c28d2584
+$(package)_git_commit=9be18569b8abcda1245c3912877075259599c0f1
$(package)_dependencies=libgmp libsodium
define $(package)_build_cmds
- CXXFLAGS="-fPIC -DBINARY_OUTPUT -DNO_PT_COMPRESSION=1" $(MAKE) lib DEPINST=$(host_prefix) CURVE=ALT_BN128 MULTICORE=1 NO_PROCPS=1 NO_GTEST=1 NO_DOCS=1 STATIC=1 NO_SUPERCOP=1 FEATUREFLAGS=-DMONTGOMERY_OUTPUT OPTFLAGS="-O2 -march=x86-64"
+CC=gcc-5 CXX=g++-5 CXXFLAGS="-arch x86_64 -DBINARY_OUTPUT -DNO_PT_COMPRESSION=1" $(MAKE) lib DEPINST=$(host_prefix) CURVE=ALT_BN128 MULTICORE=0 NO_PROCPS=1 NO_GTEST=1 NO_DOCS=1 STATIC=1 NO_SUPERCOP=1 FEATUREFLAGS=-DMONTGOMERY_OUTPUT
endef
define $(package)_stage_cmds
zcash_packages := libsnark libgmp libsodium
-packages := boost openssl $(zcash_packages) googletest googlemock
+packages := boost openssl $(zcash_packages)
native_packages := native_ccache
wallet_packages=bdb
#include <boost/optional.hpp>
+#ifdef __APPLE__
+#include <machine/endian.h>
+#include <libkern/OSByteOrder.h>
+
+#define htobe16(x) OSSwapHostToBigInt16(x)
+#define htole16(x) OSSwapHostToLittleInt16(x)
+#define be16toh(x) OSSwapBigToHostInt16(x)
+#define le16toh(x) OSSwapLittleToHostInt16(x)
+
+#define htobe32(x) OSSwapHostToBigInt32(x)
+#define htole32(x) OSSwapHostToLittleInt32(x)
+#define be32toh(x) OSSwapBigToHostInt32(x)
+#define le32toh(x) OSSwapLittleToHostInt32(x)
+
+#define htobe64(x) OSSwapHostToBigInt64(x)
+#define htole64(x) OSSwapHostToLittleInt64(x)
+#define be64toh(x) OSSwapBigToHostInt64(x)
+#define le64toh(x) OSSwapLittleToHostInt64(x)
+
+#define __BIG_ENDIAN BIG_ENDIAN
+#define __LITTLE_ENDIAN LITTLE_ENDIAN
+#define __BYTE_ORDER BYTE_ORDER
+#else
+#include
+#include
+#endif
+
EhSolverCancelledException solver_cancelled;
template<unsigned int N, unsigned int K>
--- /dev/null
+#!/bin/bash
+
+tools=("gcc-5" "g++-5" "otool" "nm")
+
+echo "Platform: `uname -a`"
+echo "-------------------------------------"
+echo "Tool info:"
+echo
+for tool in "${tools[@]}"
+do
+ echo "$tool location: `which $tool`"
+ echo "$tool version: `$tool --version`"
+ echo
+ echo "-------"
+ echo
+done
--- /dev/null
+#!/bin/bash
+export CC=gcc-5
+export CXX=g++-5
+export LIBTOOL=libtool
+export AR=ar
+export RANLIB=ranlib
+export STRIP=strip
+export OTOOL=otool
+export NM=nm
+
+set -eu -o pipefail
+
+if [ "x$*" = 'x--help' ]
+then
+ cat <<EOF
+Usage:
+
+$0 --help
+ Show this help message and exit.
+
+$0 [ --enable-lcov ] [ MAKEARGS... ]
+ Build Zcash and most of its transitive dependencies from
+ source. MAKEARGS are applied to both dependencies and Zcash itself. If
+ --enable-lcov is passed, Zcash is configured to add coverage
+ instrumentation, thus enabling "make cov" to work.
+EOF
+ exit 0
+fi
+
+# If --enable-lcov is the first argument, enable lcov coverage support:
+LCOV_ARG=''
+HARDENING_ARG='--disable-hardening'
+if [ "x${1:-}" = 'x--enable-lcov' ]
+then
+ LCOV_ARG='--enable-lcov'
+ HARDENING_ARG='--disable-hardening'
+ shift
+fi
+
+TRIPLET=`./depends/config.guess`
+PREFIX="$(pwd)/depends/$TRIPLET"
+
+make "$@" -C ./depends/ V=1 NO_QT=1
+
+./autogen.sh
+CPPFLAGS="-I$PREFIX/include -arch x86_64" LDFLAGS="-L$PREFIX/lib -arch x86_64 -Wl,-no_pie -fopenmp" \
+CXXFLAGS='-arch x86_64 -I/usr/local/Cellar/gcc5/5.4.0/include/c++/5.4.0 -I$PREFIX/include -fwrapv -fno-strict-aliasing -Werror -g -Wl,-undefined -Wl,dynamic_lookup' \
+./configure --prefix="${PREFIX}" --with-gui=no "$HARDENING_ARG" "$LCOV_ARG"
+
+make "$@" V=1 NO_GTEST=1 STATIC=1