Author

Topic: Has Anyone Run Bitcoin Headless On Mac (Read 6040 times)

newbie
Activity: 19
Merit: 0
February 08, 2013, 05:11:46 PM
#4
Current instructions for compiling a headless version:
https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.txt

edited to add:
configuration checking script and makefile generator. totes useful!
https://raw.github.com/CodeShark/bitcoin/4c92791df5c96128e03834a8a1a52c07c2164cf5/src/configure
newbie
Activity: 21
Merit: 2
December 05, 2010, 02:15:05 PM
#3
Very nice. I'll have to give that a try (or ten). I also posted a solution for those that don't want to try to run headless: https://bitcointalksearch.org/topic/has-anyone-run-bitcoin-headless-on-mac-2086
legendary
Activity: 1540
Merit: 1001
December 05, 2010, 01:30:10 PM
#2
Well, I never ran the binaries headless, but I did run it many times by compiling myself. I don't remember the exact steps in fixing dependencies, but using macports it wasn't hard at all, but I did have to muck around the makefile to get the paths correct.

The following is for r156, but should work pretty much unchanged for current svn head, I think. Just make sure paths are correct for you, and you are using 64bit OSX. If you're on 32bit, change the x86_64 to i386 (untested). Also, build with
Code:
make -f makefile.osx bitcoind
, if you don't specify the target it will try to build bitcoin which is the GUI version.

Code:
# Copyright (c) 2009-2010 Satoshi Nakamoto
# Distributed under the MIT/X11 software license, see the accompanying
# file license.txt or http://www.opensource.org/licenses/mit-license.php.

# Mac OS X makefile for bitcoin
# Laszlo Hanyecz ([email protected])


CXX=llvm-g++
DEPSDIR=/opt/local

INCLUDEPATHS= \
 -I"$(DEPSDIR)/include"  -I"$(DEPSDIR)/include/db46"

LIBPATHS= \
 -L"$(DEPSDIR)/lib"  -L"$(DEPSDIR)/lib/db46"

WXLIBS=

LIBS= -dead_strip \
 $(DEPSDIR)/lib/db46/libdb_cxx-4.6.a \
 $(DEPSDIR)/lib/libboost_system-mt.a \
 $(DEPSDIR)/lib/libboost_filesystem-mt.a \
 $(DEPSDIR)/lib/libboost_program_options-mt.a \
 $(DEPSDIR)/lib/libboost_thread-mt.a \
 $(DEPSDIR)/lib/libboost_regex-mt.a \
 $(DEPSDIR)/lib/libssl.a \
 $(DEPSDIR)/lib/libcrypto.a

DEFS=-D__WXMAC_OSX__ -DNOPCH -DMSG_NOSIGNAL=0 -DFOURWAYSSE2

DEBUGFLAGS=-g -DwxDEBUG_LEVEL=0 $(DF)
# ppc doesn't work because we don't support big-endian
CFLAGS=-mmacosx-version-min=10.5 -arch x86_64 -O3 -Wno-invalid-offsetof -Wformat $(DEFS) $(INCLUDEPATHS)
HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
    script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h noui.h init.h

OBJS= \
    obj/util.o \
    obj/script.o \    obj/db.o \    obj/net.o \
    obj/irc.o \
    obj/main.o \
    obj/rpc.o \
    obj/init.o \
    cryptopp/obj/sha.o \
    obj/sha256.o \
    cryptopp/obj/cpu.o

all: bitcoin


obj/%.o: %.cpp $(HEADERS)
        $(CXX) -c $(CFLAGS) -DGUI -o $@ $<

cryptopp/obj/%.o: cryptopp/%.cpp
        $(CXX) -c $(CFLAGS) -O3 -DCRYPTOPP_DISABLE_ASM -o $@ $<

bitcoin: $(OBJS) obj/ui.o obj/uibase.o
        $(CXX) $(shell $(DEPSDIR)/bin/wx-config --cxxflags) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(shell $(DEPSDIR)/bin/wx-config --libs --static) $(LIBS)

obj/nogui/%.o: %.cpp $(HEADERS)
        $(CXX) -c $(CFLAGS) -o $@ $<

bitcoind: $(OBJS:obj/%=obj/nogui/%)
        $(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)

clean:
        -rm -f bitcoin bitcoind
        -rm -f obj/*.o
        -rm -f obj/nogui/*.o
        -rm -f cryptopp/obj/*.o
newbie
Activity: 21
Merit: 2
December 05, 2010, 01:01:35 PM
#1
The title says it all. If you have successfully run bitcoin headless on Mac OS X please share your experience. Or if you think you know how to pull it off please let us know how to make it happen.

The OS X GUI usually lags behind and even when it's up to date with win/linux it doesn't have the Mac OS feel, and I don't think anyone is interested in making that happen at present. The best option I can see would be to just run it sans GUI.

If someone can figure out how to run it headless on Mac OS X I'll try to figure out how to display the details on the desktop using GeekTool and share it here.
Jump to: