From 298002424d7cf29e24700852e13d3e910ecba411 Mon Sep 17 00:00:00 2001 From: Don Shin Date: Mon, 23 Jul 2018 15:00:58 -0500 Subject: [PATCH] Enabled initial macOS High Sierra build support. --- README.md | 19 ++++- scripts/build-mac.sh | 112 ++++++++++++++++++++++++++++ src/Makefile.am | 9 ++- src/snark/Makefile | 2 +- src/zcash/IncrementalMerkleTree.hpp | 1 + src/zcash/NoteEncryption.hpp | 2 +- 6 files changed, 139 insertions(+), 6 deletions(-) create mode 100755 scripts/build-mac.sh diff --git a/README.md b/README.md index bd5c9de80..bd2132b7d 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,24 @@ This should build on linux and sync the full BTCP mainnet chain. Wallet code and Build Instructions ------- -Only linux builds have been reasonably tested. `scripts/build/sh` should build all the dependencies and bootstrap a linux build. If you want to manually configure, you must pass --disable-wallet currently. +Only linux builds have been reasonably tested. `scripts/build/sh` should build all the dependencies and bootstrap a linux build. + +For macOS High Sierra users, compilation can be achieved by first installing libomp (necessary as Apple's version of Clang does not have support for OpenMP included); you can do that via the following Terminal commands: + +Install XCode: +``` +xcode-select --install +``` +Install Homebrew: +``` +/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +``` +Install libomp: +``` +brew install libomp +``` +Then run the `scripts/build-mac.sh` to compile. + https://btcprivate.org diff --git a/scripts/build-mac.sh b/scripts/build-mac.sh new file mode 100755 index 000000000..5a9cedbac --- /dev/null +++ b/scripts/build-mac.sh @@ -0,0 +1,112 @@ +#!/usr/bin/env bash + +set -eu -o pipefail + +function cmd_pref() { + if type -p "$2" > /dev/null; then + eval "$1=$2" + else + eval "$1=$3" + fi +} + +# If a g-prefixed version of the command exists, use it preferentially. +function gprefix() { + cmd_pref "$1" "g$2" "$2" +} + +gprefix READLINK readlink +cd "$(dirname "$("$READLINK" -f "$0")")/.." + +# Allow user overrides to $MAKE. Typical usage for users who need it: +# MAKE=gmake ./zcutil/build.sh -j$(nproc) +if [[ -z "${MAKE-}" ]]; then + MAKE=make +fi + +# Allow overrides to $BUILD and $HOST for porters. Most users will not need it. +# BUILD=i686-pc-linux-gnu ./zcutil/build.sh +if [[ -z "${BUILD-}" ]]; then + BUILD="$(./depends/config.guess)" +fi +if [[ -z "${HOST-}" ]]; then + HOST="$BUILD" +fi + +# Allow override to $CC and $CXX for porters. Most users will not need it. +if [[ -z "${CC-}" ]]; then + CC=gcc +fi +if [[ -z "${CXX-}" ]]; then + CXX=g++ +fi + +# Allow users to set arbitary compile flags. Most users will not need this. +if [[ -z "${CONFIGURE_FLAGS-}" ]]; then + CONFIGURE_FLAGS="" +fi + +if [ "x$*" = 'x--help' ] +then + cat < #include #include #include diff --git a/src/zcash/NoteEncryption.hpp b/src/zcash/NoteEncryption.hpp index 66760f6bc..51147b57e 100644 --- a/src/zcash/NoteEncryption.hpp +++ b/src/zcash/NoteEncryption.hpp @@ -6,7 +6,7 @@ https://github.com/zcash/zips/blob/master/protocol/protocol.pdf #ifndef ZC_NOTE_ENCRYPTION_H_ #define ZC_NOTE_ENCRYPTION_H_ -#include +#include #include "uint256.h" #include "uint252.h"