CMake build system for Cthugha *looking for testers*

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.
Locked
ender
Halfling
Posts: 99
Joined: Sat May 24, 2008 6:46 am

Re: CMake build system for Cthugha *looking for testers*

Post by ender » Thu Aug 06, 2009 5:24 pm

Enrico wrote:
[ 46%] Building CXX object OgreMain/CMakeFiles/OgreMain.dir/src/OgreSearchOps.cpp.o
Linking CXX shared library ../lib/libOgreMain.so
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/libboost_thread-mt.a(thread.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/libboost_thread-mt.a: could not read symbols: Bad value
collect2: ld returned 1 exit status

So I added -fPIC to all compiler flags in ccmake. Unfortunately, no success, I still get:
I'm getting the very same error above and I'm not well versed with CMake, so ... where is the -fPIC flag to be added to make this fix?
0 x

jonnys
Halfling
Posts: 77
Joined: Thu Mar 27, 2008 7:40 pm

Re: CMake build system for Cthugha *looking for testers*

Post by jonnys » Fri Aug 07, 2009 7:17 am

razor950 wrote:I like the cmake build system very much but I seem to have a issue with getting boost to show up. I have checked my register, and installpath is correct.
I also did the following and nothing. Boost-Threads shows up but Boost doesn't and I even tried to manually put those in cmake as well, nothing either.

Code: Select all

setx BOOST_ROOT C:\dev\boost\boost_1_39
setx BOOST_LIBRARYDIR C:\dev\boost\boost_1_39\lib
setx BOOST_INCLUDEDIR C:\dev\boost\boost_1_39\boost
I have installed boost twice just incase it was something I missed.
I also like this cmake build system but I am having a hard time with getting it to find boost i have literally tried everything i have seen in this thread...(Trust me I have seen many boost problems since the first page of this thread...there are now 14) and I still cant get cmake to find boost. Is there a bug in the cmake system, cmake files or something? why are so many persons complaining about boost problems? I wonder if it is a computer specific problem and only affects select computers... :(

All I see when i reconfigure is:

Code: Select all

Boost_DATE_TIME_LIBRARY_DEBUG-NOTFOUND, Boost_DATE_TIME_LIBRARY_RELEASE-NOTFOUND, Boost_THREAD_LIBRARY_DEBUG-NOTFOUND, Boost_THREAD_LIBRARY_RELEASE-NOTFOUND
It could be a conflict with other software on some persons computers causing it to not find boost... I dont know? :?
0 x

Fulmens
Gremlin
Posts: 151
Joined: Sun Jun 22, 2008 8:29 pm
Location: Nantes, France

Re: CMake build system for Cthugha *looking for testers*

Post by Fulmens » Fri Aug 07, 2009 8:04 am

I don't know what is "setx" (a command in the CMakeLists ?) but i defined environment variables (BOOST_ROOT/INCLUDEDIR/LIBRARYDIR) in Windows System panel (use windows+break then in advanced) and it worked. But each time you change environment variables you need to restart CMake (I didn't need to restart my session).
0 x

jonnys
Halfling
Posts: 77
Joined: Thu Mar 27, 2008 7:40 pm

Re: CMake build system for Cthugha *looking for testers*

Post by jonnys » Fri Aug 07, 2009 8:33 am

Fulmens wrote:I don't know what is "setx" (a command in the CMakeLists ?) but i defined environment variables (BOOST_ROOT/INCLUDEDIR/LIBRARYDIR) in Windows System panel (use windows+break then in advanced) and it worked. But each time you change environment variables you need to restart CMake (I didn't need to restart my session).
"setx" is a command that to set environment variables through command prompt or batch files. Basically it does what u did using the windows system panel(GUI), in command line.


OK I think I got it to work...It was a bit foolish on my part :oops: I actually built ogre cthugha before, without boost, in a folder called "Ogre Build 1" a few days ago. Then I said I why not build ogre with multithreading. So I downloaded the boost libs and stuff, opened up cmake (with the "where is the source code" and "where to build the binaries" options having the the "old" paths (cmake saves your paths by default). I thought it would just refresh everything, and search for boost, when I pressed 'Configure' again .(Guess I was wrong). So I decided to changed the path "where to build binaries" to a new folder, clicked 'Configure' and it magically found the boost libraries. :D

Now all I have to do is clean up all the boost folder copies and environment variables that I made to try get it working, and then pinpoint which one works "out of box".

My advice to you is, if you have any problems finding boost just create a fresh new folder to "build binaries" and click configure again, that is of course if you were using an old path for a build that was not using boost initially.

edit
<Is the latest SVN compatible with Boost 1.39.0?>

Keep up the good work guys.
0 x

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19265
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 2
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by sinbad » Fri Aug 07, 2009 5:26 pm

jonnys wrote: <Is the latest SVN compatible with Boost 1.39.0?>
Yes, that's what I'm using.
0 x

jonnys
Halfling
Posts: 77
Joined: Thu Mar 27, 2008 7:40 pm

Re: CMake build system for Cthugha *looking for testers*

Post by jonnys » Fri Aug 07, 2009 7:37 pm

Ok this is annoying. In the process of cleaning up all the environment variables I made, while trying to get cmake to find boost earlier this morning, I did a fresh setup of cmake and started a new build, and now it cant find the boost libraries again. :x

Can anyone give me all the environment variables that I can enter to make cmake find boost?

I already have:

BOOST_INCLUDEDIR - "C:\boost\boost_1_38\boost"
BOOST_LIBRARYDIR - "C:\boost\boost_1_38\lib"
BOOST_ROOT - "C:\boost\boost_1_38"

And the install root reg key is "C:\boost\boost_1_38\boost"

Anyone have any idea what's causing this problem?

What is the exact process that you should go through to build a multithreaded ogre cthugha build? probably I'm not following the right steps.
0 x

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by jacmoe » Fri Aug 07, 2009 8:49 pm

I have that too - see nothing wrong with it..
Try running set in a command prompt.
You should see a list of environment variables.
0 x
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by CABAListic » Fri Aug 07, 2009 9:28 pm

What exactly is contained within C:\boost\boost_1_38\boost? Does it already contain the boost headers, or is it a parent directory still? If so, you most likely need to set BOOST_ROOT to this instead of what you currently have.
0 x

jonnys
Halfling
Posts: 77
Joined: Thu Mar 27, 2008 7:40 pm

Re: CMake build system for Cthugha *looking for testers*

Post by jonnys » Sat Aug 08, 2009 12:37 am

CABAListic wrote:What exactly is contained within C:\boost\boost_1_38\boost? Does it already contain the boost headers, or is it a parent directory still? If so, you most likely need to set BOOST_ROOT to this instead of what you currently have.
Currently my "C:\boost\boost_1_38\boost" directory has the boost headers (eg version.hpp).
I am going to try what you said by changing the BOOST_ROOT - C:\boost\boost_1_38\boost

Also i just realized any time I click configure it puts
"C:/boost/boost_1_38" in the Boost_INCLUDE_DIR, which, correct me if I'm worng, is the incorrect path (the corect INCLUDEDIR shopuld be "C:/boost/boost_1_38/boost"
0 x

CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by CABAListic » Sat Aug 08, 2009 1:13 am

Ok, no, your boost root is correct, don't change it. Also, the include path is indeed correct, because boost headers are included via #<boost/some_header.hpp>, so the boost dir is not part of the include path. I can't offer any more insight at the moment, though, sorry.
0 x

razor950
Gnoblar
Posts: 9
Joined: Sat Jun 24, 2006 8:56 pm
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by razor950 » Sun Aug 09, 2009 5:31 pm

To fix my issue, all I had to do was install Boost Date and Time, I had installed Boost and Boost Threads but not the other one. I installed it and boost was detected fine right after, maybe in the wiki it should mention that you need to have this three packages if you want to use Boost.
0 x

jonnys
Halfling
Posts: 77
Joined: Thu Mar 27, 2008 7:40 pm

Re: CMake build system for Cthugha *looking for testers*

Post by jonnys » Mon Aug 10, 2009 5:15 pm

Hello Me again, I have cracked it this time finally. :D But before I go into details, when installing boost, using boost pro installer, What variants are required for ogre? Should I get static version of the boost libraries?

This is the screen I'm talking about:
Image

My Past Problem (Solved)
I choose "Multithread Debug DLL" and "Multithread DLL". THIS IS WHY CMAKE COULD NOT FIND IT.
I found out this after saying, OK since I cant use cmake to configure a multithreaded ogre build, then I would just have to do it manually :( . I opened up the generated sln file from cmake, with the boost library variables manually enabled (i.e - **** OGRE_THREAD_SUPPORT - **** OGRE_USE_BOOST that cmake would set if it found the libraries) then I manually wrote the name of the libraries in the "Linker>Input>Additional Dependencies", I clicked build solution and linker errors stating "cant find "libboost_date_time-vc90-mt-1_39", That was it! cmake was looking for boost libraries with the "lib" prefix; but did not find mine because I installed the dynamic DLL versions of the libraries ONLY (which do not have the "lib" prefix before them). I added "lib" to all the names of the dynamic DLL libraries and visual studio gave no more errors. Then I reconfigured cmake with the newly named libraries and BAM! IT FOUND them. :o :D


The reason I made that post first thate state that I got it to work and then why it didn't work
(for reference)
jonnys wrote:
OK I think I got it to work...It was a bit foolish on my part :oops: I actually built ogre cthugha before, without boost, in a folder called "Ogre Build 1" a few days ago. Then I said I why not build ogre with multithreading. So I downloaded the boost libs and stuff, opened up cmake (with the "where is the source code" and "where to build the binaries" options having the the "old" paths (cmake saves your paths by default). I thought it would just refresh everything, and search for boost, when I pressed 'Configure' again .(Guess I was wrong). So I decided to changed the path "where to build binaries" to a new folder, clicked 'Configure' and it magically found the boost libraries. :D

Now all I have to do is clean up all the boost folder copies and environment variables that I made to try get it working, and then pinpoint which one works "out of box".

My advice to you is, if you have any problems finding boost just create a fresh new folder to "build binaries" and click configure again, that is of course if you were using an old path for a build that was not using boost initially.
This happened because the first time I installed the boost libraries (1.38) installed the static too (with "lib" prefix), so it found them, but when trying to pinpoint the problem and cleaning up my environment, I reinstalled boost (1.39) Dynamic DLL versions only of the libraries (without "lib" prefix). I was confused :oops:


Some things I found out while experimenting:
- In windows, environment variables are not enable until the OS is restarted, well at least for Vista. (i.e restarting cmake wont make it recognize environment variables)
- The prefix "lib" needs to before all boost library names for cmake to find them*****


*****NOTE I updated my SVN working copy this morning and saw that CABAListic updated the "dependencies.cmake" I think, to use dynamic boost libraries if the static ones are not found (correct me if I'm wrong CABAListic), that would have helped me a lot earlier, just a bit too late :wink: , good move there to help beginners like me though.

Again thanks for all the help, hope my issues will help some person in the future, and continue to make Ogre the greatest! :) :wink:
0 x

User avatar
SomeFusion
Gremlin
Posts: 191
Joined: Sun Dec 01, 2002 12:38 am

Re: CMake build system for Cthugha *looking for testers*

Post by SomeFusion » Mon Aug 10, 2009 5:16 pm

ender wrote:
Enrico wrote:
[ 46%] Building CXX object OgreMain/CMakeFiles/OgreMain.dir/src/OgreSearchOps.cpp.o
Linking CXX shared library ../lib/libOgreMain.so
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/libboost_thread-mt.a(thread.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/libboost_thread-mt.a: could not read symbols: Bad value
collect2: ld returned 1 exit status

So I added -fPIC to all compiler flags in ccmake. Unfortunately, no success, I still get:
I'm getting the very same error above and I'm not well versed with CMake, so ... where is the -fPIC flag to be added to make this fix?
Has anybody found a solution to this? I have exactly the same problem on Ubuntu Jaunty 64bit.
0 x
Summoning Wars is an open source role-playing game, featuring both a single-player and a multiplayer mode for about 2 to 8 players.
http://www.sumwars.org

CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by CABAListic » Mon Aug 10, 2009 5:25 pm

Run svn update. I changed the CMake scripts to use dynamic boost versions on Linux instead. That should circumvent the -fPIC problem.
0 x

User avatar
SomeFusion
Gremlin
Posts: 191
Joined: Sun Dec 01, 2002 12:38 am

Re: CMake build system for Cthugha *looking for testers*

Post by SomeFusion » Mon Aug 10, 2009 5:38 pm

CABAListic wrote:Run svn update. I changed the CMake scripts to use dynamic boost versions on Linux instead. That should circumvent the -fPIC problem.
Thank you! Works very well!
0 x
Summoning Wars is an open source role-playing game, featuring both a single-player and a multiplayer mode for about 2 to 8 players.
http://www.sumwars.org

T0NY
Gnoblar
Posts: 4
Joined: Fri Jul 24, 2009 5:50 am

Re: CMake build system for Cthugha *looking for testers*

Post by T0NY » Mon Aug 10, 2009 7:08 pm

CABAListic wrote:Run svn update. I changed the CMake scripts to use dynamic boost versions on Linux instead. That should circumvent the -fPIC problem.
Here is more accurate platform check for that:

Code: Select all

===================================================================
--- CMake/Dependencies.cmake    (revision 8962)
+++ CMake/Dependencies.cmake    (working copy)
@@ -118,11 +118,11 @@
 # Find Boost
 # Prefer static linking in all cases
 if (NOT OGRE_BUILD_PLATFORM_IPHONE)
-       if (WIN32 OR APPLE)
+  # Statically linking boost to a dynamic Ogre build doesn't work on Linux 64bit
+       if (UNIX AND ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
+               set(Boost_USE_STATIC_LIBS ${OGRE_STATIC})
+       else () 
                set(Boost_USE_STATIC_LIBS TRUE)
-       else ()
-               # Statically linking boost to a dynamic Ogre build doesn't work on Linux 64bit
-               set(Boost_USE_STATIC_LIBS ${OGRE_STATIC})
        endif ()
        set(Boost_ADDITIONAL_VERSIONS "1.37.0" "1.37" "1.38.0" "1.38" "1.39.0" "1.39" "1.40.0" "1.40")
        # Components that need linking (NB does not include header-only components like bind)
0 x

ender
Halfling
Posts: 99
Joined: Sat May 24, 2008 6:46 am

Re: CMake build system for Cthugha *looking for testers*

Post by ender » Sat Aug 15, 2009 4:02 pm

CABAListic wrote:Run svn update. I changed the CMake scripts to use dynamic boost versions on Linux instead. That should circumvent the -fPIC problem.
I still can't get past this. I also ran 'svn update' on gentoo. My SVN update is at revision 8980.

An edit, running svn update didn't update Dependencies.cmake as you have listed in the checks above.
Last edited by ender on Sat Aug 15, 2009 4:05 pm, edited 1 time in total.
0 x

CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by CABAListic » Sat Aug 15, 2009 4:03 pm

You must do a clean build. Delete CMakeCache.txt, or just use a new build directory.
0 x

iFire
Gnoblar
Posts: 24
Joined: Mon Sep 26, 2005 6:39 am

Re: CMake build system for Cthugha *looking for testers*

Post by iFire » Mon Aug 17, 2009 10:03 pm

Configuring done
CMake Error in Components/Terrain/CMakeLists.txt:
Cannot find source file "OgreTerrainMaterialGenerator.cpp". Tried
extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in
.txx

There only seems to be Components/Terrain/src/OgreTerrainMaterialGeneratorA.cpp

I'm trying to build trunk.
0 x

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19265
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 2
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by sinbad » Wed Aug 19, 2009 8:16 pm

This was a temporary error on my part, fixed yesterday.
0 x

User avatar
Kafu
Halfling
Posts: 50
Joined: Sat Jun 21, 2008 2:55 pm
Location: Italy
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by Kafu » Mon Aug 31, 2009 5:50 pm

I've encountered the same problem, I think to have the solution for you.
Enrico wrote:Hi,

has anybody tried to build Ogre trunk on a 64Bit Linux? I get the following error:
[ 46%] Building CXX object OgreMain/CMakeFiles/OgreMain.dir/src/OgreSearchOps.cpp.o
Linking CXX shared library ../lib/libOgreMain.so
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/libboost_thread-mt.a(thread.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/libboost_thread-mt.a: could not read symbols: Bad value
collect2: ld returned 1 exit status

So I added -fPIC to all compiler flags in ccmake. Unfortunately, no success, I still get:
The error is about how Boost have been compiled, not Ogre. This depends on 64 bits environments. So, to solve this issue on 64 bits platforms you must compile Boost static libraries with "cxxflags=-fPIC" option. This is a piece of a my build script used to compile some dependencies:

Code: Select all

BOOST_BJAM_ARGS="variant=debug,release threading=multi runtime-link=static --with-date_time --with-filesystem --with-program_options --with-regex --with-signals --with-thread --with-system --prefix=$DEST_ROOT/usr cxxflags=-fPIC"
$BOOST_BJAM_BIN $BOOST_BJAM_ARGS stage
$BOOST_BJAM_BIN $BOOST_BJAM_ARGS install
Daniele
0 x
UNAgames - iOS indie developers. Web site, Facebook, Twitter.

User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by masterfalcon » Fri Sep 04, 2009 7:52 am

I've been looking all over for a decent way to add .nib or .xib files to an Xcode project properly. I have to say that I'm at a loss.

Does anyone know how to do this? Otherwise I'll just do what I need to do in code. But Interface Builder makes it so much easier!
0 x

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by jacmoe » Fri Sep 04, 2009 8:05 am

CMake has scripts for Qt - they must have some scripts/macros for XCode, surely?
0 x
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by jacmoe » Sat Sep 05, 2009 5:50 am

This Boost thing is still completely fucked up. :o

The script detects Boost as present, but does not find boost-thread or boost-date_time - I have those in my lib directory.
Actually, in all possible configurations:
boost_date_time-vc90-mt-1_38.lib
boost_date_time-vc90-mt-gd-1_38.lib
boost_thread-vc90-mt-1_38.lib
boost_thread-vc90-mt-gd-1_38.lib
libboost_date_time-vc90-mt-1_38.lib
libboost_date_time-vc90-mt-gd-1_38.lib
libboost_date_time-vc90-mt-s-1_38.lib
libboost_date_time-vc90-mt-sgd-1_38.lib
libboost_date_time-vc90-s-1_38.lib
libboost_date_time-vc90-sgd-1_38.lib
libboost_thread-vc90-mt-1_38.lib
libboost_thread-vc90-mt-gd-1_38.lib
libboost_thread-vc90-mt-s-1_38.lib
libboost_thread-vc90-mt-sgd-1_38.lib
Is there anything else I need to do to make this work?

It finds Boost include directory in C:/boost/boost_1_38 - what's the problem?
Do I really need to set the three Boost environment variables?
Or is my Boost in a non-kosher location? :)
0 x
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by jacmoe » Sat Sep 05, 2009 6:12 am

Code: Select all

SET(_boost_LIBRARIES_SEARCH_DIRS
    C:/boost/lib
    C:/boost
    "$ENV{ProgramFiles}/boost/boost_${Boost_MAJOR_VERSION}_${Boost_MINOR_VERSION}_${Boost_SUBMINOR_VERSION}/lib"
    "$ENV{ProgramFiles}/boost"
    /sw/local/lib
  )
It's a pity we can't change the with CMake shipped find_boost script - it's borked.
I installed Boost using the next, next, next, OK procedure.
And Boost got installed in C:\boost\boost_1_38
The above code should be:

Code: Select all

SET(_boost_LIBRARIES_SEARCH_DIRS
    C:/boost/boost_${Boost_MAJOR_VERSION}_${Boost_MINOR_VERSION}_${Boost_SUBMINOR_VERSION}/lib
    C:/boost_${Boost_MAJOR_VERSION}_${Boost_MINOR_VERSION}_${Boost_SUBMINOR_VERSION}/lib
    C:/boost/lib
    C:/boost
    "$ENV{ProgramFiles}/boost/boost_${Boost_MAJOR_VERSION}_${Boost_MINOR_VERSION}_${Boost_SUBMINOR_VERSION}/lib"
    "$ENV{ProgramFiles}/boost"
    /sw/local/lib
  )
Likewise for the include paths.
0 x
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

Locked