Bitcoin Forum
November 01, 2024, 07:03:54 PM *
News: Bitcoin Pumpkin Carving Contest
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 [5] 6 7 8 9 10 »  All
  Print  
Author Topic: Building Armory on OSX  (Read 32301 times)
ErebusBat
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500

I am the one who knocks


View Profile
September 04, 2012, 07:02:15 PM
 #81

It's in https://github.com/Homebrew/homebrew-versions

Code:
brew tap homebrew/versions
brew install wysenynja/bitcoin/bitcoind
Thanks... I added it but now I am getting a compile error for it (berkeley-db4):
Code:
libtool: compile:  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -c -I. -I../dist/.. -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -Os -w -pipe -march=native -Qunused-arguments -mmacosx-version-min=10.8 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -fno-strict-aliasing ../dist/../libdb_java/db_java_wrap.c  -fno-common -DPIC -o .libs/db_java_wrap.o
../dist/../libdb_java/db_java_wrap.c:137:10: fatal error: 'jni.h' file not found
#include <jni.h>
         ^
1 error generated.

I have my feelings that it is due to upgrading to Mt. Lion this weekend, has anyone else compiled this on Mt. Lion?

░▒▓█ Coinroll.it - 1% House Edge Dice Game █▓▒░ • Coinroll Thread • *FREE* 100 BTC Raffle

Signup for CEX.io BitFury exchange and get GHS Instantly!  Don't wait for shipping, mine NOW!
Red Emerald
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile WWW
September 06, 2012, 03:56:28 AM
 #82

It's in https://github.com/Homebrew/homebrew-versions

Code:
brew tap homebrew/versions
brew install wysenynja/bitcoin/bitcoind
Thanks... I added it but now I am getting a compile error for it (berkeley-db4):
Code:
libtool: compile:  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -c -I. -I../dist/.. -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -Os -w -pipe -march=native -Qunused-arguments -mmacosx-version-min=10.8 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -fno-strict-aliasing ../dist/../libdb_java/db_java_wrap.c  -fno-common -DPIC -o .libs/db_java_wrap.o
../dist/../libdb_java/db_java_wrap.c:137:10: fatal error: 'jni.h' file not found
#include <jni.h>
         ^
1 error generated.

I have my feelings that it is due to upgrading to Mt. Lion this weekend, has anyone else compiled this on Mt. Lion?
The new version thing is a bug.  I am waiting for etotheipi to merge some changes and then I will switch the formula to his repo.

You probably need to update your command line tools.  Open up Xcode > Preferences > Downloads.  I've compiled on Mountain Lion.  Also, maybe run `brew doctor` and see if it says anything.

picobit
Hero Member
*****
Offline Offline

Activity: 547
Merit: 500


Decor in numeris


View Profile
September 06, 2012, 12:13:49 PM
 #83

Hrm...  So I was able to receive and send funds.  I imported a bunch of addresses (~15) and restarted... now Armory has been loading for >20 mins.....

Any ideas as to what could be causing the slowdown?

EDIT:  40 mins in and it just switched to blk0002.dat.  This sucks,  it is like using a 5 year old PC on a mac.  There has to be some reason for the slowdown.
What are your system specs? What OS version? Latest dev branch?

My load times aren't nearly that bad, but I'm on a SSD.

This is not right.  On my mac it takes less than 2 min to load.  I am using an SSD too, but it is CPU limited.

However, it may be a crash.  Occationally, I see Armory crash when reading a block, in particular if I start it while the Satoshi client is catching up.  I guess it gets confused by reading a block while it is being written to disk.  That could in principle also hang your client.
ErebusBat
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500

I am the one who knocks


View Profile
September 08, 2012, 02:49:40 PM
 #84

You probably need to update your command line tools.  Open up Xcode > Preferences > Downloads.  I've compiled on Mountain Lion.  Also, maybe run `brew doctor` and see if it says anything.
Yup that was it... I didn't realize that the OS upgrade would un-install them.

Thanks for everything Red Emerald

░▒▓█ Coinroll.it - 1% House Edge Dice Game █▓▒░ • Coinroll Thread • *FREE* 100 BTC Raffle

Signup for CEX.io BitFury exchange and get GHS Instantly!  Don't wait for shipping, mine NOW!
Red Emerald
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile WWW
September 08, 2012, 05:18:43 PM
 #85

You probably need to update your command line tools.  Open up Xcode > Preferences > Downloads.  I've compiled on Mountain Lion.  Also, maybe run `brew doctor` and see if it says anything.
Yup that was it... I didn't realize that the OS upgrade would un-install them.

Thanks for everything Red Emerald
Well it leaves them installed, but I think they are all compiled for Lion which has older versions of a lot of things and so won't work.

Glad I could help!

Red Emerald
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile WWW
September 15, 2012, 05:24:34 AM
 #86

I'm testing the threaded branch on my own machine.  It built without issue for me and is easy to run with "PYTHONPATH=`brew --prefix`/lib/python2.7/site-packages /usr/bin/python ArmoryQt.py"

Once I'm happy with the stability, I'll switch my brew tap to it.

If you are itching to try out the bleeding edge: https://github.com/WyseNynja/BitcoinArmory/tree/threading

simonk83
Hero Member
*****
Offline Offline

Activity: 798
Merit: 1000


View Profile
November 04, 2012, 09:23:12 PM
 #87

Hi guys,

So, this might be an interesting test for you.   I have just (literally, today) moved from Windows to OSX.   I'm almost totally new to Mac's in general, but certainly new to compiling on it.

I do have xcode and the command line tools installed, but not homebrew or anything else just yet.

Does anyone fancy giving me a bit of a step by step guide for getting Armory up and running?   I figure it'll serve as a good beginners guide going forward, and will also be a good test of the processes you've set up.

Much appreciated!!
picobit
Hero Member
*****
Offline Offline

Activity: 547
Merit: 500


Decor in numeris


View Profile
November 05, 2012, 09:23:39 AM
Last edit: November 06, 2012, 12:31:34 PM by picobit
 #88

I installed the new "threading" version of Armory under Mac OS X Mountain Lion.  Although still slightly experimental, it is the version that etotheipi says is going to be the official version real soon now, when Armory goes into beta (from alpha, see https://bitcointalk.org/index.php?topic=56424.msg1315445#msg1315445).

I use homebrew to install the dependencies.  On a Mac, there are at least three competing package managers for Unix/Linux software, homebrew, macports and fink.  I would be seriously surprised if it matters which one you choose, so don't let this thread decide for you.  Also, I have chosen to use the system's Python installation, and *not* install homebrews own python.  This is more in line with homebrew's philosophy of not duplicating packages, and is one of the reasons I chose homebrew.  But again, I really cannot claim superiority of this approach [in fact, I really don't know what I am doing Smiley ], and I am sure both choices are equally good for Armory.

So here are the steps (partly from memory, forgive me if I forgot something essential!).  All of this is done in a Terminal window.

0) Be sure to have the newest xcode installed, including the command line tools.

1) Install homebrew by copy-pasting the ruby installation command from the homebrew web page into the Terminal, see http://mxcl.github.com/homebrew/    

1a) You probably want to run brew doctor and fix any fixable problems before proceeding.

2) Install the first batch of prerequisites for Armory
Code:
brew install cryptopp
brew install swig
brew install sip
brew install qt
brew install pyqt
brew install berkeley-db

2a) (EDIT)  You have now installed Python stuff in /usr/local/lib.  The standard OS X Python will not find them, unless you add the directory to PYTHONPATH, e.g. by adding this line to the .profile file in your home directory
Code:
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
Note that the .profile file starts with a period, meaning that it is a hidden file.

3) You also need some Python packages not in homebrew.  These can be installed with Python's easy_install or with pip (easy_install pip).  I think pip makes it easier to uninstall later, but neither of them do a proper job when it comes to package management Sad

Code:
easy_install twisted
export BERKELEYDB_INCDIR=/usr/local/Cellar/berkeley-db/5.3.21/include
easy_install bsddb3
WARNING: Don't uncritically copy-past the BERKELEYDB_INCDIR path above, it will change as new versions come along.  Instead, type it using TAB-completion.

4) Get the Armory source code, and switch to the threading branch (this assumes you want it placed as a subdirectory under your home directory, replace the first cd command if you want it elsewhere).

Code:
cd ~
git clone git://github.com/etotheipi/BitcoinArmory.git
cd BitcoinArmory
git checkout threading
(I am no git wizard - this could undoubtedly be done as one git command.)

5) Compile the C++/swig part of Armory.

Code:
cd cppForSwig
export CFLAGS=”-arch x86_64″
export ARCHFLAGS=”-arch x86_64″
make swig

6) Return to the main Armory directory

Code:
cd ..

7) Try it out!  Make sure you have internet, that the Satoshi client is running and (preferably) that it has finished catching up.

Code:
python ArmoryQt.py

8 ) Have fun.  Although I do have a bitcoin address in my signature, I really think you should donate to the Armory guys instead!

etotheipi (OP)
Legendary
*
Offline Offline

Activity: 1428
Merit: 1093


Core Armory Developer


View Profile WWW
November 05, 2012, 03:03:41 PM
Last edit: November 06, 2012, 02:45:16 AM by etotheipi
 #89

Thanks for that picobit.

While I don't know much about OSX, I do want to point out that I removed the BSDDB dependency in Armory.  So the steps that involve configuring and installing that can be removed.  It was because the BSDDB was only used for migrating pre-0.6.0 Bitcoin-Qt wallets, and those have been "out of style" so long that I finally removed the feature altogether.

Maybe it's okay to leave those steps, since I might add it back in one day.  But if someone is getting stuck there, they should know that it's unimportant.

Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
Red Emerald
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile WWW
November 06, 2012, 02:33:22 AM
 #90

picobit, are you also setting PYTHONPATH?

Otherwise, I don't see how the system python would find pyqt.

simonk83
Hero Member
*****
Offline Offline

Activity: 798
Merit: 1000


View Profile
November 06, 2012, 09:35:36 AM
Last edit: November 06, 2012, 09:53:11 AM by simonk83
 #91

Ah, forgot about this, giving it a try now and I get the following:

macmini:~ Simon$ export BERKELEYDB_INCDIR=/usr/local/Cellar/berkeley-db/5.3.21/include/
macmini:~ Simon$ sudo easy_install bsddb3
Searching for bsddb3
Reading http://pypi.python.org/simple/bsddb3/
Reading http://www.jcea.es/programacion/pybsddb.htm
Reading http://www.argo.es/~jcea/programacion/pybsddb.htm
Best match: bsddb3 5.3.0
Downloading http://pypi.python.org/packages/source/b/bsddb3/bsddb3-5.3.0.zip#md5=305c3d42fe598b56349161497eb9bfc4
Processing bsddb3-5.3.0.zip
Running bsddb3-5.3.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Dm3no_/bsddb3-5.3.0/egg-dist-tmp-VrGGt6
Can't find a local Berkeley DB installation.
(suggestion: try the --berkeley-db=/path/to/bsddb option)
error: Setup script exited with 1
macmini:~ Simon$

Everything up until then went OK, and I assume it's a simple fix but I just don't know enough unix/OSX to troubleshoot it unfortunately...


EDIT:  OK, somehow managed to get BerkeleyDB installed and got past that error.   Moving on Smiley
simonk83
Hero Member
*****
Offline Offline

Activity: 798
Merit: 1000


View Profile
November 06, 2012, 09:59:37 AM
Last edit: November 06, 2012, 10:11:10 AM by simonk83
 #92

Right, now stuck on:

macmini:BitcoinArmory Simon$ cd cppForSwig
macmini:cppForSwig Simon$ export CFLAGS=”-arch x86_64″
-bash: export: `x86_64″': not a valid identifier


EDIT:  Ok, think I sorted that, just something wrong with the speech marks Smiley 
simonk83
Hero Member
*****
Offline Offline

Activity: 798
Merit: 1000


View Profile
November 06, 2012, 10:13:53 AM
 #93

Right, when running the "make swig" command, it processes for while then ends with:

swig -c++ -python -classic -threads -outdir ../ -v CppBlockUtils.i
make: swig: No such file or directory
make: *** [CppBlockUtils_wrap.cxx] Error 1
picobit
Hero Member
*****
Offline Offline

Activity: 547
Merit: 500


Decor in numeris


View Profile
November 06, 2012, 12:25:25 PM
 #94

Right, when running the "make swig" command, it processes for while then ends with:

swig -c++ -python -classic -threads -outdir ../ -v CppBlockUtils.i
make: swig: No such file or directory
make: *** [CppBlockUtils_wrap.cxx] Error 1

Is swig in /usr/local/bin?  If so, you probably just need to add /usr/local/bin to the PATH

picobit, are you also setting PYTHONPATH?

Otherwise, I don't see how the system python would find pyqt.

Yes indeed, I set PYTHONPATH.  I will edit my post and add it.
simonk83
Hero Member
*****
Offline Offline

Activity: 798
Merit: 1000


View Profile
November 06, 2012, 08:31:09 PM
 #95

Right, when running the "make swig" command, it processes for while then ends with:

swig -c++ -python -classic -threads -outdir ../ -v CppBlockUtils.i
make: swig: No such file or directory
make: *** [CppBlockUtils_wrap.cxx] Error 1

Is swig in /usr/local/bin?  If so, you probably just need to add /usr/local/bin to the PATH


No, swig isn't present....
Red Emerald
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile WWW
November 07, 2012, 02:54:22 AM
 #96

Right, when running the "make swig" command, it processes for while then ends with:

swig -c++ -python -classic -threads -outdir ../ -v CppBlockUtils.i
make: swig: No such file or directory
make: *** [CppBlockUtils_wrap.cxx] Error 1

Is swig in /usr/local/bin?  If so, you probably just need to add /usr/local/bin to the PATH


No, swig isn't present....

Code:
brew install swig

simonk83
Hero Member
*****
Offline Offline

Activity: 798
Merit: 1000


View Profile
November 07, 2012, 05:02:33 AM
Last edit: November 07, 2012, 05:20:40 AM by simonk83
 #97

Right, when running the "make swig" command, it processes for while then ends with:

swig -c++ -python -classic -threads -outdir ../ -v CppBlockUtils.i
make: swig: No such file or directory
make: *** [CppBlockUtils_wrap.cxx] Error 1

Is swig in /usr/local/bin?  If so, you probably just need to add /usr/local/bin to the PATH


No, swig isn't present....

Code:
brew install swig

Thanks Smiley

Well, I did that and swig installed fine as far as I can tell.  However, make swig gives me:

Code:
macmini:cppforswig Simon$ make swig
g++ -shared -lpthread  UniversalTimer.o BinaryData.o FileDataPtr.o BtcUtils.o BlockObj.o BlockUtils.o EncryptionUtils.o libcryptopp.a "/usr/lib/python`python -c 'import sys; print str(sys.version_info[0]) + "." + str(sys.version_info[1])'`/config/libpython`python -c 'import sys; print str(sys.version_info[0]) + "." + str(sys.version_info[1])'`.a" CppBlockUtils_wrap.o -o ../_CppBlockUtils.so
pyrcc4 -o ../qrc_img_resources.py ../imgList.xml
make: pyrcc4: No such file or directory
make: *** [swig] Error 1

brew install pyrcc4? (edit:  nope...)


EDIT2:  Ah, hold on.  The initial round of "brew installs" didn't work I don't think (hence why I didn't have swig).   Just reinstalling the stuff now.
simonk83
Hero Member
*****
Offline Offline

Activity: 798
Merit: 1000


View Profile
November 07, 2012, 05:27:55 AM
 #98

Success gentlemen Smiley

The only thing that needs adding to those instructions is:

Code:
brew install berkeley-db

The rest was me not installing the stuff properly (I grabbed the entire block and pasted it into the terminal.  I though it was installing the stuff 1 by 1 but clearly not Cheesy).

Thanks a lot for the help everyone.   Not ideal having to install it this way, but it works (and it's kind of fun if you're a dork like me, so that helps).
Red Emerald
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile WWW
November 07, 2012, 08:05:48 AM
Last edit: December 08, 2012, 06:19:58 AM by Red Emerald
 #99

EDIT: Check out the most up-to-date instructions here.

Success gentlemen Smiley

The only thing that needs adding to those instructions is:

Code:
brew install berkeley-db

The rest was me not installing the stuff properly (I grabbed the entire block and pasted it into the terminal.  I though it was installing the stuff 1 by 1 but clearly not Cheesy).

Thanks a lot for the help everyone.   Not ideal having to install it this way, but it works (and it's kind of fun if you're a dork like me, so that helps).
We don't need berkeley-db anymore.  It was only used to import the satoshi wallets and that has been dropped.


Here are my steps:


Code:
$ brew doctor
Do what the doctor says!

Code:
$ brew install python cryptopp swig sip qt pyqt
Make sure this ends in success!

I prefer to use brew's python since it is newer (2.7.3 vs ML's 2.7.2). Plus it is installed as my user so I can muck with it without sudo and I don't have to worry about breaking anything on my system.

Put this in your ~/.bashrc.  I do not recommend setting PYTHONPATH here.  It can get annoying when you are working on other Python projects.
Code:
export PATH=`brew --prefix`/share/python:$PATH
export CFLAGS="-arch x86_64"
export ARCHFLAGS="-arch x86_64"

Then run some more commands
Code:
$ pip install twisted
$ mkdir ~/src
$ cd ~/src
$ git clone git://github.com/etotheipi/BitcoinArmory.git
$ git checkout threading
$ cd BitcoinArmory
$ make
Hopefully soon we will won't need the threading branch and can just use master.

Running Armory is a bit awkward, but it isn't too bad.  You have to set PYTHONPATH so the system python can find pyqt and twisted.  I'm not sure why, but I haven't been able to get it built against brew's python.  Since "make" builds against the system python, you need to make sure you don't use some other one. Brew recommends you put it's python in the front of PATH, so using the full path to the system python makes sure we use the right one.
Code:
$ PYTHONPATH=`brew --prefix`/lib/python2.7/site-packages /usr/bin/python ArmoryQt.py

Once I can get it Armory online properly, I'll update my brew tap.  I keep getting a segfault while it's loading the blockchain.  I'm re-downloading the chain now.

EDIT: A fresh blockchain didn't help.  I'm going to dig deeper this weekend.

Red Emerald
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile WWW
November 24, 2012, 02:41:05 AM
 #100

So I made this super simple for people.  I'm sure etotheipi will eventually do this himself, but if you want Armory up and running fast and right now.

Code:
brew tap homebrew/versions
brew tap WyseNynja/bitcoin
brew install wysenynja/bitcoin/bitcoind
brew install --HEAD wysenynja/bitcoin/armory-qt

You don't need to install bitcoind, but I like to. I might eventually add a startup service for bitcoind.

EDIT: I forgot to mention tapping homebrew/versions
berkely-db4 is now in the main brew formula list.  However, armory doesn't need it anymore. Once threading gets merged into master, I'll update this tap.  I'll also get rid of the "--HEAD" requirement

Pages: « 1 2 3 4 [5] 6 7 8 9 10 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!