I've successfully built Zcash on OS X... Ask me anything!

I could not get googletest or googlemock to build, and removed them from my fork…they are not needed to run zcash itself, only full-test-suite.sh or rpc-test.sh

oh, just curious @clarkw , do you happen to be either a registered Apple Developer (I am) or have in depth C++ knowledge (I don’t, I’ve mostly just done lots of build/release engineering with it over the years)?

I intend to do a signed release with my Apple Dev credentials once this sucker builds and I managed to get it packaged with xcode.

Can I also access it on an IPhone 7? Kindly post a step by step guide here, tnx

@anon47418038 so can you make an “how-to” compile zcash client for MacOS (OS X)?

Thanks for the attention.

When I get all the way there, yes!

btw is this redsn0w from that project, or just an homage? :slight_smile:

I think I am a registered Apple developer. Don’t you just need an Apple developer account to be one? I am expert at c, pretty good at c++, but mostly these days I do webdev with the LAMP stack. Unfortunately I have a ton of other crap to do, or I would probably have this sucker working by now. For instance, right now I have to go clear a metric shit-ton of leaves off my lawn. Hopefully I can get back to it tonight. Good luck with your debugging.

I’ve gotta update my fork with all the upstream changes from rc2, which aren’t tiny in some ways. Could make things better, probably make them worse :slight_smile:

there won’t ever be an iPhone version of the command line server that Apple will let into the App Store, so it would only run on jailbroken iPhones, assuming that a future Mac build could be built to run on iPhone (which it MAYBE could, compiling command line stuff for both targets is very similar).

I’m not the jailbreak tool (redsn0w) :stuck_out_tongue: , just someone who loves that tool.
Btw thanks, I will wait the “how-to”.

1 Like

We’re still not there yet, but getting closer.

1 Like

@adam I got past the last errors I had by using ginstall instead of install. Now it seems like the mac linker is not up to the task. I installed gnu ld by installing coreutils, binutils using brew. It seems like brew is not installing a gnu ld. Anyone have an idea about this? Here is my compile history:

[09:46 AM] wclark@Mac-Pro-4 [~/Sites/zcash] $  ./zcutil/build.sh 
+ '[' x = x--help ']'
+ set -x
+ cd /Users/wclark/Sites/zcash
+ LCOV_ARG=
+ HARDENING_ARG=--enable-hardening
+ '[' x = x--enable-lcov ']'
++ pwd
+ PREFIX=/Users/wclark/Sites/zcash/depends/x86_64-apple-darwin14.5.0/
+ HOST=x86_64-apple-darwin14.5.0
+ BUILD=x86_64-apple-darwin14.5.0
+ CC=gcc-6
+ CPP=cpp-6
+ CXX=g++-6
+ AR=gar
+ J=24
+ make -C ./depends/ V=1 NO_QT=1
rm -rf /Users/wclark/Sites/zcash/depends/x86_64-apple-darwin14.5.0
mkdir -p /Users/wclark/Sites/zcash/depends/x86_64-apple-darwin14.5.0
echo copying packages: native_ccache boost openssl libsnark libgmp libsodium googletest googlemock bdb miniupnpc
copying packages: native_ccache boost openssl libsnark libgmp libsodium googletest googlemock bdb miniupnpc
echo to: /Users/wclark/Sites/zcash/depends/x86_64-apple-darwin14.5.0
to: /Users/wclark/Sites/zcash/depends/x86_64-apple-darwin14.5.0
cd /Users/wclark/Sites/zcash/depends/x86_64-apple-darwin14.5.0;  tar xf /Users/wclark/Sites/zcash/depends/built/x86_64-apple-darwin14.5.0/native_ccache/native_ccache-3.3.1-4a675b2af66.tar.gz;   tar xf /Users/wclark/Sites/zcash/depends/built/x86_64-apple-darwin14.5.0/boost/boost-1_62_0-34ede833083.tar.gz;   tar xf /Users/wclark/Sites/zcash/depends/built/x86_64-apple-darwin14.5.0/openssl/openssl-1.1.0b-74c9c843309.tar.gz;   tar xf /Users/wclark/Sites/zcash/depends/built/x86_64-apple-darwin14.5.0/libsnark/libsnark-0.1-65684bab134.tar.gz;   tar xf /Users/wclark/Sites/zcash/depends/built/x86_64-apple-darwin14.5.0/libgmp/libgmp-6.1.1-14a66addc6f.tar.gz;   tar xf /Users/wclark/Sites/zcash/depends/built/x86_64-apple-darwin14.5.0/libsodium/libsodium-1.0.11-2347d9ec4e0.tar.gz;   tar xf /Users/wclark/Sites/zcash/depends/built/x86_64-apple-darwin14.5.0/googletest/googletest-1.7.0-19c68a017da.tar.gz;   tar xf /Users/wclark/Sites/zcash/depends/built/x86_64-apple-darwin14.5.0/googlemock/googlemock-1.7.0-a1cfdebc78c.tar.gz;   tar xf /Users/wclark/Sites/zcash/depends/built/x86_64-apple-darwin14.5.0/bdb/bdb-6.2.23-fb5dc2862af.tar.gz;   tar xf /Users/wclark/Sites/zcash/depends/built/x86_64-apple-darwin14.5.0/miniupnpc/miniupnpc-2.0-b2aa4f24fdc.tar.gz; 
touch /Users/wclark/Sites/zcash/depends/x86_64-apple-darwin14.5.0/.stamp_e0163dc5cc0
sed -e 's|@HOST@|x86_64-apple-darwin14.5.0|' \
            -e 's|@CC@|/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -mmacosx-version-min=10.7|' \
            -e 's|@CXX@|/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -mmacosx-version-min=10.7|' \
            -e 's|@AR@|/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar|' \
            -e 's|@RANLIB@|/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib|' \
            -e 's|@NM@|/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm|' \
            -e 's|@STRIP@|/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip|' \
            -e 's|@build_os@|darwin|' \
            -e 's|@host_os@|darwin|' \
            -e 's|@CFLAGS@|-pipe -O2|' \
            -e 's|@CXXFLAGS@|-pipe -O2|' \
            -e 's|@CPPFLAGS@||' \
            -e 's|@LDFLAGS@||' \
            -e 's|@no_qt@|1|' \
            -e 's|@no_wallet@||' \
            -e 's|@no_upnp@||' \
            -e 's|@debug@||' \
            config.site.in > /Users/wclark/Sites/zcash/depends/x86_64-apple-darwin14.5.0/share/config.site
touch /Users/wclark/Sites/zcash/depends/x86_64-apple-darwin14.5.0/share/config.site
+ ./autogen.sh
glibtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
glibtoolize: copying file 'build-aux/ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'build-aux/m4'.
glibtoolize: copying file 'build-aux/m4/libtool.m4'
glibtoolize: copying file 'build-aux/m4/ltoptions.m4'
glibtoolize: copying file 'build-aux/m4/ltsugar.m4'
glibtoolize: copying file 'build-aux/m4/ltversion.m4'
glibtoolize: copying file 'build-aux/m4/lt~obsolete.m4'
configure.ac:10: installing 'build-aux/compile'
configure.ac:9: installing 'build-aux/missing'
Makefile.am: installing 'build-aux/depcomp'
glibtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
glibtoolize: copying file 'build-aux/ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'build-aux/m4'.
glibtoolize: copying file 'build-aux/m4/libtool.m4'
glibtoolize: copying file 'build-aux/m4/ltoptions.m4'
glibtoolize: copying file 'build-aux/m4/ltsugar.m4'
glibtoolize: copying file 'build-aux/m4/ltversion.m4'
glibtoolize: copying file 'build-aux/m4/lt~obsolete.m4'
configure.ac:58: installing 'build-aux/compile'
configure.ac:27: installing 'build-aux/missing'
Makefile.am:5: warning: user variable 'GZIP_ENV' defined here ...
/usr/local/Cellar/automake/1.15/share/automake-1.15/am/distdir.am: ... overrides Automake variable 'GZIP_ENV' defined here
Makefile.am:58: warning: user target 'distcleancheck' defined here ...
/usr/local/Cellar/automake/1.15/share/automake-1.15/am/distdir.am: ... overrides Automake target 'distcleancheck' defined here
src/Makefile.am: installing 'build-aux/depcomp'
src/Makefile.am:499: warning: user target '.mm.o' defined here ...
/usr/local/Cellar/automake/1.15/share/automake-1.15/am/depend2.am: ... overrides Automake target '.mm.o' defined here
src/Makefile.am:447: warning: variable 'libzcash_a_LDFLAGS' is defined but no program or
src/Makefile.am:447: library has 'libzcash_a' as canonical name (possible typo)
+ ./configure --prefix=/Users/wclark/Sites/zcash/depends/x86_64-apple-darwin14.5.0/ --host=x86_64-unknown-linux-gnu --build=x86_64-unknown-linux-gnu --with-gui=no --enable-hardening '' 'CXXFLAGS=-fwrapv -fno-strict-aliasing -Werror -g'
configure: WARNING: you should use --build, --host, --target
configure: loading site script /Users/wclark/Sites/zcash/depends/x86_64-apple-darwin14.5.0/share/config.site
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-apple-darwin14.5.0
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for x86_64-apple-darwin14.5.0-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... yes
checking whether make supports nested variables... (cached) yes
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -mmacosx-version-min=10.7 accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -mmacosx-version-min=10.7... gcc3
checking for x86_64-apple-darwin14.5.0-g++... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -mmacosx-version-min=10.7
checking whether we are using the GNU Objective C++ compiler... yes
checking whether /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -mmacosx-version-min=10.7 accepts -g... yes
checking dependency style of /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -mmacosx-version-min=10.7... gcc3
checking how to print strings... printf
checking for x86_64-apple-darwin14.5.0-gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -mmacosx-version-min=10.7
checking whether we are using the GNU C compiler... yes
checking whether /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -mmacosx-version-min=10.7 accepts -g... yes
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -mmacosx-version-min=10.7 option to accept ISO C89... none needed
checking whether /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -mmacosx-version-min=10.7 understands -c and -o together... rm: conftest.dSYM: is a directory
yes
checking dependency style of /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -mmacosx-version-min=10.7... gcc3
checking for a sed that does not truncate output... /usr/local/bin/sed
checking for grep that handles long lines and -e... /usr/local/bin/grep
checking for egrep... /usr/local/bin/grep -E
checking for fgrep... /usr/local/bin/grep -F
checking for ld used by /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -mmacosx-version-min=10.7... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm
checking the name lister (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm) interface... rm: conftest.dSYM: is a directory
BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-apple-darwin14.5.0 format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for x86_64-apple-darwin14.5.0-objdump... no
checking for objdump... no
checking how to recognize dependent libraries... pass_all
checking for x86_64-apple-darwin14.5.0-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for x86_64-apple-darwin14.5.0-ar... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar
checking for archiver @FILE support... rm: conftest.dSYM: is a directory
no
checking for x86_64-apple-darwin14.5.0-strip... strip
checking for x86_64-apple-darwin14.5.0-ranlib... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib
checking command to parse /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm output from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -mmacosx-version-min=10.7 object... rm: conftest.dSYM: is a directory
ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for x86_64-apple-darwin14.5.0-mt... no
checking for mt... no
checking if : is a manifest tool... no
checking for x86_64-apple-darwin14.5.0-dsymutil... no
checking for dsymutil... dsymutil
checking for x86_64-apple-darwin14.5.0-nmedit... no
checking for nmedit... nmedit
checking for x86_64-apple-darwin14.5.0-lipo... no
checking for lipo... lipo
checking for x86_64-apple-darwin14.5.0-otool... no
checking for otool... otool
checking for x86_64-apple-darwin14.5.0-otool64... no
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking how to run the C preprocessor... /usr/local/bin/cpp-6
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -mmacosx-version-min=10.7 supports -fno-rtti -fno-exceptions... yes
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -mmacosx-version-min=10.7 option to produce PIC... -fno-common -DPIC
checking if /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -mmacosx-version-min=10.7 PIC flag -fno-common -DPIC works... yes
checking if /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -mmacosx-version-min=10.7 static flag -static works... no
checking if /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -mmacosx-version-min=10.7 supports -c -o file.o... yes
checking if /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -mmacosx-version-min=10.7 supports -c -o file.o... (cached) yes
checking whether the /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -mmacosx-version-min=10.7 linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin14.5.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -mmacosx-version-min=10.7 -E
checking for ld used by /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -mmacosx-version-min=10.7... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking whether the /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -mmacosx-version-min=10.7 linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -mmacosx-version-min=10.7 option to produce PIC... -fno-common -DPIC
checking if /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -mmacosx-version-min=10.7 PIC flag -fno-common -DPIC works... yes
checking if /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -mmacosx-version-min=10.7 static flag -static works... no
checking if /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -mmacosx-version-min=10.7 supports -c -o file.o... yes
checking if /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -mmacosx-version-min=10.7 supports -c -o file.o... (cached) yes
checking whether the /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -mmacosx-version-min=10.7 linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin14.5.0 dyld
checking how to hardcode library paths into programs... immediate
checking for x86_64-apple-darwin14.5.0-ar... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar
checking for x86_64-apple-darwin14.5.0-ranlib... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib
checking for x86_64-apple-darwin14.5.0-strip... no
checking for strip... /usr/bin/strip
checking for x86_64-apple-darwin14.5.0-gcov... no
checking for gcov... /usr/bin/gcov
checking for lcov... no
checking for java... /usr/bin/java
checking for genhtml... no
checking for git... /usr/local/bin/git
checking for ccache... /Users/wclark/Sites/zcash/depends/x86_64-apple-darwin14.5.0/share/../native/bin/ccache
checking for xgettext... no
checking for hexdump... /usr/bin/hexdump
checking for x86_64-apple-darwin14.5.0-readelf... no
checking for readelf... no
checking for x86_64-apple-darwin14.5.0-c++filt... no
checking for c++filt... /usr/bin/c++filt
checking for x86_64-apple-darwin14.5.0-pkg-config... /usr/local/bin/pkg-config --static
checking pkg-config is at least version 0.9.0... yes
checking for port... no
checking for brew... no
checking whether the linker accepts -Wl,-headerpad_max_install_names... yes
checking whether byte ordering is bigendian... no
checking if compiler needs -Werror to reject unknown flags... yes
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... -D_THREAD_SAFE
checking for PTHREAD_PRIO_INHERIT... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking whether strerror_r is declared... yes
checking for strerror_r... yes
checking whether strerror_r returns char *... no
checking whether the linker accepts -Wl,--large-address-aware... no
checking for __attribute__((visibility))... yes
checking for __attribute__((dllexport))... no
checking for __attribute__((dllimport))... no
checking for library containing clock_gettime... no
checking whether C++ compiler accepts -Wformat... yes
checking whether C++ compiler accepts -Wformat-security... yes
checking whether C++ compiler accepts -Wstack-protector... yes
checking whether C++ compiler accepts -fstack-protector-all... yes
checking whether C++ preprocessor accepts -D_FORTIFY_SOURCE=2... yes
checking whether C++ preprocessor accepts -U_FORTIFY_SOURCE... yes
checking whether the linker accepts -Wl,-z,relro... no
configure: error: Cannot enable RELRO

gnu ld will not work…I’m in the midst of chaos on launch day with my AWS images needing updating, but later next week I can post my build recipe that gets past where you are stuck now (to then get onto the C++ code that gcc on mac barfs on!)

1 Like

I’d love to QA your build instructions. Please throw them my way at your earliest convenience!!
Congrats on completing the port! clark at knowideas.com

And nm, I found your github repo. :slight_smile:

1 Like

It builds now, I don’t know if you saw the latest links in the forum
here…a link to the latest releases (admittedly poor!) build instructions
on github will always be on my website: https://zcash.mercerweiss.com

Its known to build on El Capitan, and I desperately need feedback from
users on older and newer releases of OS X, especially as I approach a
binary release of it as Zcash.app (Mac dmg installer, etc).

Thanks!

@clarkw Make sure you build against the v1.0.1-mac-gcc branch!