Proposal: Switch the MacOSX builds from i386 to x86_64

Discussion about the project in general, organization, website, or any other details that aren't directly about the game.
Post Reply
Message
Author
User avatar
mem359
Dyson Forest
Posts: 214
Joined: Sun Jun 08, 2014 1:18 am

Proposal: Switch the MacOSX builds from i386 to x86_64

#1 Post by mem359 »

This is for people (like me) who are running the game on a Mac.

I am suggesting that we switch the SDK and FO from the current 32-bit builds (i386) to 64 bits (x86_64).
I've been tinkering around with both github repositories (for other reasons), and am willing to make the necessary pull requests for this transition, if people agree with it.

EDIT: I should have mentioned... The libraries have to be rebuilt anways, to make the compiler flag visibility=hidden consistent for all the software. As long as the recompile needs to be done, this is an opportunity to also deal with anything else we'd like to change for the Mac OSX build libraries.

With the latest release, the project is supporting from OSX 10.9 onwards, which is well after the transition to 64 bit machines and OS. We might want to keep a copy of the current (i386) Mac SDK around, in case of emergency. But otherwise, have the SDK build x86 libraries, and then use those libraries for the game build.

Assuming I've done things correctly, I haven't noticed any problems with my test build, which started with the Github SDK source code. The game seems normal through 100 turns so far.

The limitations right now (at least on the Mac side) are that universal 32 & 64 bit builds won't work.
(There is some discussion here https://github.com/freeorion/freeorion-sdk/pull/21 )
The major culprit is libpng. After spending time getting the internal CMake files to handle 2 architectures, the compiler complains: clang: error: cannot use 'cpp-output' output with multiple -arch options
And python is giving me headaches too.
It will be a Pain In The Ass to get everything working for a universal build.
Much simpler to stick with one architecture (but make that arch x86_64).

User avatar
Vezzra
Release Manager, Design
Posts: 6090
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Proposal: Switch the MacOSX builds from i386 to x86_64

#2 Post by Vezzra »

I'm very much for doing this change, as OSX has been 64bit since 10.6. The only reason why I didn't do it myself already was because I failed to build all dependencies for 64bit (IIRC Python being the biggest pain here), and then Marcel mentioned the issues with libpng. As I found myself out of my depth solving these issues, I more or less have been waiting for someone more knowledgeable to deal with this.

So if you want to give it a try, by all means, be my guest.

Wrt to universal binaries, I don't see a point in trying to support the i386 architecture. What for? We deprecated support for OSX versions prior to 10.9, so supporting x86_64 only should be sufficient. No point in making things needlessly complicated.

User avatar
mem359
Dyson Forest
Posts: 214
Joined: Sun Jun 08, 2014 1:18 am

Re: Proposal: Switch the MacOSX builds from i386 to x86_64

#3 Post by mem359 »

What is holding me up currently is using "-fvisibility=hidden" for the SDK.
When I use those built libraries for the FO clients, I get linking errors all over the place from missing Boost symbols.
(It might be a problem with how the FO code uses Boost, if it is calling now-hidden functions, but I need to investigate more.)

I'm trying to figure out exactly what set of compile/linking options we want for both builds.
(There are some in the SDK that should probably be used with the FO build but aren't, and vice versa.)
If anyone has confidence in their answers, I'd be glad for the suggestions.

For example (all specific for the Mac build):
- Do we want "-fvisibility-inlines-hidden", since that normally goes with "-fvisibility=hidden"?
- There was an error/typo with CMake using BOOST_ALL_NO_LINK (doesn't exist) when it should have been BOOST_ALL_NO_LIB. Do we want any other Boost config-options?
- Is the only reason for "-undefined dynamic_lookup" so that the compiler doesn't look for other Frameworks installed on the system? (There might be another way to solve that.) Should we also use BOOST_ALL_STATIC_LINK?

User avatar
mem359
Dyson Forest
Posts: 214
Joined: Sun Jun 08, 2014 1:18 am

Re: Proposal: Switch the MacOSX builds from i386 to x86_64

#4 Post by mem359 »

The PR for the Mac SDK has been submitted.
https://github.com/freeorion/freeorion-sdk/pull/29

The PR for the FO has also been submitted, but that will need to be synchronized with the SDK commit.
https://github.com/freeorion/freeorion/pull/1585

At least on my home machine, I was able to successfully make the FO game with the new 64-bit libraries, and it appears to run normally.
I used CMake for the SDK, and Xcode for the FO build.
(Getting the Boost libraries straightened out for the SDK also resulted in fewer "warnings" for the FO build.)

Post Reply