Incompatibility with CMake 2.8.4+/boost1.50+ still not fixed

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
TheSHEEEP
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 972
Joined: Mon Jun 02, 2008 6:52 pm
Location: Berlin
x 65

Incompatibility with CMake 2.8.4+/boost1.50+ still not fixed

Post by TheSHEEEP »

Hey,

I am just trying to build the newest Ogre from sources (using "default", which already is 1.8 ) and noticed that I still have to download this patch to successfully build with the current CMake version (2.8.8 ) and this patch to use boost 1.50+.
This should really be fixed in the official repo, as this bug is known for a very long time already. And currently, CMake simply cannot be used correctly, especially by people who build Ogre from source the first time and certainly won't use an old CMake version and if they use boost manually, certainly also not an old boost version.

I am just wondering why obvious and absolutely neccessary fixes are not updated to the "default" branch (or whatever this is called in Mercurial ;) ) as soon as they get known. I mean, not trying to insult anyone, really, but where is the problem in the pipeline here? The problem is known, the fix is known... Is probably nobody responsible for applying such fixes to the Mercurial repo?
My site! - Have a look :)
Also on Twitter - extra fluffy
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58

Re: Incompatibility with CMake 2.8.4+/boost1.50+ still not f

Post by CABAListic »

The first is a MinGW issue and isn't even in our tracker as far as I can tell - do we have to keep watch on all possible trackers of all possible addon projects? ;)
The more fundamental problem, though, is that at the moment we simply don't have a MinGW maintainer. I occasionally do MinGW builds, and they've all worked fine. In fact, I'm pretty sure I did something about this particular problem because although my main desktop PC is still on CMake 2.8.3 I did a successful build on a secondary PC with newer CMake, and that worked fine, too. If it's still a problem, it's either a regression, or I missed something, sorry.

As for the second one: So far, most of the patches I've seen on the issue have simply added system and chrono dependencies generally, and that, imho, is wrong, because these dependencies only exist in newer Boost versions. We have recently gotten a newer patch that presumably deals with this depending on the Boost version, I just hadn't the time to review it yet. It will definitely be addressed for 1.8.1, that much I think I can safely promise.

If anyone wants to help on MinGW or general patch review in a more official manner, drop us a line and we'll consider it.
TheSHEEEP
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 972
Joined: Mon Jun 02, 2008 6:52 pm
Location: Berlin
x 65

Re: Incompatibility with CMake 2.8.4+/boost1.50+ still not f

Post by TheSHEEEP »

Ah, yeah, I forgot to add that the first is a MinGW issue. Sorry :oops:

You're right about the current patches always adding the dependencies. I'd just, in some point in the future, stop supporting old boost versions. Having to care about too much legacy stuff always kills something (performance, reliability, user sanity, etc. Just have a look at Windows...). But, imho, an unoptimized fix is better than no fix at all, if declared as such.
The first is a MinGW issue and isn't even in our tracker as far as I can tell - do we have to keep watch on all possible trackers of all possible addon projects? ;)
Well, you know of the problem, obviously, and you are (a very important!) part of the official Ogre dev team. So, if you see such a bug being reported, why don't you check if it is in the tracker, and if not - add it?
Of course, whoever found that bug for the first time could/should have done it, yeah. But you can never demand such a thing from someone who is not an official team member ;)

But if you thought it was fixed, when it wasn't, that's basically bad luck. Happens everywhere :D
Last edited by TheSHEEEP on Mon Jul 16, 2012 12:08 pm, edited 1 time in total.
My site! - Have a look :)
Also on Twitter - extra fluffy
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58

Re: Incompatibility with CMake 2.8.4+/boost1.50+ still not f

Post by CABAListic »

As I said, I thought it was fixed, sorry. (The MinGW problem, that is.)
TheSHEEEP
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 972
Joined: Mon Jun 02, 2008 6:52 pm
Location: Berlin
x 65

Re: Incompatibility with CMake 2.8.4+/boost1.50+ still not f

Post by TheSHEEEP »

Yeah, no hard feelings :)
Nobody can expect anyone to regularly re-check problems he thinks are fixed ;)

Also, who do I need to bribe, should I want to apply as MinGW maintainer?
My site! - Have a look :)
Also on Twitter - extra fluffy
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58

Re: Incompatibility with CMake 2.8.4+/boost1.50+ still not f

Post by CABAListic »

Just let me know, and I'll bring it to the Ogre team for discussion :)
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: Incompatibility with CMake 2.8.4+/boost1.50+ still not f

Post by masterfalcon »

I tried to clean up the boost check a bit and get it working with 1.50 on OS X using MacPorts. How does this work for everyone else?

Code: Select all

diff --git a/CMake/Dependencies.cmake b/CMake/Dependencies.cmake
--- a/CMake/Dependencies.cmake
+++ b/CMake/Dependencies.cmake
@@ -128,21 +128,33 @@
 set(Boost_ADDITIONAL_VERSIONS "1.50" "1.50.0" "1.49" "1.49.0" "1.48" "1.48.0" "1.47" "1.47.0" "1.46" "1.46.0" "1.45" "1.45.0" "1.44" "1.44.0" "1.42" "1.42.0" "1.41.0" "1.41" "1.40.0" "1.40")
 # Components that need linking (NB does not include header-only components like bind)
 set(OGRE_BOOST_COMPONENTS thread date_time)
-find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
-if (NOT Boost_FOUND)
-	# Try again with the other type of libs
+find_package(Boost QUIET)
+if (Boost_FOUND)
 	if(Boost_USE_STATIC_LIBS)
 		set(Boost_USE_STATIC_LIBS OFF)
 	else()
 		set(Boost_USE_STATIC_LIBS ON)
 	endif()
-	find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
+
+    if(Boost_VERSION GREATER 104700)
+        set(OGRE_BOOST_COMPONENTS thread date_time system)
+    endif()
+    if(Boost_VERSION GREATER 104900)
+        set(OGRE_BOOST_COMPONENTS thread date_time system chrono)
+    endif()
+    find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
 endif()
-find_package(Boost QUIET)
+
 # Optional Boost libs (Boost_${COMPONENT}_FOUND
 macro_log_feature(Boost_FOUND "boost" "Boost (general)" "http://boost.org" FALSE "" "")
 macro_log_feature(Boost_THREAD_FOUND "boost-thread" "Used for threading support" "http://boost.org" FALSE "" "")
 macro_log_feature(Boost_DATE_TIME_FOUND "boost-date_time" "Used for threading support" "http://boost.org" FALSE "" "")
+if(Boost_VERSION GREATER 104700)
+    macro_log_feature(Boost_SYSTEM_FOUND "boost-system" "Used for threading support" "http://boost.org" FALSE "" "")
+endif()
+if(Boost_VERSION GREATER 104900)
+    macro_log_feature(Boost_CHRONO_FOUND "boost-chrono" "Used for threading support" "http://boost.org" FALSE "" "")
+endif()
 
 # POCO
 find_package(POCO)
Transporter
Minaton
Posts: 933
Joined: Mon Mar 05, 2012 11:37 am
Location: Germany
x 110

Re: Incompatibility with CMake 2.8.4+/boost1.50+ still not f

Post by Transporter »

masterfalcon wrote:I tried to clean up the boost check a bit and get it working with 1.50 on OS X using MacPorts. How does this work for everyone else?
Can you update

Code: Select all

Boost_ADDITIONAL_VERSIONS
in your patch please?

Code: Select all

set(Boost_ADDITIONAL_VERSIONS "1.51" "1.51.0" "1.50" "1.50.0" "1.49" "1.49.0" "1.48" "1.48.0" "1.47" "1.47.0" "1.46" "1.46.0" "1.45" "1.45.0" "1.44" "1.44.0" "1.42" "1.42.0" "1.41.0" "1.41" "1.40.0" "1.40")
The mentioned thread & patch at http://www.ogre3d.org/forums/viewtopic. ... ilit=boost supports boost 1.51 (current dev version).
CABAListic wrote:As for the second one: So far, most of the patches I've seen on the issue have simply added system and chrono dependencies generally, and that, imho, is wrong, because these dependencies only exist in newer Boost versions. We have recently gotten a newer patch that presumably deals with this depending on the Boost version, I just hadn't the time to review it yet. It will definitely be addressed for 1.8.1, that much I think I can safely promise.
I'm wondering about this statement, becaus my patch doesn't simply added system and chrono dependencies generally. There is a version check inside as you can see it in masterfalcons post:

Code: Select all

    if(Boost_VERSION GREATER 104700)
        set(OGRE_BOOST_COMPONENTS thread date_time system)
    endif()
    if(Boost_VERSION GREATER 104900)
        set(OGRE_BOOST_COMPONENTS thread date_time system chrono)
    endif()
If you like you can change this to

Code: Select all

    if(Boost_VERSION GREATER 10490)
        set(OGRE_BOOST_COMPONENTS thread date_time system chrono)
    endif()
which setup chrono and system for 1.5x.

Btw, cmake-2.8.8 & boost 1.51 is working for me (with boost-patch).
Transporter
Minaton
Posts: 933
Joined: Mon Mar 05, 2012 11:37 am
Location: Germany
x 110

Re: Incompatibility with CMake 2.8.4+/boost1.50+ still not f

Post by Transporter »

Not bad! https://bitbucket.org/sinbad/ogre/chang ... cies.cmake

Code: Select all

set(Boost_ADDITIONAL_VERSIONS "1.51" "1.51.0" "1.50" "1.50.0" "1.49" "1.49.0" "1.48" "1.48.0" "1.47" "1.47.0" "1.46" "1.46.0" "1.45" "1.45.0" "1.44" "1.44.0" "1.42" "1.42.0" "1.41.0" "1.41" "1.40.0" "1.40")
# Components that need linking (NB does not include header-only components like bind)
set(OGRE_BOOST_COMPONENTS thread date_time)
find_package(Boost QUIET)
if (Boost_FOUND)
        if(Boost_USE_STATIC_LIBS)
                set(Boost_USE_STATIC_LIBS OFF)
        else()
                set(Boost_USE_STATIC_LIBS ON)
        endif()

    if(Boost_VERSION GREATER 104900)
        set(OGRE_BOOST_COMPONENTS thread date_time system chrono)
    endif()
        find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
endif()
but there is a small mistake. You should check a static boost build if dynamic is NOT found!

Code: Select all

set(Boost_ADDITIONAL_VERSIONS "1.51" "1.51.0" "1.50" "1.50.0" "1.49" "1.49.0" "1.48" "1.48.0" "1.47" "1.47.0" "1.46" "1.46.0" "1.45" "1.45.0" "1.44" "1.44.0" "1.42" "1.42.0" "1.41.0" "1.41" "1.40.0" "1.40")
# Components that need linking (NB does not include header-only components like bind)
set(OGRE_BOOST_COMPONENTS thread date_time)
find_package(Boost QUIET)
if (NOT Boost_FOUND)
        if(Boost_USE_STATIC_LIBS)
                set(Boost_USE_STATIC_LIBS OFF)
        else()
                set(Boost_USE_STATIC_LIBS ON)
        endif()
	find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
endif()
if (Boost_FOUND AND Boost_VERSION GREATER 104900)
    set(OGRE_BOOST_COMPONENTS thread date_time system chrono)
    find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
endif()
There are a few more missing changes:
  • CMake/InstallDependencies.cmake

    Code: Select all

    diff -r 4194d2a3be51 CMake/InstallDependencies.cmake
    --- a/CMake/InstallDependencies.cmake	Mon Jul 02 16:54:00 2012 -0500
    +++ b/CMake/InstallDependencies.cmake	Fri Jul 13 13:46:23 2012 +0200
    @@ -248,6 +248,14 @@
           install(FILES ${Boost_DATE_TIME_LIBRARY_DEBUG} DESTINATION "boost/lib" CONFIGURATIONS Debug)
           install(FILES ${Boost_DATE_TIME_LIBRARY_RELEASE} DESTINATION "boost/lib" CONFIGURATIONS Release)
         endif()
    +    if (Boost_SYSTEM_FOUND)
    +      install(FILES ${Boost_SYSTEM_LIBRARY_DEBUG} DESTINATION "boost/lib" CONFIGURATIONS Debug)
    +      install(FILES ${Boost_SYSTEM_LIBRARY_RELEASE} DESTINATION "boost/lib" CONFIGURATIONS Release)
    +    endif()
    +    if (Boost_CHRONO_FOUND)
    +      install(FILES ${Boost_CHRONO_LIBRARY_DEBUG} DESTINATION "boost/lib" CONFIGURATIONS Debug)
    +      install(FILES ${Boost_CHRONO_LIBRARY_RELEASE} DESTINATION "boost/lib" CONFIGURATIONS Release)
    +    endif()
       endif()
     endif ()
    
  • CMake/Templates/SDK_CMakeLists.txt.in
    Update for 1.51 is missing! You can also change the boost-version-check to your version.
Btw, you should merge your changes from v1-8 to main.
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: Incompatibility with CMake 2.8.4+/boost1.50+ still not f

Post by masterfalcon »

Good catch! And don't worry the changes will find their way back into main. I've just been very busy.
Transporter
Minaton
Posts: 933
Joined: Mon Mar 05, 2012 11:37 am
Location: Germany
x 110

Re: Incompatibility with CMake 2.8.4+/boost1.50+ still not f

Post by Transporter »

masterfalcon wrote:Good catch! And don't worry the changes will find their way back into main. I've just been very busy.
:D Don't worry. I have time, because I can patch it by myself.
Transporter
Minaton
Posts: 933
Joined: Mon Mar 05, 2012 11:37 am
Location: Germany
x 110

Re: Incompatibility with CMake 2.8.4+/boost1.50+ still not f

Post by Transporter »

https://bitbucket.org/sinbad/ogre/chang ... 76a71cb097
I am almost satisfied. Good work! :D

Dependencies.cmake

Code: Select all

set(Boost_ADDITIONAL_VERSIONS "1.51" "1.51.0" "1.50" "1.50.0" "1.49" "1.49.0" "1.48" "1.48.0" "1.47" "1.47.0" "1.46" "1.46.0" "1.45" "1.45.0" "1.44" "1.44.0" "1.42" "1.42.0" "1.41.0" "1.41" "1.40.0" "1.40")
# Components that need linking (NB does not include header-only components like bind)
set(OGRE_BOOST_COMPONENTS thread date_time)
find_package(Boost QUIET)
if (NOT Boost_FOUND)
        if(Boost_USE_STATIC_LIBS)
                set(Boost_USE_STATIC_LIBS OFF)
        else()
                set(Boost_USE_STATIC_LIBS ON)
        endif()
        find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
endif()
if(Boost_FOUND AND Boost_VERSION GREATER 104900)
        set(OGRE_BOOST_COMPONENTS thread date_time system chrono)
        find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
endif()
Let me short explain this variant:
  1. Search for boost 1.40 - 1.51
  2. If NOT Boost_FOUND then switch Boost_USE_STATIC_LIBS and try to find boost again
  3. If Boost_FOUND for static on/off and it is a version above 1.49 then find system and chrono
Your code

Code: Select all

if (NOT Boost_FOUND)
        if(Boost_USE_STATIC_LIBS)
                set(Boost_USE_STATIC_LIBS OFF)
        else()
                set(Boost_USE_STATIC_LIBS ON)
        endif()

    if(Boost_FOUND AND Boost_VERSION GREATER 104900)
        set(OGRE_BOOST_COMPONENTS thread date_time system chrono)
    endif()
        find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
endif()
is not working because fist you look for NOT Boost_FOUND and then you look again for Boost_FOUND without searching for boost before the version switch.

InstallDependencies.cmake
Ok :wink:

SDK_CMakeLists.txt.in
Same mistake like in Dependencies.cmake, change both boost parts to:

Code: Select all

    set(Boost_ADDITIONAL_VERSIONS "1.51" "1.51.0" "1.50" "1.50.0" "1.49" "1.49.0" "1.48" "1.48.0" "1.47" "1.47.0" "1.46" "1.46.0" "1.45" "1.45.0" "1.44" "1.44.0" "1.42" "1.42.0" "1.41.0" "1.41" "1.40.0" "1.40")
    # Components that need linking (NB does not include header-only components like bind)
    set(OGRE_BOOST_COMPONENTS thread date_time)
    find_package(Boost QUIET)
    if (NOT Boost_FOUND)
        if(Boost_USE_STATIC_LIBS)
            set(Boost_USE_STATIC_LIBS OFF)
        else()
            set(Boost_USE_STATIC_LIBS ON)
        endif()
        find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
    endif()    
    if(Boost_FOUND AND Boost_VERSION GREATER 104900)
        set(OGRE_BOOST_COMPONENTS thread date_time system chrono)
        find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
    endif()
Transporter
Minaton
Posts: 933
Joined: Mon Mar 05, 2012 11:37 am
Location: Germany
x 110

Re: Incompatibility with CMake 2.8.4+/boost1.50+ still not f

Post by Transporter »

Yet again, even more boost fixes. Hopefully we're done now.
I think so, thank you for your hard work. :) I hope I have not annoyed you too much. :D

I'll build a new ogre package on friday. If something is not working I'll report it.
Last edited by Transporter on Fri Jul 20, 2012 3:57 pm, edited 1 time in total.
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: Incompatibility with CMake 2.8.4+/boost1.50+ still not f

Post by masterfalcon »

Oh no worries. Just let me know if you find anything. And thanks for putting in your time on this too!
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58

Re: Incompatibility with CMake 2.8.4+/boost1.50+ still not f

Post by CABAListic »

Found one final bug with the Boost check, because it didn't actually search for the components for any Boost version older than 1.50. Fixed.

I also investigated the MinGW bug, and I simply cannot reproduce it. Upgraded CMake to 2.8.8, then created a clean build directory and ran CMake with MinGW makefiles. No problem whatsoever, compiled cleanly, SampleBrowser works. I knew I did something about that problem already, so maybe I only missed some specific combination of MinGW versions or something?
TheSHEEEP
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 972
Joined: Mon Jun 02, 2008 6:52 pm
Location: Berlin
x 65

Re: Incompatibility with CMake 2.8.4+/boost1.50+ still not f

Post by TheSHEEEP »

I was using CMake 2.8.8 and downloaded MinGW using the latest installer ( http://sourceforge.net/projects/mingw/f ... -get-inst/ , in my case 20120426).
And the latest Ogre sources from "default"/"tip" branch, or the latest when I posted the error. ;)

Maybe someone made a change in the meantime?
My site! - Have a look :)
Also on Twitter - extra fluffy
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58

Re: Incompatibility with CMake 2.8.4+/boost1.50+ still not f

Post by CABAListic »

There is currently no one with access rights to the repository who is using MinGW ;)
I was using the v1-8 branch, so maybe there's been a regression (or merge error) in default, I'll have to check that.