Can't compile (Ubuntu 10.04). Boost problem.

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Post Reply
Message
Author
GrandSatrap
Space Krill
Posts: 7
Joined: Mon Jul 23, 2012 1:11 pm

Can't compile (Ubuntu 10.04). Boost problem.

#1 Post by GrandSatrap »

I've tried to follow the compile instructions at http://www.freeorion.org/index.php/Comp ... the_source
However, they do need updating, so I've been keeping track of each step I do (hoping that eventually, once it works, I'll be able to update the Wiki linux compile page).

First: I don't write in C++ so I can't fix bugs and I don't understand the compiler stuff. I have never used Boost or GiGi. In other words, I'm flying blind, following instructions and trying to make intelligent guesses.

Second: Here is the error:

Code: Select all

/home/griffin/games/FreeOrion>cmake .
-- Build platform: linux
-- Configuring freeoriond
-- Configuring freeorionca
-- Could NOT find Boost
CMake Error at client/AI/CMakeLists.txt:30 (message):
  Boost libraries not found.

-- Configuring incomplete, errors occurred!
Problem: I believe that I have Boost installed correctly (how can I tell?) -- the problem is just getting FreeOrion to see Boost. I don't know how to do that - which config file to edit or which environment variable to set.

Third: here are my steps so far:

Code: Select all

#Follow instructions from this page: http://www.freeorion.org/index.php/Compile#Getting_the_source

sudo apt-get install build-essential subversion pkg-config libltdl3-dev cmake
sudo apt-get install python2.6-dev libfreetype6-dev libsdl1.2-dev libalut-dev libvorbis-dev libois-dev libtiff4-dev libopenal-dev libogre-dev
svn co https://freeorion.svn.sourceforge.net/svnroot/freeorion/trunk freeorion

#try to install Boost
sudo apt-get install libboost-dev  --install-recommends

#Still need to get boost!
#download it:
http://downloads.sourceforge.net/project/boost/boost/1.47.0/boost_1_47_0.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fboost%2Ffiles%2Fboost%2F1.47.0%2F&ts=1343000189&use_mirror=superb-sea2

#extract the tar.gz file with its directory structure (done using Archive manager GUI), then
cd /home/griffin/Downloads/boost_1_47_0/libs/regex/build

make -fgcc.mak
#should it be SUDO ??

#copy all of /home/griffin/Downloads/boost_1_47_0/libs/regex/build/gcc to /usr/local/lib/boost_1_47
sudo cp -a * /usr/local/lib/boost_1_47/
# well, it looks like this didn't exactly work.

./bootstrap.sh
./b2
#this (./b2) takes a LOOONG time.

sudo ./bjam install

#*** BOOST is now installed and FreeOrion/cmake . can find it!

#install GIGI
cd GG
cmake -DBUILD_TUTORIALS=off -DBUILD_OGRE_DRIVER=ON -DBUILD_OGRE_OIS_PLUGIN=ON .
make

#sudo may not be necessary for these two lines
sudo make install
sudo ldconfig
#add in "/usr/local/lib" to sudo vi /etc/ld.so.conf  I assume that it just gets appended to the end of the file (or the current line???).
# I also tried making the line look like:  include /usr/local/lib    (Instructions need clarification)
# who knows if this worked (since I don't really know what the file should end up looking like)
#maybe rerun sudo ldconfig
sudo ldconfig

#rerun cmake .
cmake .

#DAMN! Now it can't find Boost again! (see the error at the top of this post)

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

Re: Can't compile (Ubuntu 10.04). Boost problem.

#2 Post by Geoff the Medio »

I can't really follow your wall of text mixing commentary and commands without output, but I think you need to run "ccmake ." before running "cmake .". ccmake should open up an interface for specifying the locations of dependencies for use in subsequent "cmake ." commands. Enter in the path for where boost library and headers are located, and hopefully it should find them.

I don't use Linux enough to tell you if your install methods or other attempts are flawed.

GrandSatrap
Space Krill
Posts: 7
Joined: Mon Jul 23, 2012 1:11 pm

Re: Can't compile (Ubuntu 10.04). Boost problem.

#3 Post by GrandSatrap »

Thanks. That is so cool! ccmake . seems to be where I can set directories for boost. I'll fiddle around and see what happens.

I'll keep updating my own documentation of what steps I'm doing. I'd be happy to submit it in a better format to you (once everything works) if you want. You could use it to put more detailed steps for getting everything working. Yes, it really is a large wall of text.

User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

Re: Can't compile (Ubuntu 10.04). Boost problem.

#4 Post by eleazar »

If you get it figured out, it would be great if you updated the wiki linux compile documentation yourself. We don't have an active linux dev.

You need to send Geoff a PM to get a wiki account, since automatic registration is currently messed up.

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

Re: Can't compile (Ubuntu 10.04). Boost problem.

#5 Post by Geoff the Medio »

eleazar wrote:...since automatic registration is currently messed up.
Wiki account registration was intentionally disabled due to spam...

GrandSatrap
Space Krill
Posts: 7
Joined: Mon Jul 23, 2012 1:11 pm

Re: Can't compile (Ubuntu 10.04). Boost problem.

#6 Post by GrandSatrap »

I am still having Boost problems.

I need to find out if Boost is installed properly (but I'm not sure how).

Here is the ccmake screen

Code: Select all

BOOST_SIGNALS_NAMESPACE          signals                                                                                                                                                                 
 BUILD_DEBUG                      OFF                                                                                                                                                                     
 BUILD_PLATFORM                   linux                                                                                                                                                                   
 Boost_DATE_TIME_LIBRARY          /usr/local/lib/libboost_date_time.so                                                                                                                                    
 Boost_DATE_TIME_LIBRARY_DEBUG    Boost_DATE_TIME_LIBRARY_DEBUG-NOTFOUND                                                                                                                                  
 Boost_DATE_TIME_LIBRARY_RELEAS   /usr/local/lib/libboost_date_time.so                                                                                                                                    
 Boost_FILESYSTEM_LIBRARY         /usr/local/lib/libboost_filesystem.so                                                                                                                                   
 Boost_FILESYSTEM_LIBRARY_DEBUG   Boost_FILESYSTEM_LIBRARY_DEBUG-NOTFOUND                                                                                                                                 
 Boost_FILESYSTEM_LIBRARY_RELEA   /usr/local/lib/libboost_filesystem.so                                                                                                                                   
 Boost_INCLUDE_DIR                /usr/local/include                                                                                                                                                      
 Boost_IOSTREAMS_LIBRARY_DEBUG    Boost_IOSTREAMS_LIBRARY_DEBUG-NOTFOUND                                                                                                                                  
 Boost_IOSTREAMS_LIBRARY_RELEAS   Boost_IOSTREAMS_LIBRARY_RELEASE-NOTFOUND                                                                                                                                
 Boost_LIBRARY_DIRS               /usr/local/lib                                                                                                                                                          
 Boost_PYTHON_LIBRARY             /usr/local/lib/libboost_python.so                                                                                                                                       
 Boost_PYTHON_LIBRARY_DEBUG       Boost_PYTHON_LIBRARY_DEBUG-NOTFOUND                                                                                                                                     
 Boost_PYTHON_LIBRARY_RELEASE     /usr/local/lib/libboost_python.so                                                                                                                                       
 Boost_SERIALIZATION_LIBRARY      /usr/local/lib/libboost_serialization.so                                                                                                                                
 Boost_SERIALIZATION_LIBRARY_DE   Boost_SERIALIZATION_LIBRARY_DEBUG-NOTFOUND                                                                                                                              
 Boost_SERIALIZATION_LIBRARY_RE   /usr/local/lib/libboost_serialization.so                                                                                                                                
 Boost_SIGNALS_LIBRARY            /usr/local/lib/libboost_signals.so                                                                                                                                      
 Boost_SIGNALS_LIBRARY_DEBUG      Boost_SIGNALS_LIBRARY_DEBUG-NOTFOUND                                                                                                                                    
 Boost_SIGNALS_LIBRARY_RELEASE    /usr/local/lib/libboost_signals.so                                                                                                                                      
 Boost_SYSTEM_LIBRARY             /usr/local/lib/libboost_system.so                                                                                                                                       
 Boost_SYSTEM_LIBRARY_DEBUG       Boost_SYSTEM_LIBRARY_DEBUG-NOTFOUND                                                                                                                                     
 Boost_SYSTEM_LIBRARY_RELEASE     /usr/local/lib/libboost_system.so                                                                                                                                       
 Boost_THREAD_LIBRARY             /usr/local/lib/libboost_thread.so                                                                                                                                       
 Boost_THREAD_LIBRARY_DEBUG       Boost_THREAD_LIBRARY_DEBUG-NOTFOUND                                                                                                                                     
 Boost_THREAD_LIBRARY_RELEASE     /usr/local/lib/libboost_thread.so                                                                                                                                       
 CMAKE_AR                         /usr/bin/ar    
I don't know what the DEBUG things are, and if they are required.

The "cmake ." fails with the same error:

Code: Select all

/home/griffin/games/FreeOrion>cmake .
-- Build platform: linux
-- Configuring freeoriond
-- Configuring freeorionca
-- Could NOT find Boost
CMake Error at client/AI/CMakeLists.txt:30 (message):
  Boost libraries not found.

-- Configuring incomplete, errors occurred!
This is happening in this line 30 of the AI/CMakeLists.txt file.

Code: Select all

find_package(Boost ${MINIMUM_BOOST_VERSION} COMPONENTS ${MINIMUM_BOOST_COMPONENTS})
if (Boost_FOUND)
    include_directories(${Boost_INCLUDE_DIRS})
else ()
    message(FATAL_ERROR "Boost libraries not found.")
endif ()
The values for the variables at the time of error are:
  • MINIMUM_BOOST_VERSION=1.47.0
    MINIMUM_BOOST_COMPONENTS=date_time;filesystem;serialization;signals;system;thread;iostreams;python
    Boost_INCLUDE_DIRS=/usr/local/include
The contents of /usr/local/lib are

Code: Select all

/usr/local/lib>ls
boost_regex-gcc-1_47                 libboost_python.a
boost_regex-gcc-d-1_47               libboost_python.so
libboost_chrono.a                    libboost_python.so.1.47.0
libboost_chrono.so                   libboost_random.a
libboost_chrono.so.1.47.0            libboost_random.so
libboost_date_time.a                 libboost_random.so.1.47.0
libboost_date_time.so                libboost_regex.a
libboost_date_time.so.1.47.0         libboost_regex-gcc-1_47.a
libboost_exception.a                 libboost_regex-gcc-d-1_47.a
libboost_filesystem.a                libboost_regex.so
libboost_filesystem.so               libboost_regex.so.1.47.0
libboost_filesystem.so.1.47.0        libboost_serialization.a
libboost_graph.a                     libboost_serialization.so
libboost_graph.so                    libboost_serialization.so.1.47.0
libboost_graph.so.1.47.0             libboost_signals.a
libboost_math_c99.a                  libboost_signals.so
libboost_math_c99f.a                 libboost_signals.so.1.47.0
libboost_math_c99f.so                libboost_system.a
libboost_math_c99f.so.1.47.0         libboost_system.so
libboost_math_c99l.a                 libboost_system.so.1.47.0
libboost_math_c99l.so                libboost_test_exec_monitor.a
libboost_math_c99l.so.1.47.0         libboost_thread.a
libboost_math_c99.so                 libboost_thread.so
libboost_math_c99.so.1.47.0          libboost_thread.so.1.47.0
libboost_math_tr1.a                  libboost_unit_test_framework.a
libboost_math_tr1f.a                 libboost_unit_test_framework.so
libboost_math_tr1f.so                libboost_unit_test_framework.so.1.47.0
libboost_math_tr1f.so.1.47.0         libboost_wave.a
libboost_math_tr1l.a                 libboost_wave.so
libboost_math_tr1l.so                libboost_wave.so.1.47.0
libboost_math_tr1l.so.1.47.0         libboost_wserialization.a
libboost_math_tr1.so                 libboost_wserialization.so
libboost_math_tr1.so.1.47.0          libboost_wserialization.so.1.47.0
libboost_prg_exec_monitor.a          libGiGiOgrePlugin_OIS.so
libboost_prg_exec_monitor.so         libGiGiOgre.so
libboost_prg_exec_monitor.so.1.47.0  libGiGiSDL.so
libboost_program_options.a           libGiGi.so
libboost_program_options.so          pkgconfig
libboost_program_options.so.1.47.0   python2.6
Aha. There is no libboost_iostreams_... ! Maybe this is the problem. Where did it go and how can I get it?

GrandSatrap
Space Krill
Posts: 7
Joined: Mon Jul 23, 2012 1:11 pm

Re: Can't compile (Ubuntu 10.04). Boost problem.

#7 Post by GrandSatrap »

OK, now I've gotten a few more steps working.
cmake -D BUILD_SHARED_LIBS=true .

I'll let you know if anything else goes wrong.

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

Re: Can't compile (Ubuntu 10.04). Boost problem.

#8 Post by Geoff the Medio »

Could you edit out all those double-extra newlines? They make your post a lot harder to read.

You might need to open up FindBoost.cmake in your cmake share directory and add 1.47 to the versions it searches for, or try getting a newer version of cmake that can find 1.47 on its own. In CMake 2.8, it only finds up to 1.44. There are comments in FindBoost.cmake indicating how to do this.

If it should already find 1.47, then you probably haven't installed boost properly.

You might need to ask on a boost or cmake specific site or irc channel for help, if no capable Linux users pop in the comment here.

Do you really have the boost headers in /usr/local/include ? That's a weird location... I'd have thought they'd usually be in a boost-related named subdiretory. Same with the library files, actually... I don't think that's where boost would have installed them, though I'm not sure.

I don't think FreeOrion or GiGi need boost iostreams. At least on Windows, it doesn't appear to be necessary, though I might be wrong about that.

It cmake could find boost before you edited something, and then after it couldn't, probably that editing didn't help things?

GrandSatrap
Space Krill
Posts: 7
Joined: Mon Jul 23, 2012 1:11 pm

Re: Can't compile (Ubuntu 10.04). Boost problem.

#9 Post by GrandSatrap »

Done!! Everything works -- at least the game starts, I can fly a scout ship to a nearby star. I have documented everything I've done.
I'd be happy to update the "compile for Linux" instructions.
Maybe I should make a separate page first which you could then merge in or just have a link to "compile for Ubuntu 10.04" with tips that may be useful for other distributions.

My only problem was for some reason I didn't get the Boost iostreams module. I downloaded one, but the only one I could find was 1.4.0, while the rest of Boost is 1.4.7. I hope that this doesn't cause too many problems. Compiling (the final 'make') resulted in a lot of warnings, but it still worked. Is there any point saving the warnings?

Thanks for your help.

*** Have you ever played "Stars! 2.6" ? I loved that game and was looking for an upgrade. It looks like this (and Masters of Orion, which I never got around to playing) is how I am now going to be spending hours of my time.

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

Re: Can't compile (Ubuntu 10.04). Boost problem.

#10 Post by Geoff the Medio »

GrandSatrap wrote:I have documented everything I've done.
I'd be happy to update the "compile for Linux" instructions.
Send me a pm with your desired wiki username and email address.
Maybe I should make a separate page first which you could then merge in or just have a link to "compile for Ubuntu 10.04" with tips that may be useful for other distributions.
Whatever you think is best... If something in the general Linux compile page is definitely out of date / wrong, then feel free to fix it.
My only problem was for some reason I didn't get the Boost iostreams module.
Will the FreeOrion and GiGi builds not work without it present?
Compiling (the final 'make') resulted in a lot of warnings, but it still worked. Is there any point saving the warnings?
There might be something useful in them. Stuff about unreferenced local variables is nice to know.

Post Reply