X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=doc%2Fbuild-osx.txt;h=0531156f188cbc885505d044150807e369e79a0e;hb=373cf9437924e0df8d1899943e6476f33f62e559;hp=ac67080c3ad4a5f89e30be79f6f8323ae427d5a2;hpb=adea540e38d1039f26faa28f9eda3364e57b202e;p=novacoin.git diff --git a/doc/build-osx.txt b/doc/build-osx.txt index ac67080..0531156 100644 --- a/doc/build-osx.txt +++ b/doc/build-osx.txt @@ -1,188 +1,136 @@ -Copyright (c) 2010 Laszlo Hanyecz -Portions Copyright (c) 2011 Douglas Huff -Distributed under the MIT/X11 software license, see the accompanying file -license.txt or http://www.opensource.org/licenses/mit-license.php. This -product includes software developed by the OpenSSL Project for use in the -OpenSSL Toolkit (http://www.openssl.org/). This product includes cryptographic -software written by Eric Young (eay@cryptsoft.com) and UPnP software written by -Thomas Bernard. +Mac OS X Build Instructions and Notes +==================================== +This guide will show you how to build novacoind(headless client) for OSX. +Notes +----- -Mac OS X bitcoind build instructions -Laszlo Hanyecz -Douglas Huff - - -See readme-qt.rst for instructions on building Bitcoin QT, the -graphical user interface. - -Tested on 10.5 and 10.6 intel. PPC is not supported because it's big-endian. - -All of the commands should be executed in Terminal.app.. it's in -/Applications/Utilities - -You need to install XCode with all the options checked so that the compiler and -everything is available in /usr not just /Developer I think it comes on the DVD -but you can get the current version from http://developer.apple.com - - -1. Pick a directory to work inside.. something like ~/bitcoin works. The -structure I use looks like this: - -(~ is your home directory) - -~/bitcoin -~/bitcoin/bitcoin # Upstream source tree -~/bitcoin/src # source code (symlink to ~/bitcoin/bitcoin/src) -~/bitcoin/deps # dependencies.. like libraries and headers needed to compile - -Just execute: mkdir ~/bitcoin -This will create the top dir for you.. - -WARNING: do not use the ~ notation with the configure scripts.. use the full -name of the directory, for example /Users/james/bitcoin/deps for a user named -'james'. In my examples I am using 'macosuser' so make sure you change that. - -2. Check out the bitcoin code from github: - -cd ~/bitcoin -git clone https://github.com/bitcoin/bitcoin.git -ln -s bitcoin/src src - -This will make ~/bitcoin/bitcoin for you with all the files from git. This puts -the actual sources in ~/bitcoin/bitcoin/src and create a symlink src in -~/bitcoin to this location. - -3. Get and build the dependencies +* Tested on OS X 10.7 through 10.10 on 64-bit Intel processors only. +* All of the commands should be executed in a Terminal application. The +built-in one is located in `/Applications/Utilities`. -Boost ------ +Preparation +----------- -Download from http://www.boost.org/users/download/ -I'm assuming it ended up in ~/Downloads.. +You need to install XCode with all the options checked so that the compiler +and everything is available in /usr not just /Developer. XCode should be +available on your OS X installation media, but if not, you can get the +current version from https://developer.apple.com/xcode/. If you install +Xcode 4.3 or later, you'll need to install its command line tools. This can +be done in `Xcode > Preferences > Downloads > Components` and generally must +be re-done or updated every time Xcode is updated. -mkdir ~/bitcoin/deps -cd ~/bitcoin/deps -tar xvjf ~/Downloads/boost_1_42_0.tar.bz2 -cd boost_1_42_0 -./bootstrap.sh -./bjam architecture=combined address-model=32_64 macosx-version=10.5 macosx-version-min=10.5 link=static runtime-link=static --toolset=darwin --prefix=/Users/macosuser/bitcoin/deps install +There's also an assumption that you already have `git` installed. If +not, it's the path of least resistance to install [Github for Mac](https://mac.github.com/) +(OS X 10.7+) or +[Git for OS X](https://code.google.com/p/git-osx-installer/). It is also +available via Homebrew. -If you're using Snow Leopard, you will need to specify 10.6 as your Mac OS X -version instead of 10.5. +You will also need to install [Homebrew](http://brew.sh) in order to install library +dependencies. -This part takes a while.. use your judgement and fix it if something doesn't -build for some reason. +The installation of the actual dependencies is covered in the Instructions +sections below. -Change the prefix to whatever your directory is (my username in this example -is macosuser). I'm also running on 10.6 so i have macosx-version=10.6 change -to 10.5 if you're using leopard. +Instructions: Homebrew +---------------------- -This is what my output looked like at the end: -...failed updating 2 targets... -...skipped 144 targets... -...updated 8074 targets... +#### Install dependencies using Homebrew + brew install autoconf automake libtool boost openssl pkg-config protobuf qt qrencode -OpenSSL -------- +#### Installing berkeley-db4 using Homebrew -(System or MacPorts openssl will work fine. Optional.) +The homebrew package for berkeley-db4 has been broken for some time. It will install without Java though. -Download from http://www.openssl.org/source/ +Running this command takes you into brew's interactive mode, which allows you to configure, make, and install by hand: +``` +$ brew install https://raw.github.com/mxcl/homebrew/master/Library/Formula/berkeley-db4.rb -–without-java +``` -We would like to build this as a 32 bit/64 bit library so we actually build it -2 times and join it together here.. If you downloaded with safari it already -uncompressed it so it will just be a tar not a tar.gz +The rest of these commands are run inside brew interactive mode: +``` +/private/tmp/berkeley-db4-UGpd0O/db-4.8.30 $ cd .. +/private/tmp/berkeley-db4-UGpd0O $ db-4.8.30/dist/configure --prefix=/usr/local/Cellar/berkeley-db4/4.8.30 --mandir=/usr/local/Cellar/berkeley-db4/4.8.30/share/man --enable-cxx +/private/tmp/berkeley-db4-UGpd0O $ make +/private/tmp/berkeley-db4-UGpd0O $ make install +/private/tmp/berkeley-db4-UGpd0O $ exit +``` -cd ~/bitcoin/deps -tar xvf ~/Downloads/openssl-1.0.0.tar -mv openssl-1.0.0 openssl-1.0.0-i386 -tar xvf ~/Downloads/openssl-1.0.0.tar -mv openssl-1.0.0 openssl-1.0.0-x86_64 -# build i386 (32 bit intel) binary -cd openssl-1.0.0-i386 -./Configure --prefix=/Users/macosuser/bitcoin/deps --openssldir=/Users/macosuser/bitcoin/deps/openssl darwin-i386-cc && make -make install # only do this on one of the architectures, to install the headers -cd .. -# build x86_64 (64 bit intel) binary -cd openssl-1.0.0-x86_64 -./Configure --prefix=/Users/macosuser/bitcoin/deps --openssldir=/Users/macosuser/bitcoin/deps/openssl darwin64-x86_64-cc && make -cd .. +After exiting, you'll get a warning that the install is keg-only, which means it wasn't symlinked to `/usr/local`. You don't need it to link it to build novacoin, but if you want to, here's how: -# combine the libs -cd ~/bitcoin/deps -lipo -arch i386 openssl-1.0.0-i386/libcrypto.a -arch x86_64 openssl-1.0.0-x86_64/libcrypto.a -o lib/libcrypto.a -create -lipo -arch i386 openssl-1.0.0-i386/libssl.a -arch x86_64 openssl-1.0.0-x86_64/libssl.a -o lib/libssl.a -create + $ brew link --force berkeley-db4 -Verify your binaries -file lib/libcrypto.a +### Building `novacoind` -output should look like this: +1. Clone the github tree to get the source code and go into the directory. -lib/libcrypto.a: Mach-O universal binary with 2 architectures -lib/libcrypto.a (for architecture i386): current ar archive random library -lib/libcrypto.a (for architecture x86_64): current ar archive random library + git clone https://github.com/novacoin-project/novacoin.git + cd novacoin +2. Build NovaCoin-Qt application: + qmake + make -miniupnpc ---------- +3. Build bitcoind: + cd src + make -f makefile.osx novacoind -(MacPorts miniupnpc package works fine. You will need to modify makefile.) +Use Qt Creator as IDE +------------------------ +You can use Qt Creator as IDE, for debugging and for manipulating forms, etc. +Download Qt Creator from http://www.qt.io/download/. Download the "community edition" and only install Qt Creator (uncheck the rest during the installation process). -The process for miniupnpc (optional) is similar to that of OpenSSL. +1. Make sure you installed everything through homebrew mentioned above +2. In Qt Creator do "File" -> "Open Project" +3. Select novacoin-qt.pro as project file. +4. In the "Projects" tab select "Manage Kits..." +5. Select the default "Desktop" kit and select "Clang (x86 64bit in /usr/bin)" as compiler +6. Select LLDB as debugger (you might need to set the path to your installtion) +7. Start debugging with Qt Creator -Download from http://miniupnp.tuxfamily.org/files/. +Creating a release build +------------------------ +You can ignore this section if you are building `novacoind` for your own use. -cd ~/bitcoin/deps -tar xvf ~/Downloads/miniupnpc-1.6.tar -mv miniupnpc-1.6 miniupnpc-1.6-x86_64 -tar xvf ~/Downloads/miniupnpc-1.6.tar -mv miniupnpc-1.6 miniupnpc-1.6-i386 -# build x86_64 (64 bit intel) binary -cd miniupnpc-1.6-x86_64 -export CFLAGS="-arch x86_64" -export LDFLAGS="-arch x86_64" -export PREFIX="/Users/macuser/bitcoin/deps" -make && make install -# build i386 (32 bit intel) binary -cd miniupnpc-1.6-i386 -export CFLAGS="-arch i386" -export LDFLAGS="-arch i386" -export PREFIX="/Users/macuser/bitcoin/deps" -make +novacoind binary isn't included in the NovaCoin-Qt.app bundle. -# combine the libs -cd ~/bitcoin/deps -lipo -arch i386 miniupnpc-1.6-i386/libminiupnpc.a -arch x86_64 miniupnpc-1.6-x86_64/libminiupnpc.a -o lib/libminiupnpc.a -create +If you are building `novacoind` or `NovaCoin-Qt` for others, your build machine should be set up +as follows for maximum compatibility: -Verify your binaries +All dependencies should be compiled with these flags: -file lib/libminiupnpc.a + -mmacosx-version-min=10.7 + -arch x86_64 + -isysroot $(xcode-select --print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -output should look like this: +Once dependencies are compiled, you can create the .dmg disk image: -lib/libminiupnpc.a: Mach-O universal binary with 2 architectures -lib/libminiupnpc.a (for architecture i386): current ar archive random library -lib/libminiupnpc.a (for architecture x86_64): current ar archive random library +./contrib/macdeploy/macdeployqtplus NovaCoin-Qt.app -dmg -fancy ./contrib/macdeploy/fancy.plist +Running +------- -Berkeley DB ------------ +It's now available at `./novacoind`, provided that you are still in the `src` +directory. We have to first create the RPC configuration file, though. -(System or MacPorts version work fine.) +Run `./novacoind` to get the filename where it should be put, or just try these +commands: -Download from http://freshmeat.net/projects/berkeleydb/ + echo -e "rpcuser=novacoinrpc\nrpcpassword=$(xxd -l 16 -p /dev/urandom)" > "/Users/${USER}/Library/Application Support/NovaCoin/novacoin.conf" + chmod 600 "/Users/${USER}/Library/Application Support/NovaCoin/novacoin.conf" -cd ~/bitcoin/deps -tar xvf ~/Downloads/db-4.8.30.tar -cd db-4.8.30/build_unix -../dist/configure --prefix=/Users/macosuser/bitcoin/deps --enable-cxx && make && make install +The next time you run it, it will start downloading the blockchain, but it won't +output anything while it's doing this. This process may take several hours; +you can monitor its process by looking at the debug.log file, like this: + tail -f $HOME/Library/Application\ Support/NovaCoin/debug.log -Now you should be able to build bitcoind: +Other commands: +------- -cd ~/bitcoin/src -make -f makefile.osx bitcoind + ./novacoind -daemon # to start the bitcoin daemon. + ./novacoind --help # for a list of command-line options. + ./novacoind help # When the daemon is running, to get a list of RPC commands