Mac OS X 10.9 Mavericks : Some progress but now Boost errors

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Message
Author
nickshanks
Space Krill
Posts: 5
Joined: Sun Nov 10, 2013 8:24 am

Mac OS X 10.9 Mavericks : Some progress but now Boost errors

#1 Post by nickshanks »

I have just downloaded the FO code for the first time, and tried to compile it. Here are my findings:
  • There are certain files in the Mac SDK which are not in SVN. The Compiling wiki page implies that FO can be built just from an svn checkout, which is what I first tried. This is untrue, and the wiki page should be modified to require that the SDK be downloaded, and its configure script run as the very first step. (This script does an svn checkout anyway.)
  • The Xcode project is configured to build against the Mac OS 10.5 and 10.6 SDKs. Xcode in Mavericks only comes with the 10.8 and 10.9 SDKs. To resolve this, I copied over the 10.4u, 10.5, 10.6, and 10.7 SDKs from old copies of Xcode I had lying around into the Xcode application bundle (specially, into the /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ folder). Conceivably, it may be possible to build against the 10.8 or 10.9 SDK but I felt installing old SDKs was more likely to succeed. Other users may not have a choice.
  • The Xcode project is configured to build with GCC, except one target which was set up to test LLVM 4.4 compilation. Well GCC is no longer installed with Xcode 5, and only LLVM 5.0 is available. I changed the compiler for all targets to LLVM 5 in the project build settings.
Following all that, and some dead ends installing boost via homebrew and changing the library and include paths (before I discovered the SDK), I now run into the following errors which I have been unable to resolve (4 errors, all the same message but from different files, one for each build thread).

Can anyone help?

Code: Select all

/Users/nickshanks/Projects/FreeOrion/FreeOrion/Xcode/dep/include/boost/mpl/aux_/preprocessed/gcc/and.hpp:51:11: Recursive template instantiation exceeded maximum depth of 128

at BOOST_MPL_AUX_NESTED_TYPE_WKND(T1)::value
from function:

template<
      typename BOOST_MPL_AUX_NA_PARAM(T1)
    , typename BOOST_MPL_AUX_NA_PARAM(T2)
    , typename T3 = true_, typename T4 = true_, typename T5 = true_
    >
struct and_

    : aux::and_impl<
          BOOST_MPL_AUX_NESTED_TYPE_WKND(T1)::value
        , T2, T3, T4, T5
        >

{
    BOOST_MPL_AUX_LAMBDA_SUPPORT(
          5
        , and_
        , ( T1, T2, T3, T4, T5)
        )
};

Code: Select all

/Users/nickshanks/Projects/FreeOrion/FreeOrion/Xcode/dep/include/boost/type_traits/remove_cv.hpp:56:66: Recursive template instantiation exceeded maximum depth of 128

//  convert a type T to a non-cv-qualified type - remove_cv<T>
BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_cv,T,typename boost::detail::rvalue_ref_filter_rem_cv<T>::type)
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_cv,T&,T&)

Code: Select all

/Users/nickshanks/Projects/FreeOrion/FreeOrion/Xcode/dep/include/boost/type_traits/is_pointer.hpp:82:26: Recursive template instantiation exceeded maximum depth of 128

at ::boost::detail::is_pointer_helper<typename remove_cv<T>::type>::value
from function:

struct is_pointer_impl
{
#if BOOST_WORKAROUND(BOOST_MSVC,<=1300)
    ...
#else
    BOOST_STATIC_CONSTANT(bool, value =
        (::boost::type_traits::ice_and<
        ::boost::detail::is_pointer_helper<typename remove_cv<T>::type>::value
            , ::boost::type_traits::ice_not<
                ::boost::is_member_pointer<T>::value
                >::value
            >::value)
        );
#endif
};

Code: Select all

/Users/nickshanks/Projects/FreeOrion/FreeOrion/Xcode/dep/include/boost/type_traits/is_member_function_pointer.hpp:47:29: Recursive template instantiation exceeded maximum depth of 128

#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(BOOST_TT_TEST_MS_FUNC_SIGS)

BOOST_TT_AUX_BOOL_TRAIT_DEF1(
      is_member_function_pointer
    , T
    , ::boost::type_traits::is_mem_fun_pointer_impl<typename remove_cv<T>::type>::value
    )

#else
Last edited by nickshanks on Sun Nov 10, 2013 3:38 pm, edited 1 time in total.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Mac OS X 10.9 Mavericks : Some progress but now Boost er

#2 Post by Geoff the Medio »

nickshanks wrote:The Compiling For Mac wiki page implies that FO can be built on a Mac just from an svn checkout...
It does? I see
Compile in MacOsX wiki page wrote:Software Requirements

Mac OS X 10.6.8 or later

Xcode 3.2 or later - Just get the latest version of Xcode from the Mac App Store for free.

Subversion - Subversion should be automatically installed when you install Xcode.

The latest version of the FreeOrion SDK

nickshanks
Space Krill
Posts: 5
Joined: Sun Nov 10, 2013 8:24 am

Re: Mac OS X 10.9 Mavericks : Some progress but now Boost er

#3 Post by nickshanks »

I see this:
== Subversion ==

The source code can be obtained from the sourceforge Subversion server, using this command from the Linux command prompt:
svn co https://svn.code.sf.net/p/freeorion/code/trunk freeorion
For Windows, a graphical shell-extension SVN client, such as TortoiseSVN is recommended, with which the source can be obtained from https://freeorion.svn.sourceforge.net/s ... rion/trunk or by just updating the FreeOrion code directory present in the SDK. If you have the SDK and TortoiseSVN installed, right click on the FreeOrion directory in the SDK directory, and pick "Update" in the submenu (at the top). If you don't have "Update" but just have "SVN Upgrade Working Copy", do that first, and then update.

== FreeOrion SDK ==

Alternatively, you can download the FreeOrion SDK (Windows and MacOSX) and update that directory tree with SVN.
emphasis mine.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Mac OS X 10.9 Mavericks : Some progress but now Boost er

#4 Post by Geoff the Medio »

That's an alternative way to get the source code, not everything you need to build FreeOrion.

The SDK isn't required... it's just a lot less work than building all the dependencies from source.

Specific suggestions to clarify the the wiki, or offers to improve it yourself, are welcome, though.

About your template depth issue, there appears to be a workaround discussed here for GCC: http://stackoverflow.com/questions/1227 ... -up-limits Might it also work for LLVM?

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

Re: Mac OS X 10.9 Mavericks : Some progress but now Boost er

#5 Post by Vezzra »

nickshanks wrote:Can anyone help?
Well, let's see ;) I'm the current maintainer of the Mac OSX SDK, so I'll try to answer at least some of your questions.

Concerning the wiki compile pages, Geoff already pointed out that of course the SDK isn't absolutely necessary. You can just get the source from SVN, set up your dev environment, build all the prerequisites yourself etc. You really need to know what you're doing though, and even if, it's kind of a masochistic approach, if you ask me, when everything is already neatly prepared for you, in the form of our SDKs ;) As far as I can see, the wiki doesn't suggest that you could just check out the source and build.

That said, the FO OSX SDK is definitely not ready for Maverick, I can't even tell how well it worked for Lion and Mountain Lion, as I'm still on Snow Leopard (10.6) myself (and I didn't get much complaints about the SDK not working until now, so I assume it worked reasonably well). As you noticed, there is a build configuration that uses LLVM instead of GCC, that's one of my attempts to get FO compile with LLVM. Unfortunately, I've not yet succeeded in this endeavour. If you can't get Xcode 4 on Maverick, and Xcode 5 doesn't have GCC anymore, only LLVM, you're out of luck building FO on Maverick for the time being - sorry :(

I definitely do intend to get around to upgrade the SDK to Maverick, Xcode 5 and LLVM eventually, but I'm too busy and have too less spare time for FO related stuff currently, so that might take a while. My first chance to get that done is by the end of the year. That is, provided that I can make builds that still run on 10.6 with an upgraded SDK, I'm extremely reluctant to give up 10.6 compatibility. It irks me already that I haven't been able to provide builds that can run on 10.5., given the fact that 10.5 is just a few years old :( So there is no way I'm going to give up 10.6 compatibility, unless the dev team decides otherwise (that might come up if we decide that we want to take advantage of c++11 features, which in turn would require me to set the deployment target to at least 10.7, as I've already found out).

That said, you're more than welcome to help with getting the SDK to work on Maverick :D That I haven't been able to get it to work doesn't mean it's not possible or even too hard, I'm certainly not very experienced with OSX development. To be honest, I'm glad I've been able to keep the FO OSX SDK working so far. Getting it Maverick ready is going to be a very daunting challenge for me. Having another OSX dev joining the project, who has a better idea of what he's doing would be great :D

nickshanks
Space Krill
Posts: 5
Joined: Sun Nov 10, 2013 8:24 am

Re: Mac OS X 10.9 Mavericks : Some progress but now Boost er

#6 Post by nickshanks »

Geoff the Medio wrote:That's an alternative way to get the source code, not everything you need to build FreeOrion.

The SDK isn't required... it's just a lot less work than building all the dependencies from source.
Ahh, now I understand. I was implicitly meaning "using the provided Xcode project, without having to change all the dependency paths"
Geoff the Medio wrote: Specific suggestions to clarify the the wiki, or offers to improve it yourself, are welcome, though.
Yes, gladly. Plebs are not permitted to create wiki accounts though. Could you set us up the bomb?
For what it's worth, I recently did this:
http://wiki.openttd.org/?title=Compilin ... ldid=82460
Geoff the Medio wrote: About your template depth issue, there appears to be a workaround discussed here for GCC: http://stackoverflow.com/questions/1227 ... -up-limits Might it also work for LLVM?
I will take a look, thanks.

nickshanks
Space Krill
Posts: 5
Joined: Sun Nov 10, 2013 8:24 am

Re: Mac OS X 10.9 Mavericks : Some progress but now Boost er

#7 Post by nickshanks »

Geoff the Medio wrote:About your template depth issue, there appears to be a workaround discussed here for GCC: http://stackoverflow.com/questions/1227 ... -up-limits Might it also work for LLVM?
Yep! Adding -ftemplate-depth=1024 fixed that issue.

I was then able to compile all of the FreeOrionAI and FreeOrionServer targets and the prerequisites for FreeOrionClient, but not the client itself.

LLVM just didn't like the macros in <GG/SignalTemplate.h> and <GG/SignalsAndSlots.h>, causing numerous errors along the lines of function Connect(<foo>, <bar>) not found, candidates were Connect(<baz>), and Connect(<wibble>, <wobble>, <wubble>) [with quite a few variants]

I tried various ways of getting it to compile with GCC (apple-gcc4_2 and gcc-4.5 both via homebrew) but those had their own problems, especially related to linking to functions declared in MacWindows.h in Carbon.framework, and seeming some i386 architecture libs were not found. I have not been able to get the client to build.

Additionally, only the 10.7 SDK had the /usr/include/c++/4.2.1/bits/c++config.h file and similar c++*.h files in bits/

Vezzra, I would recommend you change the System Framework paths from "Absolute Path" to "Relative to SDK" though, and then change the actual frameworks pointed at to be the ones inside the 10.6 SDK on your system (so there are no ../../ path parts), rather than the live frameworks in /System.
That just makes the project file a little more portable.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Mac OS X 10.9 Mavericks : Some progress but now Boost er

#8 Post by Geoff the Medio »

nickshanks wrote:Yes, gladly. Plebs are not permitted to create wiki accounts though. Could you set us up the bomb?
Check the email you specified when registering on the forums.

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

Re: Mac OS X 10.9 Mavericks : Some progress but now Boost er

#9 Post by Vezzra »

nickshanks, in case you're still reading our forum: I've upgraded the SDK and the Xcode project to Xcode 5 and OSX 10.8+. If you want, you can give building FO on your system another try now.

nickshanks
Space Krill
Posts: 5
Joined: Sun Nov 10, 2013 8:24 am

Re: Mac OS X 10.9 Mavericks : Some progress but now Boost er

#10 Post by nickshanks »

Vezzra wrote:nickshanks, in case you're still reading our forum: I've upgraded the SDK and the Xcode project to Xcode 5 and OSX 10.8+. If you want, you can give building FO on your system another try now.
Thanks, will do.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Mac OS X 10.9 Mavericks : Some progress but now Boost er

#11 Post by Geoff the Medio »

What boost version and Ogre version have you used in the latest SDK?

It might be helpful to be using Boost 1.54 to give access to Log, and might as well bump to 1.55, the latest release.

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

Re: Mac OS X 10.9 Mavericks : Some progress but now Boost er

#12 Post by Vezzra »

Geoff the Medio wrote:What boost version and Ogre version have you used in the latest SDK?
I didn't upgrade Ogre or boost, so still the same as before: Ogre 1.8.1 and boost 1.51. I try to use the same versions of Ogre and boost in the OSX SDK as are used in the Windows SDK, so if platform specific issues/errors arise, we can rule out different versions of Ogre/boost as the cause.
It might be helpful to be using Boost 1.54 to give access to Log, and might as well bump to 1.55, the latest release.
If you think that another round of updates for these libraries is due, why not? I'd prefer to do that for both platforms though, for the reason given above. Additionally, if we are going through the trouble of recompiling boost, we might as well considering upgrading to Ogre 1.9, what do you think?

Also, do you want to do that before the 0.4.4 release?

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

Re: Mac OS X 10.9 Mavericks : Some progress but now Boost er

#13 Post by Vezzra »

nickshanks wrote:Vezzra, I would recommend you change the System Framework paths from "Absolute Path" to "Relative to SDK" though, and then change the actual frameworks pointed at to be the ones inside the 10.6 SDK on your system (so there are no ../../ path parts), rather than the live frameworks in /System.
That just makes the project file a little more portable.
FYI, I've done that too now.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Mac OS X 10.9 Mavericks : Some progress but now Boost er

#14 Post by Dilvish »

Vezzra wrote:Additionally, if we are going through the trouble of recompiling boost, we might as well considering upgrading to Ogre 1.9, what do you think?
I see that the Ogre folks are encouraging everyone to move up to Ogre 1.9 wherever possible, for bugfixes etc., but some input from Apo and/or adrian_broher would be nice if possible. For Ubuntu (and probably other linux varieties) Ogre 1.9 is only available as a prebuilt package in the most very recent versions (14.04, out for about six months now), which many people (including myself) haven't moved to yet. For any of us compiling FO ourselves it's a fairly modest issue to also compile and install Ogre 1.9 or whatever, but if we're wanting Apo's Linux prebuilt FO packages to stay in sync with the MacOS packages and Windows packages for the same reasons as keeping those two in sync with each other, then there might be a little issue about this. (Or maybe Apo will be just as happy to move up to Ogre 1.9, I don't know).
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Mac OS X 10.9 Mavericks : Some progress but now Boost er

#15 Post by Geoff the Medio »

Vezzra wrote:Also, do you want to do that before the 0.4.4 release?
No.

Post Reply