C++ plans? (Re: r23706 - gnucash/trunk/src/register/ledger-core - Bug 721791)

John Ralls jralls at ceridwen.us
Sun Jan 26 01:55:10 EST 2014


On Jan 25, 2014, at 6:30 PM, Mike Alexander <mta at umich.edu> wrote:

> --On January 25, 2014 3:57:29 PM -0800 John Ralls <jralls at ceridwen.us> wrote:
> 
>>> You can also install other versions of gcc using MacPorts.  I'm
>>> currently using gcc 4.7 to build Gnucash (and other things).  I
>>> haven't installed gcc 4.8 or 4.9 but both are available with
>>> MacPorts.  I probably should switch to 4.8 at some point.
>> 
>> Ah, that’s useful to know. IIRC you’re on 10.6.8; I imagine that
>> you’re building against the native libs and headers in /usr and
>> frameworks in /System/Library rather than against an SDK. Is that
>> right?
> 
> I'm a little more recent that that.  I'm currently running 10.8.5 on my main machine.  I have a server that's at 10.6.8, but I never do any compiles there.
> 
> The MacPorts philosophy (which some disagree with, which is one reason HomeBrew exists) is that the MacPorts environment should be as nearly as possible completely self-contained.  As a result most of the libraries and headers I build against are ones installed by MacPorts, either with gcc or one of the Gnucash dependencies.  Remember that I'm building the X version, not the Aqua version.  I think it should be possible to build the Aqua version too, but I haven't tried recently. I've been thinking that I probably should give it a try someday.

<MacPorts/Fink Rant Deleted>. Yeah, I'm familiar with MacPorts. I don't like it. I've never tried Homebrew, mostly because I'm in the "eat your own dogfood" camp, and gtk-osx is that dogfood.

> 
> Picking a random recent compile (business/business-ledger/gncEntryLedger.c) and giving gcc the -H option determined that it's including 55 different header files that are not part of either Gnucash or MacPorts.  All of them are from /usr/include.  That's out of a total of 670 different files included.

Right. Those are the includes, along with their attendant libraries, that tie a build to a particular version of OSX. If you set your CFLAGS etc. to use an appropriate SDK, you can build for an earlier version of OSX that that on which you're building. By using Xcode3 and MacOSX10.5.sdk I was able to build for 10.5 using 10.8. That no longer works with 10.9, and I've been building lately on an old MacPro running 10.6.  That box is going to be replaced by a new "trash can" Mac Pro in the next month or so, and I'll have to come up with a new approach. One way would be a 10.8 VM. Another possibility is a self-built GCC. I'm reasonably satisfied that with 10.6.1 we've fixed the important bugs so that I can spend some time working on something else.

> 
> This also warned me that src/engine/GNCId.h needs multiple include guards.  Looking at it, I think it really needs to be given a decent burial.  It includes one #define that, as far as I can tell, is never used.

That does indeed seem to be the case. Nuke it at your pleasure.

> 
> I do use XCode to debug Gnucash.  I don't build it there, but it works fine as a GUI for the debugger.  Somewhat to my surprise, lldb is happy to debug code produced by gcc.

On the subject of Xcode, you committed a change to .gitignore a few weeks ago to exclude .xcodeproj. Would you mind sharing the .xcodeproj? I'd suggest putting it in the repo but I'm not sure that they're static enough for that to work well. I'm particularly interested in doing some profiling: I've noticed that GnuCash 2.6.0 stalls a lot and I want to know why. That's easier to do directly in Xcode than doing a -prof build and then running the Instruments part of Xcode on the result.

Regards,
John Ralls


More information about the gnucash-devel mailing list