Bitcoin Forum
May 01, 2024, 04:34:04 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: probs building bitcoin-qt for OSX  (Read 1734 times)
danboid (OP)
Newbie
*
Offline Offline

Activity: 13
Merit: 0


View Profile
February 13, 2014, 07:11:08 PM
 #1

I've already successfully built bitcoind for OSX but I'm having probs compiling bitcoin-qt under OSX so I'm hoping this forum could give me some tips. I used xcode for the first time today and I'm only just beginning to learn (Obj) C (++) so please excuse my noobiness! I'm doing this to learn how to build Qt apps under OSX as well as to understand bitcoin a bit better. I know I could just download an existing Mac build if I wanted.

The first thing that may cause a prob for building the qt wallet is that my OSX install is still using the included openssl instead of the one I installed from homebrew. build-osx.md, included with the bitcoin source, says that I should run:

Code:
brew link openssl --force

but after running

Code:
openssl version

again, I can see I'm still defaulting to the older version of openssl. I've not yet tried just manually replacing the openssl binary or moving the older one and linking to the newer. I presume that could work but it'd be better if I could get the previous command to work or maybe there's another, cleaner way that would also work?

What are the minimum or recommended versions of Xcode and Qt required to build bitcoin-qt under OSX? I'm trying to build bitcoin-qt under OSX 10.6.8 using Xcode 3.2.6, Qt 4.8.4 (downloaded from qt-project.org) and I used homebrew to build all the other deps. I don't suppose I need to build Qt from source (or homebrew) too do I? I tried installing Qt 5.2 first but I got a couple of errors during installation so maybe it doesn't support Snow Leopard any more? Xcode 3.2.6 is the latest I can get without a paid dev account, it seems.

Finally, the docs say there are issues compiling bitcoin for 64bit SL. Does that mean I have to run OSX in legacy/32bit mode to get it to compile or is choosing a 32bit target under Xcode enough? I'd be creatng a universal binary ideally as thats what I compiled everything (boost, openssl, bdb, upnp) else as so far.

Thanks for your help!
1714581244
Hero Member
*
Offline Offline

Posts: 1714581244

View Profile Personal Message (Offline)

Ignore
1714581244
Reply with quote  #2

1714581244
Report to moderator
I HATE TABLES I HATE TABLES I HA(╯°□°)╯︵ ┻━┻ TABLES I HATE TABLES I HATE TABLES
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714581244
Hero Member
*
Offline Offline

Posts: 1714581244

View Profile Personal Message (Offline)

Ignore
1714581244
Reply with quote  #2

1714581244
Report to moderator
tvbcof
Legendary
*
Offline Offline

Activity: 4592
Merit: 1276


View Profile
February 13, 2014, 08:57:53 PM
Last edit: February 15, 2014, 01:57:28 AM by tvbcof
 #2

I just got done hacking out a build using clang under FreeBSD which seems to at least basically work.  I like to build certain dependencies which I consider to be critical from source as well.  These included OpenSSL, Boost, and BerkeleyDB.

I'm pretty 'old school' and don't currently use or understand some of the newer tools like 'brew'.  So, I dunno how much my comments will help you.

There is a nice config flag which seems to work for Boost, but not (yet) one for OpenSSL.  After struggling with providing reference to my Bitcoin-specific OpenSSL in standard ways, I eventually capitulated and used pkg_config (which is not native to my system and which I don't care much for because I don't understand it.)  It took the following form:

Code:
    ...
    PKG_CONFIG_PATH="${tp}/lib/pkgconfig" \
      ./configure \
        --without-gui \
        ...


From looking at the new config system (Hurrah for this finally!) it looks to me like it is pretty pkg_config-centric wrt OpenSSL.

In case anyone is interested, the other issues I ran into included a situation where my build of BDB (which was -fPIC) did not link correctly when with -fPIE associated with stack smashing (or whatever).  For this reason I had to use --disable-hardening.


 - Edit:  I might have mentioned in case it is not clear that my ${tp} is stand for 'Third Party' and it is the base of where I installed my special build of OpenSSL (among other things.)  Presumably most package management systems will have installed 'pkgconfig' entries in some spot and the install of OpenSSL will have populated it.  Some Linii packages seem to have both dev and non-dev variants, the former with the requisite libraries, header files, etc needed to compile against them.  I've never touched a Mac and have no idea what options may exist in which of their package management systems.  It's pretty rare to use OpenSSL in raw form though so I would think that any install would be 'dev' as it were.

BTW, pkgconfig (a directory) was installed by the standard gmake install target of OpenSSL in my case since it didn't already exist.


sig spam anywhere and self-moderated threads on the pol&soc board are for losers.
danboid (OP)
Newbie
*
Offline Offline

Activity: 13
Merit: 0


View Profile
February 15, 2014, 11:23:17 AM
 #3

Are there no Mac bitcoin devs who read this forum? I've mailed everybody listed in build-osx.md but the only one who replied says he's out of touch with the project now and that I should ask here.

The OSX build docs for bitcoind are quite thorough but I feel more detail is needed within the readme-qt.rst file for those wanting to build bitcoin-qt on OSX.

Thanks for your suggestions re openssl tvbcof, but it doesn't address my questions re required versions of Xcode and Qt required to build bitcoin-qt, what with Xcode having nothing to do with freebsd, being OSX specific. The docs state that the Mac version of bitcoin-qt is built on 10.6 but they could potentially be using xcode 4.2 which isn't available to non-paying Apple devs, hence I'm using xcode 3.2.x. Then there is the question of what version of Qt should I be using. I presume I have to use the 4.x series but maybe I should be using 4.7.x vs 4.8.x?

edric
Hero Member
*****
Offline Offline

Activity: 546
Merit: 501



View Profile
March 30, 2014, 09:39:45 AM
 #4

I've nearly given up trying. I've been able to get a 10.6.7 VM running stably on my system but just cannot get dependencies installed correctly (I think).

I tried to build one called "Coin" and as soon as I ran qmake coin-qt.pro I got /Developer/Tools/Qt/lrelease: Bad CPU type in executable.

I tried changing build target and arch but to no avail. This is my first try doing it on Mac, and mind you this is in a VM on an AMD CPU based system, so yeah. It's taken me 2 weeks to get to where I think I have all the components in place after working around Clang-3.3 failing to build repeatedly, think I'm using gcc4.8. Does anyone have any tips or even better, a guide? I've read the devtome guide but it's pretty mum on Mac.

Thanks.

Pages: [1]
  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!