FreeOrion

Forums for the FreeOrion project
It is currently Mon May 20, 2013 12:11 am

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Can't scons
PostPosted: Sat Mar 25, 2006 11:16 pm 
Offline
Space Krill

Joined: Mon Dec 26, 2005 3:38 am
Posts: 9
Hi, I'm trying to build freeorion (SVN snapshot) on linux. Am getting the following error:

Code:
bash-3.00$ scons --no-cache with_boost_include=/usr/local/include/boost-1_33_1/ with_boost_libdir=/usr/local/lib/ boost_lib_suffix=-gcc
scons: Reading SConscript files ...
Configuring for POSIX system...
Checking for pkg-config... ok
Checking for GiGiSDL >= 0.6.0... ok
Checking for C++ header file boost/shared_ptr.hpp... yes
Checking Boost version >= 1.33.1... yes
Looking for boost lib boost_serialization-gcc...
Checking for boost::archive::binary_iarchive::is_saving() in C++ library boost_serialization-gcc... no
Checking for boost::archive::binary_iarchive::is_saving() in C++ library boost_serialization-gcc-mt... no
Boost configuration... failed


I can't find this function in that library either.

Code:
bash-3.00$ nm -C /usr/local/lib/libboost_serialization-gcc.a | grep binary_iarchive | wc -l
64
bash-3.00$ nm -C /usr/local/lib/libboost_serialization-gcc.a | grep is_saving | wc -l
0


I'm using boost 1.33.1, and gcc 3.3.6. Any ideas?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 27, 2006 7:25 am 
Offline
Programming Lead Emeritus
User avatar

Joined: Thu Jun 26, 2003 1:33 pm
Posts: 1092
What does config.log say?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 12, 2006 3:20 am 
Offline
Space Krill

Joined: Mon Dec 26, 2005 3:38 am
Posts: 9
Hi, Sorry for the delay in response.

Thank you for the idea to check the config.log. The log was very useful. That particular problem was because the config script was linking with an old version of gg (from a previous unsuccessful attempt at compiling freeorion), instead of the included version.

So I deleted the old version of gg. But sadly, building is still not successful.

Code:
bash-3.00$ scons
scons: Reading SConscript files ...
...
Checking for gluLookAt() in C library GLU... yes
Checking for sdl-config... yes
Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]
Checking SDL version >= 1.2.7... yes
Linking SDL/OpenGL test app... failed
SDL configuration... failed
bash-3.00$


And, from config.log:

Code:
Checking for sdl-config...
Result: yes

Checking SDL version >= 1.2.7...
Result: yes

Linking SDL/OpenGL test app...
.sconf_temp/conftest_13.c <-
  |
  |#include <SDL/SDL.h>
  |#include <SDL/SDL_opengl.h>
  |int main()
  |{
  |    SDL_Init(SDL_INIT_VIDEO);
  |    SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
  |    SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
  |    SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
  |    SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
  |    SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
  |    SDL_SetVideoMode(640, 480, SDL_GetVideoInfo()->vfmt->BitsPerPixel, SDL_OP
ENGL);
  |    glBegin(GL_TRIANGLES);
  |    glEnd();
  |    return 0;
  |}
  |
gcc -pthread -D_REENTRANT -I/usr/local/include/boost-1_33_1 -I/usr/include/SDL -
c -o .sconf_temp/conftest_13.o .sconf_temp/conftest_13.c
gcc -pthread -o .sconf_temp/conftest_13 .sconf_temp/conftest_13.o -L/usr/local/l
ib -lboost_serialization-gcc -lboost_iostreams-gcc -lboost_signals-gcc -lboost_f
ilesystem-gcc -lGL -lGLU
.sconf_temp/conftest_13.o(.text+0x16): In function `main':
: undefined reference to `SDL_Init'
.sconf_temp/conftest_13.o(.text+0x25): In function `main':
: undefined reference to `SDL_GL_SetAttribute'
.sconf_temp/conftest_13.o(.text+0x34): In function `main':
: undefined reference to `SDL_GL_SetAttribute'
.sconf_temp/conftest_13.o(.text+0x43): In function `main':
: undefined reference to `SDL_GL_SetAttribute'
.sconf_temp/conftest_13.o(.text+0x52): In function `main':
: undefined reference to `SDL_GL_SetAttribute'
.sconf_temp/conftest_13.o(.text+0x61): In function `main':
: undefined reference to `SDL_GL_SetAttribute'
.sconf_temp/conftest_13.o(.text+0x6e): In function `main':
: undefined reference to `SDL_GetVideoInfo'
.sconf_temp/conftest_13.o(.text+0x8c): In function `main':
: undefined reference to `SDL_SetVideoMode'
collect2: ld returned 1 exit status
scons: *** [.sconf_temp/conftest_13] Error 1
Result: failed

SDL configuration...
Result: failed


I'm using the latest version from svn (Apr 11, 2006).

-Greg


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 12, 2006 4:00 am 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7887
Location: Vancouver, BC
I'm quite unqualified to help, but just incase: have you run scons and set with_sdl_include and with_sdl_libdir, then run "scons configure"?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 12, 2006 1:00 pm 
Offline
Programming Lead Emeritus
User avatar

Joined: Thu Jun 26, 2003 1:33 pm
Posts: 1092
eegeerg wrote:
Code:
bash-3.00$ scons
scons: Reading SConscript files ...
...
Checking for gluLookAt() in C library GLU... yes
Checking for sdl-config... yes
Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]
Checking SDL version >= 1.2.7... yes
Linking SDL/OpenGL test app... failed
SDL configuration... failed
bash-3.00$


This part is wierd. The line that begins with "Usage: sdl-config" should not be there, and it indicates that the SCons configuration code is invoking sdl-config incorrectly. What version of SDL do you have installed? Can you run "sdl-config --cflags --libs" from the command line and see what it says? If you specified the "with_sdl=" option to GG's SCons run, you'll also need to add the flag "--prefix=XXX".

Quote:
And, from config.log:

Code:
Checking for sdl-config...
Result: yes

Checking SDL version >= 1.2.7...
Result: yes

Linking SDL/OpenGL test app...
.sconf_temp/conftest_13.c <-
  |
  |#include <SDL/SDL.h>
  |#include <SDL/SDL_opengl.h>
  |int main()
  |{
  |    SDL_Init(SDL_INIT_VIDEO);
  |    SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
  |    SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
  |    SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
  |    SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
  |    SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
  |    SDL_SetVideoMode(640, 480, SDL_GetVideoInfo()->vfmt->BitsPerPixel, SDL_OP
ENGL);
  |    glBegin(GL_TRIANGLES);
  |    glEnd();
  |    return 0;
  |}
  |
gcc -pthread -D_REENTRANT -I/usr/local/include/boost-1_33_1 -I/usr/include/SDL -
c -o .sconf_temp/conftest_13.o .sconf_temp/conftest_13.c
gcc -pthread -o .sconf_temp/conftest_13 .sconf_temp/conftest_13.o -L/usr/local/l
ib -lboost_serialization-gcc -lboost_iostreams-gcc -lboost_signals-gcc -lboost_f
ilesystem-gcc -lGL -lGLU


Notice that there is no "-lSDL" flag, indicating that SDL should be linked in. This is simply because the sdl-config stuff above failed. If we can resolve the sdl-config problem, this test build should work fine.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 14, 2006 3:04 am 
Offline
Space Krill

Joined: Mon Dec 26, 2005 3:38 am
Posts: 9
Quote:
have you run scons and set with_sdl_include and with_sdl_libdir, then run "scons configure"?


Actually I didn't. I had assumed this was unnecessary because they are installed in /usr/lib and /usr/include. But I can try this.

Quote:
This part is wierd. The line that begins with "Usage: sdl-config" should not be there, and it indicates that the SCons configuration code is invoking sdl-config incorrectly. What version of SDL do you have installed? Can you run "sdl-config --cflags --libs" from the command line and see what it says? If you specified the "with_sdl=" option to GG's SCons run, you'll also need to add the flag "--prefix=XXX".


Yes, I noticed this too, but the SConstruct script was not easy to understand. I have SDL 1.2, which came pre-packaged (slackware 10.2).

Here are the output from sdl-config:

Code:
bash-3.00$ which sdl-config
/usr/bin/sdl-config
bash-3.00$ sdl-config --cflags --libs
-I/usr/include/SDL -D_REENTRANT
-L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread


I didn't run scons separately on GG. Somehow I thought this would happen recursively. But I can try this.

Thank you for your help.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 17, 2006 2:36 pm 
Offline
Programming Lead Emeritus
User avatar

Joined: Thu Jun 26, 2003 1:33 pm
Posts: 1092
eegeerg wrote:
I didn't run scons separately on GG. Somehow I thought this would happen recursively. But I can try this.


The placement of GG in a subdirectory under FO might be a little misleading in this regard, but they are actually totally separate. You need to run SCons on GG first, then install GG, then run SCons on FO.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 19, 2006 3:34 am 
Offline
Space Krill

Joined: Mon Dec 26, 2005 3:38 am
Posts: 9
Thanks for your help. Unfortunately I still cannot compile, because apparently your code is not compatible with the 3.3.6 compiler (http://freeorion.org/forum/viewtopic.php?t=1348). You may want to check for this in the configure scripts.

Thanks,
Greg


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 22, 2006 8:18 am 
Offline
Space Floater

Joined: Mon Mar 27, 2006 8:19 am
Posts: 19
Location: Sweden
Hi I,m trying to install on a suse 10.0. I have the feeling that GCC 4.0.2 is part of my problems now. If you are compiling with an earlier version it could help me with som clues. I have a recent SDL from the distro and found the SDL OpenGL from a suse mirror where I also found boost 1.33.1. Without that I would still be on installing boost.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 24, 2006 9:42 am 
Offline
Space Krill

Joined: Sun Apr 23, 2006 12:10 am
Posts: 1
Hello,

I'm running into a similar problem trying to compile Freeorion.

Code:
scons: Reading SConscript files ...
Configuring for POSIX system...
Checking for pkg-config... ok
Checking for GiGiSDL >= 0.6.0... ok
Checking for C++ header file boost/shared_ptr.hpp... yes
Checking Boost version >= 1.33.1... yes
Looking for boost lib boost_serialization...
Checking for boost::archive::binary_iarchive::is_saving() in C++ library boost_serialization... no
Checking for boost::archive::binary_iarchive::is_saving() in C++ library boost_serialization-mt... no
Boost configuration... failed


Here is my config.log:
Code:
file /usr/lib/scons/SCons/Environment.py,line 1019:
        Configure( confdir = .sconf_temp )

Checking for pkg-config...
pkg-config --atleast-pkgconfig-version 0.15.0
Result: ok

Checking for GiGiSDL >= 0.6.0...
pkg-config GiGiSDL --atleast-version 0.6.0
Result: ok

Checking for C++ header file boost/shared_ptr.hpp... .sconf_temp/conftest_2.cpp <-
  |
  |#include "boost/shared_ptr.hpp"
  |
  |
g++ -pthread -I/usr/include/SDL -I/usr/local/include -c -o .sconf_temp/conftest_2.o .sconf_temp/conftest_2.cpp
yes
Checking Boost version >= 1.33.1...
Result: yes

Checking for boost::archive::binary_iarchive::is_saving() in C++ library boost_serialization... .sconf_temp/conftest_3.cpp <-
  |
  |
  |            #include "boost/archive/binary_iarchive.hpp"
  |
  |            int
  |            main() {
  |            boost::archive::binary_iarchive::is_saving();
  |            return 0;
  |            }
  |
  |
  |
g++ -pthread -I/usr/include/SDL -I/usr/local/include -c -o .sconf_temp/conftest_3.o .sconf_temp/conftest_3.cpp
g++ -pthread -o .sconf_temp/conftest_3 .sconf_temp/conftest_3.o -L/usr/local/lib -lGiGiSDL -lSDL -lGiGiNet -lIL -lILU -lILUT -lGiG$
/usr/lib/liballeg.so.4.1: undefined reference to `_mangled_main_address'
collect2: ld returned 1 exit status
scons: *** [.sconf_temp/conftest_3] Error 1
no
Failed program was:
1:
2:
3:             #include "boost/archive/binary_iarchive.hpp"
4:
5:             int
6:             main() {
7:             boost::archive::binary_iarchive::is_saving();
8:             return 0;
9:             }
10:
11:
Error message: failed to build test program
Checking for boost::archive::binary_iarchive::is_saving() in C++ library boost_serialization-mt... .sconf_temp/conftest_4.cpp <-
  |
  |
  |            #include "boost/archive/binary_iarchive.hpp"
  |
  |            int
  |            main() {
  |            boost::archive::binary_iarchive::is_saving();
  |            return 0;
  |            }
  |
  |
  |
g++ -pthread -I/usr/include/SDL -I/usr/local/include -c -o .sconf_temp/conftest_4.o .sconf_temp/conftest_4.cpp
g++ -pthread -o .sconf_temp/conftest_4 .sconf_temp/conftest_4.o -L/usr/local/lib -lGiGiSDL -lSDL -lGiGiNet -lIL -lILU -lILUT -lGiGi$
/usr/lib/liballeg.so.4.1: undefined reference to `_mangled_main_address'
collect2: ld returned 1 exit status
scons: *** [.sconf_temp/conftest_4] Error 1
no
Failed program was:
1:
2:
3:             #include "boost/archive/binary_iarchive.hpp"
4:
5:             int
6:             main() {
7:             boost::archive::binary_iarchive::is_saving();
8:             return 0;
9:             }
10:
11:
Error message: failed to build test program
Boost configuration...
Result: failed


I'm using gcc 3.4.5
Any ideas?

Regards,
Lupo


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 24, 2006 2:28 pm 
Offline
Space Floater

Joined: Mon Mar 27, 2006 8:19 am
Posts: 19
Location: Sweden
There are some examples of building FO hiding on Main Page. They can be found in Compiling, Users stories. I,ve tried to build boost but never got any libs that worked, usually there are some tutorial to test the installation but they failed too. The last one I tried was ver. 1.34... RPM's are the solution for me, pacman have 1.33.1 and I have one from a suse mirror for suse 10.0.
At the moment I am at the stage "Building targets" but the compiler would not accept a header file for GG. I,m using GCC 4.0.2.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group