Closed taoeffect closed 10 years ago
Note also that this is just for building namecoind
(not the QT GUI).
This would be obsoleted if https://github.com/namecoin/namecoin/pull/135 is merged
Update: this was fixed. Safe to merge!
Also, just an FYI, this does contain a breaking change for some compilers. If someone needs me to fix that just let me know and I'll figure out the macro for detecting clang compilers (instead of just commenting this section out).
PR #108 doesn't break compilation with non-Clang compilers BTW.
LIBS+= \
-Wl,-dynamic \
-lgthread-2.0 \
Do we really need gthread?
The other Makefiles have that, too, but it shouldn't be necessary. My PR that introduces a proper build system doesn't have it and it works :).
So this does NOT work for Namecoin-QT, correct?
@indolering Correct.
I don't expect this to be merged btw. It's just an illustration of the minimal changes needed to build on OS X.
@taoeffect Yeah, I had it working ~8 months ago, then changes to 10.9 and the switch to Clang broke Boost.
It seems OS X is even worse than windows in regard to building. Somebody please make it work! With GUI! @taoeffect Windows version is also using db-4.8.30.NC
@phelixbtc I got it working with GUI, see my other PR.
@Midar https://github.com/ceptacle/libcoinqt Interested?
@phelixbtc could we get this PR request accepted? Namecoind is better than nothing and Midar's other build system isn't going anywhere.
What's libcoind missing that namecoind has? I like libcoind's build system better (and I got it to build on OS X, I should probably submit a PR for that too...)
@taoeffect libcoind is missing a few things, including RPC calls for registering names. There's more info on the forum. I might be able to arrange some bounties for getting libcoind up to par with namecoind feature-wise, if that's something you're interested in.
I wouldn't be able to do it (allergic to C++), but I might be able to chip in. Grumble. What about bitcore? Can it do namecoiny things yet? I think @ryancdotorg was working on that...?
NM, @ryancdotorg said on IRC that he's not entirely sure what bitcore is... lol. And I can't figure it out either! Is it a liteclient? It doesn't seem to be a full node.
OK, so figured out what bitcore is thanks to jgarzik
on #bitcore
.
Bitcore is:
Copay is:
Insight-API seems to be:
bitcoind
So... nm about the bitcore. Looks like all we have is namecoind
and libcoin --namecoin
, so it seems we'd better focus on libcoind
.
Sorry for the OT, but I think I should comment here regarding libcoin: Yes, exactly, the missing features are registering names and name_list
. I'm actually planning to start working on these "really soon" (next week at the latest), so hopefully they will be implemented in the not too distant future. Bounties would, of course, be appreciated, but I'm determined to do it nevertheless.
Is there a consensus this is a step in the right direction? @cassiniNMC?
@taoeffect Could you give example lines for how to install dependencies with proper versions with homebrew? Why did you not expect this to be merged?
@taoeffect Could you give example lines for how to install dependencies with proper versions with homebrew?
Like I said, the "proper versions" aren't available on Homebrew, so I used what was available there. boost
1.55 seems to be working. I also installed openssl via Homebrew, as well as berkeley-db
. These were installed just using regular brew install [blah]
commands (I think). Try this out and let me know if you run into problems (I'm unfortunately rather pressed for time).
Why did you not expect this to be merged?
Because this comment.
@taoeffect OK, we should be able figure these out, thanks!
this does contain a breaking change for some compilers. If someone needs me to fix that just let me know and I'll figure out the macro for detecting clang compilers
@taoeffect Yes, it would be great if you could find out a suitable macro/pragma for that section in serialize.h
Bounties would, of course, be appreciated, but I'm determined to do it nevertheless.
Please don't say this, you yourself said that you have 5-10 hours of contract work per week: bounties enable you to work on Namecoin. It's nice that you squeeze it in anyway, but the impact is greater than what you lead people to think.
@cassiniNMC: if either you or @phelixbtc or anyone else can just tell me what the pragma is i'll paste it in there and push a commit. right now i've a billion things going on that are higher priority, and this should be a simple google search for ya'll (and me, admittedly, it's just that for me the google search must be put off until I knock out the high priority items).
#ifdef __WXMSW__
// Windows
#else
#ifdef MAC_OSX
// MAC
#else
// ...
#endif
#endif
Hmm, that assumes clang
isn't being used anywhere but OS X. Isn't it possible these issues could happen on Linux with clang
?
@taoeffect the only reason we are using clang on OS X is because Apple fucking replaced GCC specific commands with Clang aliases and removed GCC from OS X 10.9. If someone wants to use Clang on Linux, that's their problem.
@taoeffect the only reason we are using clang on OS X is because Apple fucking replaced GCC specific commands with Clang aliases and removed GCC from OS X 10.9. If someone wants to use Clang on Linux, that's there problem.
mmk... that is because clang is better than GCC. :P
OK, I decided to google it. It's __clang__
.
I'll try to get a commit pushed shortly.
Um, somebody please remind me: this branch is pretty far behind namecoinq
now, so what should I do... merge those changes on top of this commit, rebase (too late probably), just make my changes in a new commit after this one and push without merging, or close PR and re-open after merging?
cc @phelixbtc @cassiniNMC @JeremyRand @domob1812
I feel like (1) merge, (2) make changes, commit, and push is the right answer, but am not sure.
OK, impatient so I went ahead with merge, fix, commit, push.
Should be safe to merge now!
Please test this to make sure it compiles on Linux/Windows before merging! I verified it works on OS X.
@taoeffect Does this require berkeley-db4
to be installed or will db5 work? Is this working with QT?
@taoeffect Does this require
berkeley-db4
to be installed or will db5 work? Is this working with QT?
I actually compiled this with db5... but it should probably be done with db4, right @JeremyRand @ryancdotorg? (cc @domob1812).
Should I change it to use db4 or leave it as-is for use with db5 (which is in homebrew for berkeley-db
).
I actually compiled this with db5... but it should probably be done with db4, right @JeremyRand @ryancdotorg? (cc @domob1812).
Should I change it to use db4 or leave it as-is for use with db5 (which is in homebrew for berkeley-db).
@taoeffect, well, it's not building with db4.
I'm not sure if I should put the following instructions in docs/build-osx.txt or the main readme.md, so I'm going to put it here:
Install dependencies using Brew:
brew install openssl boost miniupnpc berkeley-db
Execute make command from the src
directory:
cd ./src make USE_UPNP=1 -j $(sysctl -n hw.ncpu) -f Makefile.osx all
./src/namecoind
.@taoeffect, well, it's not building with db4.
Yeah I know, I need to change the Makefile for that to work. The paths to the libraries and headers need to be manually specified for db4 (like I've done for openssl, for example).
brew install openssl boost miniupnpc berkeley-db
Yep, except it would be berkeley-db4
if the others think that's what it should be.
Actually, I would have preferred to rebase (git rebase
instead of git merge
) your commits on top of the current branch, so as to not have a "merge" commit in the history. But it doesn't matter for now - just remember this for the future. ;)
Apart from that, I'm fine with the changes as long as everyone confirms it works for them and fixes the problems on OS X.
@taoeffect if moving to db4 is easy, just do it. It can't hurt.
IIRC database format has changed between db4 and db5 so it is important to always use db4 for compatibility.
Compiles fine on Windows.
I'm not sure if I should put the following instructions in docs/build-osx.txt or the main readme.md
build-osx.txt imho but I suggest a separate commit to get this one merged.
OK, I'll push an update (hopefully today if I don't forget) to change the Makefile to use db4.
K. This is ready to be merged. I got rid of gthread
and am requiring miniupnpc to be installed (cause... there's no reason not to), simplified Makefile.osx somewhat, and switched to berkeley-db4.
Compiled and verified.
You have two options:
Or
./namecoind dumpprivkey <address>
If you go with the second option, you will need to delete all your database stuff and re-download. You can use my node on okturtles.com to "quickly" get up to speed (I have bandwidth to spare):
./namecoind -gen=0 -server -addnode=192.184.93.146
Then after it boots up add re-import your private keys that you exported:
./namecoind importprivkey 23rjkjf823jf98jsfj8932jfj98fw982jf982jf9fj8
(Obviously, the key above isn't a real one, just an example.)
Also, regarding build-osx.txt
, instructions are simple now:
brew install openssl berkeley-db4 boost miniupnpc
cd src && make -f Makefile.osx -j $(sysctl -n hw.ncpu) all
If you know your CPU count, you can just use it: make -f Makefile.osx -j 8 all
Actually, I would have preferred to rebase (git rebase instead of git merge) your commits on top of the current branch, so as to not have a "merge" commit in the history. But it doesn't matter for now - just remember this for the future. ;)
@domob1812 I decided to not do a rebase
because I had already pushed the changes publicly. You aren't supposed to rebase if you've made your stuff public (as that will cause history conflicts).
@taoeffect Considering that this branch on your repo is just a "work in progress", I see no problem with rebasing it. This is also what Bitcoin devs usually want, and it makes the official repo's history cleaner. I think this counts more than following some "supposed to be" Git guidelines to-the-letter.
OK, I actually replaced __clang__
with __APPLE__
because ironically enough that broke compilation with clang under linux. Now I've verified it compiles on OS X and Linux using clang. I wasn't able to test gcc on either platform however (OS X doesn't have it, and on linux my VPS kills the process for probably using too much RAM).
Compiles and runs on Windows. ACK. Linux GCC?
IMO someone should test on Linux GCC before this is merged. Maybe someone can ask pmc to look at it?
Install dependencies with Homebrew and then from within src directory:
The only concern is how to install specific versions of the dependencies (to avoid accidentally resulting a hard fork).
Unfortunately, I couldn't find "db-4.7.25.NC" via Homebrew. The farthest back they have is 4.8.30. Is that OK?
Also, I haven't tested yet if boost 1.5 builds on OS X or not. 1.55 does, but I'm not sure about 1.5.