How to compile Wesnoth on Mac OS X

Get help with compiling or installing the game, and discuss announcements of new official releases.

Moderator: Forum Moderators

Locked
User avatar
Simons Mith
Posts: 821
Joined: January 27th, 2005, 10:46 pm
Location: Twickenham
Contact:

Re: How To Compile On A Mac

Post by Simons Mith »

I've tried a few times to compile according to the instructions in this thread, but I'm stopping now to ask for help. It seems since Eleazar's posts the Wesnoth.xcodeproj file is getting too far behind to easily massage back into a working state. But I'm a novice with both the Wesnoth source and XCode, so I could be wrong about how difficult it is.

I've got some UI changes for 1.9.0 (mostly just correcting the case and punctuation in Wesnoth buttons, tooltips and windows) which I wanted to try out before I submit them.

edit: Er, the help I'm asking for is either an updated xproj file or a quick summary of what adjustments I should make to get it working for myself. (I've already done the file pruning suggested upthread, and have added obvious new resources such as the lua directory to my project file). In fact I even tried removing and re-adding the entire /src directory tree, which may have been a step too far.
 
penguin
macOS Packager
Posts: 239
Joined: April 17th, 2004, 5:16 pm
Location: Ontario, Canada
Contact:

Re: How To Compile On A Mac

Post by penguin »

Err, right, sorry I'm being so slow. I will try to get to that very soon.
Simons Mith wrote:In fact I even tried removing and re-adding the entire /src directory tree, which may have been a step too far.
Yeah, that was a step too far - there are some files you need to not include.
User avatar
McShark
Posts: 76
Joined: March 19th, 2008, 10:41 pm

Re: How To Compile On A Mac

Post by McShark »

You could try to install Code::Blocks and use the project files for C::B on mac. Should work (maybe add some defines from the xcode-projectfiles if it doesn't compile correct)

McShark
User avatar
Simons Mith
Posts: 821
Joined: January 27th, 2005, 10:46 pm
Location: Twickenham
Contact:

Re: How To Compile On A Mac

Post by Simons Mith »

I see 1.8.4 has appeared, including a new version for the Mac, but according to svn the xproj file is now seven weeks old. I had assumed it would get updated as a matter of course as part of the latest Mac compile. That hasn't happened, which sort of implies it only gets intermittent updates when someone remembers it. Or am I just not looking in the right place for the right .xproj?

Given that I'm just as much of a novice with, say, Code:Blocks as I am with xprojects - I did check it out, and it looks fine to me as an IDE, so I'd have no issues with switching to it - is it worth switching? My preference is to use whatever compiling method is used by whoever is most active at producing most Mac builds. Once I have an updated and working build setup of my own, I'll be able to keep it working, I hope, but at present I'm stalled, and there are some 1.9-svn changes I want to try out.
 
User avatar
Eleazar
Retired Terrain Art Director
Posts: 2481
Joined: July 16th, 2004, 1:47 am
Location: US Midwest
Contact:

Re: How To Compile On A Mac

Post by Eleazar »

We are looking at a development release soon. I haven't been able to compile for several weeks since i switched to Snow Leopard. I'm holding out with the assumption that we'll get a binary and hopefully an updated project soon after that release...
Feel free to PM me if you start a new terrain oriented thread. It's easy for me to miss them among all the other art threads.
-> What i might be working on
Attempting Lucidity
User avatar
McShark
Posts: 76
Joined: March 19th, 2008, 10:41 pm

Re: How To Compile On A Mac

Post by McShark »

@Simons Mith: Did you try tro compile wesnoth with C::B? I can update the project files, but because of me compiling on a windows machine I cannot help to get the prerequistes working (it should work the same way as it does with xproj).

human
User avatar
Simons Mith
Posts: 821
Joined: January 27th, 2005, 10:46 pm
Location: Twickenham
Contact:

Re: How To Compile On A Mac

Post by Simons Mith »

@McShark: I haven't yet, because AFAICS I'd just be switching from a Mac build I can't coax into working under Xcode into one I can't coax into working under Code:Blocks. In both cases, AIUI the bits stopping things from working are mostly the Mac-specific parts. If I had a working xproj, I could probably migrate it to Code:Blocks, but if I had a working xproj, I wouldn't need to migrate... It's the usual story; once you've seen something working once, you know what behaviour to expect, and breakages are much easier to fix. But if you've never seen whatever-it-is behaving correctly, as I haven't yet, even trivial fixes are much harder. More sensible to wait for a known good setup to come along, I think.
 
penguin
macOS Packager
Posts: 239
Joined: April 17th, 2004, 5:16 pm
Location: Ontario, Canada
Contact:

Re: How To Compile On A Mac

Post by penguin »

Err, right, sorry for neglecting this for so long! I haven't done anything with the project file in svn (ever), because I haven't tried to compile 1.9 yet. Usually I just update when there's a release and build right then - and there hasn't been a 1.9 release yet.

I've tried CodeBlocks, and personally I wouldn't recommend it. But that's just me.

EDIT: I'm working on building 1.9 now. There have been quite a few changes since 1.8. I'm simultaneously changing things so the project works in projectfiles/Xcode/. Does anyone want to be able to build 1.8 too, or is everyone just interested in 1.9?
penguin
macOS Packager
Posts: 239
Joined: April 17th, 2004, 5:16 pm
Location: Ontario, Canada
Contact:

Re: How To Compile On A Mac

Post by penguin »

I've committed an updated project file to projectfiles/Xcode/, with a readme, and a new zip of libraries and headers on SF (the link is in the readme). Let me know if you have any problems!
User avatar
Dixie
Posts: 1757
Joined: February 10th, 2010, 1:06 am
Location: $x1,$y1

Re: How To Compile On A Mac

Post by Dixie »

Eleazar wrote:We are looking at a development release soon.
Any idea how soon that may be? Like, a few days, 2-3 weeks, about a month or two...? I'm of course not gonna die if I have to wait after 1.9 for some time, but I was eager to test some stuff with it. I downloaded today's daily snapshot tarball, but seeing how I'm on OS X 10.4.11, my Xcode is outdated and I sadly couldn't build the app. :(

Thanks, and keep up the good work! :)
Jazz is not dead, it just smells funny - Frank Zappa
Current projects: Internet meme Era, The Settlers of Wesnoth
User avatar
Simons Mith
Posts: 821
Joined: January 27th, 2005, 10:46 pm
Location: Twickenham
Contact:

Re: How to compile Wesnoth on Mac OS X

Post by Simons Mith »

It's been a good year since I tried to compile from source and I seem to have fallen behind the curve again. Issues arising are:

1. The game now seems to require GCC4.2. XCode 3.0 only goes up to GCC4.0, so it appears you now need Xcode 3.1 to compile the game. If this is right, the minimum version listed in the readme needs to be bumped.

2. On compiling, I found I also needed libpng and boost. I got hold of boost 1.47.0 and libpng 1.0.56, and got a failed compile with 11 errors 2 warnings. The libpng problem was my own fault; I downloaded a very old libpng by mistake. So I'll try fixing that and report back later with the 1.5.5 I've just obtained. I assume I don't have to have exactly the same version number, just equal or better?

However, I also seem to need various libboost_[foo]w.dylib files. (regexw, systemw and others), and my wesnoth_compile_mac_1.9.zip file only contained the gcc4.0 versions, e.g. libboost_iostreams-xgcc40-mt-1_37.dylib etc.

Where do I get the shiny new libboost_[foo]w.dylib files I also need? They don't seem to have the w suffix in boost 1.47.0. On this bit I'm rather more stumped.

Current compile errors are:
Spoiler:
[I have since removed the wesnothd dependency, but it looks like I'll still need libboost_iostreamsw, program_optionsw, regexw, systemw, threadw]
 
User avatar
Alarantalara
Art Contributor
Posts: 786
Joined: April 23rd, 2010, 8:17 pm
Location: Canada

Re: How to compile Wesnoth on Mac OS X

Post by Alarantalara »

The "w" is a suffix to help me separate them from other versions of boost that I have. Just renaming the boost 1.47 files you already have should work fine. (The version in wesnoth is a universal binary. I have another copy that's specific to my hardware and this lets me keep them straight when building.)

GCC 4.2 is required for OpenMP support. If you turn it off (may not be possible using Xcode 3.0), then it should still compile with 4.0. I'm likely going to revert it back to 4.0 and without OpenMP support unless I can resolve some of the bugs that are associated with it.
User avatar
Simons Mith
Posts: 821
Joined: January 27th, 2005, 10:46 pm
Location: Twickenham
Contact:

Re: How to compile Wesnoth on Mac OS X

Post by Simons Mith »

I've tried a large number of different permutations and still can't get Wesnoth to compile. Actually, it compiles OK, but I get six errors from the linker:
Spoiler:
This is using rev 51654. I snagged that specificially because I saw that the xcodeproj file had been very recently updated, and I assumed that that would make it easier to get it to compile cleanly. I'm on MacOs 10.5.8, Xcode 3.1, and my selected build SDK/config/etc. is 10.5/Release/Wesnoth/i386
I removed the wesnothd direct dependency. I think my dylibs are all up to date. I've got OpenMP support currently disabled, and I'm using GCC4.0 as the compiler. But I think I've tried almost all the other possible combinations of OpenMP, GCC, target OS version etc., and the errors I see have been the same for all of them. It's the various boost dylibs that appear to be the problem - what am I doing wrong?
 
User avatar
Alarantalara
Art Contributor
Posts: 786
Joined: April 23rd, 2010, 8:17 pm
Location: Canada

Re: How to compile Wesnoth on Mac OS X

Post by Alarantalara »

This error message makes me wonder:
boost::system::get_system_category()

Have you updated the header files as well as the dylibs for boost? It's defined as an inline function in the header file in my copy (1.45), so I'd expect that it not being found is related to the header files being out of date rather than the compiled libraries.

It may not be the only problem, but perhaps it will help.
User avatar
Simons Mith
Posts: 821
Joined: January 27th, 2005, 10:46 pm
Location: Twickenham
Contact:

Re: How to compile Wesnoth on Mac OS X

Post by Simons Mith »

That was it. Thanks. I had a working copy of the game within 15 minutes, once I'd updated the header files too.
 
Locked