[SOLVED] Error compiling 0.4.7 - Linux

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Message
Author
mandarina
Space Krill
Posts: 9
Joined: Thu Aug 10, 2017 1:06 pm

[SOLVED] Error compiling 0.4.7 - Linux

#1 Post by mandarina »

Hello, first I have to thank you for this great game, I played the 0.4.5 and I found it awesome!!!

The sad part is that I'm having trouble compiling the 0.4.7...

Ubuntu 16.04 LTS
I followed these instructions: http://freeorion.org/index.php/Compile_In_Linux

However...
[ 73%] Building CXX object CMakeFiles/freeoriond.dir/python/EnumWrapper.cpp.o
[ 73%] Building CXX object CMakeFiles/freeoriond.dir/python/LoggingWrapper.cpp.o
[ 74%] Building CXX object CMakeFiles/freeorion.dir/UI/CombatReport/CombatReportData.cpp.o
[ 74%] Building CXX object CMakeFiles/freeoriond.dir/python/UniverseWrapper.cpp.o
[ 74%] Linking CXX executable freeorionca
[ 74%] Building CXX object CMakeFiles/freeoriond.dir/server/dmain.cpp.o
libfreeorioncommon.so: undefined reference to `boost::log::v2_mt_posix::sinks::text_file_backend::consume(boost::log::v2_mt_posix::record_view const&, std::string const&)'
libfreeorioncommon.so: undefined reference to `boost::archive::basic_binary_oprimitive<boost::archive::binary_oarchive, char, std::char_traits<char> >::save(std::string const&)'
libfreeorioncommon.so: undefined reference to `boost::archive::xml_oarchive_impl<boost::archive::xml_oarchive>::save(std::string const&)'
libfreeorioncommon.so: undefined reference to `boost::log::v2_mt_posix::aux::code_convert(wchar_t const*, unsigned long, std::string&, std::locale const&)'
libfreeorioncommon.so: undefined reference to `boost::archive::xml_iarchive_impl<boost::archive::xml_iarchive>::load(std::string&)'
libfreeorioncommon.so: undefined reference to `boost::filesystem::path_traits::dispatch(boost::filesystem::directory_entry const&, std::string&)'
libfreeorioncommon.so: undefined reference to `void boost::log::v2_mt_posix::aux::put_integer<char>(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned int, unsigned int, char)'
libfreeorioncommon.so: undefined reference to `boost::archive::basic_binary_iprimitive<boost::archive::binary_iarchive, char, std::char_traits<char> >::load(std::string&)'
collect2: error: ld returned 1 exit status
CMakeFiles/freeorionca.dir/build.make:472: recipe for target 'freeorionca' failed
make[2]: *** [freeorionca] Error 1
CMakeFiles/Makefile2:217: recipe for target 'CMakeFiles/freeorionca.dir/all' failed
make[1]: *** [CMakeFiles/freeorionca.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
boost version 1.58

I tried something similar to this: https://github.com/freeorion/freeorion/ ... 8f4c48c02b

But no...

Any help? Thanks!
Last edited by mandarina on Sat Aug 19, 2017 7:22 pm, edited 1 time in total.

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

Re: Error compiling 0.4.7 - Linux

#2 Post by Dilvish »

Hmm, that's perplexing; I also am running Ubuntu 16.04, and am compiling FO with no problem.
Although our instructions just call for installing libboost-dev, could you also try installing libboost-all-dev (it's what I have installed, and it appears to me to pull in some additional boost packages beyond what libboost-dev does). Perhaps we need to change our instructions on that point.

If that does not clear it up, then to double check things a bit, I suggest you go to your build directory and run the cmake gui

Code: Select all

ccmake .
(if you don't already have ccmake installed, it's from the cmake-curses-gui package).
in ccmake, hit the 't' key to toggle into advanced mode, and then that first page should list all your boost library locations ( a thread one at the top, and then a large block of them towards the middle). Check that none of those are missing values (except that its OK for BOOST_DIR to not have a value, for some reason, it shows up as Boost_DIR-NOTFOUND for me). You can then hit 'q' to exit ccmake.

I hope that helps!
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Jaumito
Space Kraken
Posts: 189
Joined: Tue May 16, 2017 3:42 am
Location: Catalonia, France, Europe, Earth, Sol, Orion Arm, Milky Way, Virgo Cluster

Re: Error compiling 0.4.7 - Linux

#3 Post by Jaumito »

Dilvish wrote:Although our instructions just call for installing libboost-dev, could you also try installing libboost-all-dev (it's what I have installed, and it appears to me to pull in some additional boost packages beyond what libboost-dev does). Perhaps we need to change our instructions on that point.
Indeed. I had similar problems when compiling FO for the first time on 16.04, due to installing the packages listed in the instructions rather than using the provided sudo command. Had to install about half a dozen extra boost libraries to fix the problem, only then did I notice the libboost-dev/libboost-all-dev mismatch :oops:

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

Re: Error compiling 0.4.7 - Linux

#4 Post by Dilvish »

Jaumito wrote:I had similar problems when compiling FO for the first time on 16.04, due to installing the packages listed in the instructions rather than using the provided sudo command. Had to install about half a dozen extra boost libraries to fix the problem, only then did I notice the libboost-dev/libboost-all-dev mismatch :oops:
OK that's enough of a confirmation for me, I've updated the instructions so that they call for liboost-all-dev in the main list now.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

mandarina
Space Krill
Posts: 9
Joined: Thu Aug 10, 2017 1:06 pm

Re: Error compiling 0.4.7 - Linux

#5 Post by mandarina »

Thanks for the reply, sadly I already have installed libboost-all-dev
$ sudo apt-get install libboost-all-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libboost-all-dev is already the newest version (1.58.0.1ubuntu1).
As for the cmake part it found all the boost libs

Code: Select all

 BOOST_THREAD_LIBRARY             /usr/lib/x86_64-linux-gnu/libpthread.so                                          
 BUILD_DOCUMENTATION              OFF                                                                              
 BUILD_SDL_DRIVER                 ON                                                                               
 BUILD_SHARED_LIBS                ON                                                                               
 BUILD_TESTING                    OFF                                                                              
 Boost_ATOMIC_LIBRARY_DEBUG       /usr/lib/x86_64-linux-gnu/libboost_atomic.so                                     
 Boost_ATOMIC_LIBRARY_RELEASE     /usr/lib/x86_64-linux-gnu/libboost_atomic.so                                     
 Boost_CHRONO_LIBRARY_DEBUG       /usr/lib/x86_64-linux-gnu/libboost_chrono.so                                     
 Boost_CHRONO_LIBRARY_RELEASE     /usr/lib/x86_64-linux-gnu/libboost_chrono.so                                     
 Boost_DATE_TIME_LIBRARY_DEBUG    /usr/lib/x86_64-linux-gnu/libboost_date_time.so                                  
 Boost_DATE_TIME_LIBRARY_RELEAS   /usr/lib/x86_64-linux-gnu/libboost_date_time.so                                  
 Boost_DIR                        Boost_DIR-NOTFOUND                                                               
 Boost_FILESYSTEM_LIBRARY_DEBUG   /usr/lib/x86_64-linux-gnu/libboost_filesystem.so                                 
 Boost_FILESYSTEM_LIBRARY_RELEA   /usr/lib/x86_64-linux-gnu/libboost_filesystem.so                                 
 Boost_INCLUDE_DIR                /usr/include                                                                     
 Boost_IOSTREAMS_LIBRARY_DEBUG    /usr/lib/x86_64-linux-gnu/libboost_iostreams.so                                  
 Boost_IOSTREAMS_LIBRARY_RELEAS   /usr/lib/x86_64-linux-gnu/libboost_iostreams.so                                  
 Boost_LIBRARY_DIR_DEBUG          /usr/lib/x86_64-linux-gnu                                                        
 Boost_LIBRARY_DIR_RELEASE        /usr/lib/x86_64-linux-gnu                                                        
 Boost_LOCALE_LIBRARY_DEBUG       /usr/lib/x86_64-linux-gnu/libboost_locale.so                                     
 Boost_LOCALE_LIBRARY_RELEASE     /usr/lib/x86_64-linux-gnu/libboost_locale.so                                     
 Boost_LOG_LIBRARY_DEBUG          /usr/lib/x86_64-linux-gnu/libboost_log.so                                        
 Boost_LOG_LIBRARY_RELEASE        /usr/lib/x86_64-linux-gnu/libboost_log.so                                        
 Boost_LOG_SETUP_LIBRARY_DEBUG    /usr/lib/x86_64-linux-gnu/libboost_log_setup.so                                  
 Boost_LOG_SETUP_LIBRARY_RELEAS   /usr/lib/x86_64-linux-gnu/libboost_log_setup.so                                  
 Boost_PYTHON_LIBRARY_DEBUG       /usr/lib/x86_64-linux-gnu/libboost_python.so                                     
 Boost_PYTHON_LIBRARY_RELEASE     /usr/lib/x86_64-linux-gnu/libboost_python.so                                     
 Boost_REGEX_LIBRARY_DEBUG        /usr/lib/x86_64-linux-gnu/libboost_regex.so                                      
 Boost_REGEX_LIBRARY_RELEASE      /usr/lib/x86_64-linux-gnu/libboost_regex.so                                      
 Boost_SERIALIZATION_LIBRARY_DE   /usr/lib/x86_64-linux-gnu/libboost_serialization.so                              
 Boost_SERIALIZATION_LIBRARY_RE   /usr/lib/x86_64-linux-gnu/libboost_serialization.so                              
 Boost_SIGNALS_LIBRARY_DEBUG      /usr/lib/x86_64-linux-gnu/libboost_signals.so                                    
 Boost_SIGNALS_LIBRARY_RELEASE    /usr/lib/x86_64-linux-gnu/libboost_signals.so                                    
 Boost_SYSTEM_LIBRARY_DEBUG       /usr/lib/x86_64-linux-gnu/libboost_system.so                                     
 Boost_SYSTEM_LIBRARY_RELEASE     /usr/lib/x86_64-linux-gnu/libboost_system.so                                     
 Boost_THREAD_LIBRARY_DEBUG       /usr/lib/x86_64-linux-gnu/libboost_thread.so                                     
 Boost_THREAD_LIBRARY_RELEASE     /usr/lib/x86_64-linux-gnu/libboost_thread.so                                     
Is there anything else I can do?

Thanks

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

Re: Error compiling 0.4.7 - Linux

#6 Post by Dilvish »

hmm, I'll try to keep thinking, and hopefully adrian_broher will have a chance to weigh in. Could you please also verify if you are trying to build the 0.4.7 Release version, or else which particular commit you are trying to build.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

mandarina
Space Krill
Posts: 9
Joined: Thu Aug 10, 2017 1:06 pm

Re: Error compiling 0.4.7 - Linux

#7 Post by mandarina »


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

Re: Error compiling 0.4.7 - Linux

#8 Post by Vezzra »

@mandarina, it shouldn't make any difference at all, but can you try to check out the "v0.4.7" tag from our git repository and build that?

mandarina
Space Krill
Posts: 9
Joined: Thu Aug 10, 2017 1:06 pm

Re: Error compiling 0.4.7 - Linux

#9 Post by mandarina »

Vezzra wrote:@mandarina, it shouldn't make any difference at all, but can you try to check out the "v0.4.7" tag from our git repository and build that?

Code: Select all

Building v0.4.7 HEAD build 2017-04-24.60d06dc

Code: Select all

[ 70%] Building CXX object CMakeFiles/freeoriond.dir/server/SaveLoad.cpp.o
[ 71%] Building CXX object CMakeFiles/freeorionca.dir/util/DependencyVersions.cpp.o
[ 71%] Linking CXX executable freeorionca
[ 71%] Building CXX object CMakeFiles/freeoriond.dir/server/ServerApp.cpp.o
libfreeorioncommon.so: undefined reference to `boost::log::v2_mt_posix::sinks::text_file_backend::consume(boost::log::v2_mt_posix::record_view const&, std::string const&)'
libfreeorioncommon.so: undefined reference to `boost::archive::basic_binary_oprimitive<boost::archive::binary_oarchive, char, std::char_traits<char> >::save(std::string const&)'
libfreeorioncommon.so: undefined reference to `boost::archive::xml_oarchive_impl<boost::archive::xml_oarchive>::save(std::string const&)'
libfreeorioncommon.so: undefined reference to `boost::log::v2_mt_posix::aux::code_convert(wchar_t const*, unsigned long, std::string&, std::locale const&)'
libfreeorioncommon.so: undefined reference to `boost::archive::xml_iarchive_impl<boost::archive::xml_iarchive>::load(std::string&)'
libfreeorioncommon.so: undefined reference to `boost::filesystem::path_traits::dispatch(boost::filesystem::directory_entry const&, std::string&)'
libfreeorioncommon.so: undefined reference to `void boost::log::v2_mt_posix::aux::put_integer<char>(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned int, unsigned int, char)'
libfreeorioncommon.so: undefined reference to `boost::archive::basic_binary_iprimitive<boost::archive::binary_iarchive, char, std::char_traits<char> >::load(std::string&)'
collect2: error: ld returned 1 exit status
CMakeFiles/freeorionca.dir/build.make:472: recipe for target 'freeorionca' failed
make[2]: *** [freeorionca] Error 1
CMakeFiles/Makefile2:217: recipe for target 'CMakeFiles/freeorionca.dir/all' failed
make[1]: *** [CMakeFiles/freeorionca.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Same problem...

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

Re: Error compiling 0.4.7 - Linux

#10 Post by Vezzra »

mandarina wrote:Same problem...
Ok, that's what I expected, just wanted to make sure it's not an issue with the source tarball.

mandarina
Space Krill
Posts: 9
Joined: Thu Aug 10, 2017 1:06 pm

Re: Error compiling 0.4.7 - Linux

#11 Post by mandarina »

Is there another way of playing the 0.4.7 on my ubuntu 16.04?

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

Re: Error compiling 0.4.7 - Linux

#12 Post by Dilvish »

mandarina wrote:Is there another way of playing the 0.4.7 on my ubuntu 16.04?
Please stick with us a while longer here while we try to sort this out. We do have some folks who are more expert than myself on compilation and cmake issues and I am hoping they will find time to review your issue here. perhaps the fix might wind up being entirely at your end, but perhaps there is also some way our cmake files could be made more robust to whatever trouble you are encountering. We have not been making/posting statically linked versions of FO for Linux for some time now because our build process has seemed plenty smooth for Linux, but if we can't resolve your compile problem we might (maybe, possibly, no promises) be able to get a static linked version built and posted for you.

Could you also please give any more details on whether you are running a purely plain vanilla Ubuntu 16.04 from ubuntu.org, or perhaps if it is another flavor?

Mine is actually Kubuntu, which is an official flavor and is careful to keep all of its packages 100% synched with the same Ubunto packages, but I'm not 100% sure that's the case for every Ubuntu flavor. Just to check on one of the symbols causing you trouble, could you also post the results you get from running

Code: Select all

 nm  -DC /usr/lib/x86_64-linux-gnu/libboost_log.so | grep   text_file_backend::consume
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
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: Error compiling 0.4.7 - Linux

#13 Post by MatGB »

Is it worth trying to compile the current master rather than the release? I have no clue what's going on and extensively tested 0.4.7 on my Kubuntu box, but compiled current master this afternoon and it runs fine.

If it doesn't, there's something system specific going on but as with Dilvish it's beyond me as to what.
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

User avatar
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: Error compiling 0.4.7 - Linux

#14 Post by adrian_broher »

The release v0.4.7 compiled as expected: https://travis-ci.org/freeorion/freeori ... /227654636 but that's already 3 month ago.

The Docker image we're using as a build environment is based on 16.04 and was updated the last time around 2017-02, so it's somewhere around the 16.04.2 point release.

You can try building the project by installing the packages listed in the Dockerfile and check if there is a package missing for you. Maybe the build documentation is just lacking.

https://github.com/freeorion/freeorion- ... le#L17-L45

If that doesn't help I will try to build FO with an updated build environment (Ubuntu 16.04.3).
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz

mandarina
Space Krill
Posts: 9
Joined: Thu Aug 10, 2017 1:06 pm

Re: Error compiling 0.4.7 - Linux

#15 Post by mandarina »

Hello, thanks for the replies!
Dilvish wrote:
mandarina wrote:Is there another way of playing the 0.4.7 on my ubuntu 16.04?
Please stick with us a while longer here while we try to sort this out. We do have some folks who are more expert than myself on compilation and cmake issues and I am hoping they will find time to review your issue here. perhaps the fix might wind up being entirely at your end, but perhaps there is also some way our cmake files could be made more robust to whatever trouble you are encountering. We have not been making/posting statically linked versions of FO for Linux for some time now because our build process has seemed plenty smooth for Linux, but if we can't resolve your compile problem we might (maybe, possibly, no promises) be able to get a static linked version built and posted for you.

Could you also please give any more details on whether you are running a purely plain vanilla Ubuntu 16.04 from ubuntu.org, or perhaps if it is another flavor?

Mine is actually Kubuntu, which is an official flavor and is careful to keep all of its packages 100% synched with the same Ubunto packages, but I'm not 100% sure that's the case for every Ubuntu flavor. Just to check on one of the symbols causing you trouble, could you also post the results you get from running

Code: Select all

 nm  -DC /usr/lib/x86_64-linux-gnu/libboost_log.so | grep   text_file_backend::consume
I'm using Ubuntu Gnome, it is Ubuntu but with Gnome instead of Unity.

Code: Select all

$ nm  -DC /usr/lib/x86_64-linux-gnu/libboost_log.so | grep   text_file_backend::consume
000000000007ed80 T boost::log::v2_mt_posix::sinks::text_file_backend::consume(boost::log::v2_mt_posix::record_view const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
MatGB wrote:Is it worth trying to compile the current master rather than the release? I have no clue what's going on and extensively tested 0.4.7 on my Kubuntu box, but compiled current master this afternoon and it runs fine.

If it doesn't, there's something system specific going on but as with Dilvish it's beyond me as to what.
I tried it before but no luck :(


adrian_broher wrote:The release v0.4.7 compiled as expected: https://travis-ci.org/freeorion/freeori ... /227654636 but that's already 3 month ago.

The Docker image we're using as a build environment is based on 16.04 and was updated the last time around 2017-02, so it's somewhere around the 16.04.2 point release.

You can try building the project by installing the packages listed in the Dockerfile and check if there is a package missing for you. Maybe the build documentation is just lacking.

https://github.com/freeorion/freeorion- ... le#L17-L45

If that doesn't help I will try to build FO with an updated build environment (Ubuntu 16.04.3).
It installed:

Code: Select all

doxygen libclang1-3.6 libllvm3.6v5 libobjc-5-dev libobjc4
But problem persists.




I'm running in a fresh Ubuntu, I installed it about one-two months ago.

Thanks for your time, I will try something else

Post Reply