Can't scons

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Post Reply
Message
Author
eegeerg
Space Krill
Posts: 9
Joined: Mon Dec 26, 2005 3:38 am

Can't scons

#1 Post by eegeerg »

Hi, I'm trying to build freeorion (SVN snapshot) on linux. Am getting the following error:

Code: Select all

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: Select all

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?

tzlaine
Programming Lead Emeritus
Posts: 1092
Joined: Thu Jun 26, 2003 1:33 pm

#2 Post by tzlaine »

What does config.log say?

eegeerg
Space Krill
Posts: 9
Joined: Mon Dec 26, 2005 3:38 am

#3 Post by eegeerg »

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: Select all

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: Select all

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

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

#4 Post by Geoff the Medio »

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"?

tzlaine
Programming Lead Emeritus
Posts: 1092
Joined: Thu Jun 26, 2003 1:33 pm

#5 Post by tzlaine »

eegeerg wrote:

Code: Select all

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".
And, from config.log:

Code: Select all

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.

eegeerg
Space Krill
Posts: 9
Joined: Mon Dec 26, 2005 3:38 am

#6 Post by eegeerg »

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.
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: Select all

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.

tzlaine
Programming Lead Emeritus
Posts: 1092
Joined: Thu Jun 26, 2003 1:33 pm

#7 Post by tzlaine »

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.

eegeerg
Space Krill
Posts: 9
Joined: Mon Dec 26, 2005 3:38 am

#8 Post by eegeerg »

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

Arnljot
Space Floater
Posts: 19
Joined: Mon Mar 27, 2006 8:19 am
Location: Sweden

#9 Post by Arnljot »

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.

Lupo
Space Krill
Posts: 1
Joined: Sun Apr 23, 2006 12:10 am

#10 Post by Lupo »

Hello,

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

Code: Select all

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: Select all

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

Arnljot
Space Floater
Posts: 19
Joined: Mon Mar 27, 2006 8:19 am
Location: Sweden

#11 Post by Arnljot »

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.

Post Reply