Both cmake and scons don't work for me.

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Message
Author
comrad
Space Krill
Posts: 2
Joined: Fri Jan 01, 2010 10:30 pm

Both cmake and scons don't work for me.

#1 Post by comrad »

cmake gives me:
.....
-- checking for modules 'libagraph;libcdt;libcgraph;libgraph;libgvc;libpathplan'
-- package 'libagraph' not found
CMake Error at client/human/CMakeLists.txt:96 (message):
Graphviz library not found.

and scons gives me:
......
Checking for GiGiOgre >= 0.6.0... yes
KeyError: 'CPPDEFINES':
File "/home/comrad/tmp/freeorion/FreeOrion/SConstruct", line 236:
if 'OGRE_STATIC_LIB' in env['CPPDEFINES']:
File "/usr/lib/python2.6/site-packages/SCons/Environment.py", line 404:
return self._dict[key]

P.S.
System: Arch Linux x86_64
Graphviz is installed, but libagraph is not existing.

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

Re: Both cmake and scons don't work for me.

#2 Post by Geoff the Medio »

comrad wrote:Graphviz is installed, but libagraph is not existing.
Based on a bit of googling, libagraph has been removed from graphviz in recent versions. You might need to use an older version of graphviz, unless someone can provide a workaround.

comrad
Space Krill
Posts: 2
Joined: Fri Jan 01, 2010 10:30 pm

Re: Both cmake and scons don't work for me.

#3 Post by comrad »

It's a pity, but I'm not going to downgrade the version of graphviz. Also second issue (with scons) still looks strange.

tomboy64
Space Floater
Posts: 23
Joined: Mon Jan 07, 2008 5:14 pm

Re: Both cmake and scons don't work for me.

#4 Post by tomboy64 »

Considering the age of Graphviz 2.20.3 (the latest with libagraph included), this should be fixed. Currently widely in use is 2.26.

In bash i ran the following command:

Code: Select all

FreeOrion # for i in agraph.h cdt.h cgraph.h graphviz/graph.h gvc.h pathplan.h; do echo ${i}; grep -lR ${i} *; echo "" ; done
agraph.h
loki_setup/setup.data/bin/Linux/x86/glibc-2.1/setup.gtk
loki_setup/setup.data/bin/Linux/x86/glibc-2.1/.svn/text-base/setup.gtk.svn-base

cdt.h

cgraph.h

graphviz/graph.h

gvc.h
SConstruct
UI/TechTreeWnd.cpp
UI/.svn/text-base/TechTreeWnd.cpp.svn-base
cmake/.svn/text-base/FindGraphviz.cmake.svn-base
cmake/FindGraphviz.cmake

pathplan.h

My interpretation is: libagraph is not needed at all. Is this correct?

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

Re: Both cmake and scons don't work for me.

#5 Post by Geoff the Medio »

I'm not sure how to interpret you shell script, but as far as I know, agraph.lib isn't needed for the Win32 FreeOrion build, so it's plausible that it's also not actually needed on Linux.

Edit: Looking at it a bit more carefully, it seems you're listing the files that contain references to each of those headers. Are you just listing the files under the FreeOrio source directories, or are you also searching the headers of the dependencies? Not having #include "agraph.h" actually in a FreeOrion source file doesn't mean it's not included by something that FreeOrion does include. /Edit

tomboy64
Space Floater
Posts: 23
Joined: Mon Jan 07, 2008 5:14 pm

Re: Both cmake and scons don't work for me.

#6 Post by tomboy64 »

Each of the packages that FreeOrion depends upon should check that for itself during compilation/installation.

As a matter of fact, graphviz 2.26 is the only graphviz in the official gentoo-tree - that means *anything* in the tree that needs graphviz must not use agraph anymore. And all the dependencies needed for FreeOrion (except GG) are in the tree - hence this is reasonably safe to assume.

Besides, the only "current" distro still having a graphviz-2.20.3 (or older) that i found, is debian stable.

I will try patching the graphviz-check away and see how it builds.

[edit]
I just patched the check away; FO built without problems. The only program being listed as being linked against the old graphviz was FO itself. The dependency check is safe to remove.
Attachments

[The extension patch has been deactivated and can no longer be displayed.]


qubodup
Space Krill
Posts: 8
Joined: Sun Sep 30, 2007 9:27 am
Location: Berlin, Germany

Re: Both cmake and scons don't work for me.

#7 Post by qubodup »

I removed 'libagraph' and 'graphviz' from the FindGraphviz cmake file. all that remains is the following error:

Code: Select all

Linking CXX executable ../freeoriond
CMakeFiles/freeoriond.dir/__/util/SerializeEmpire.cpp.o: In function `boost::archive::detail::oserializer<boost::archive::xml_oarchive, Building>::save_object_data(boost::archive::detail::basic_oarchive&, void const*) const':
SerializeEmpire.cpp:(.text._ZNK5boost7archive6detail11oserializerINS0_12xml_oarchiveE8BuildingE16save_object_dataERNS1_14basic_oarchiveEPKv[boost::archive::detail::oserializer<boost::archive::xml_oarchive, Building>::save_object_data(boost::archive::detail::basic_oarchive&, void const*) const]+0x31): undefined reference to `void Building::serialize<boost::archive::xml_oarchive>(boost::archive::xml_oarchive&, unsigned int)'
CMakeFiles/freeoriond.dir/__/util/SerializeEmpire.cpp.o: In function `boost::archive::detail::iserializer<boost::archive::xml_iarchive, Building>::load_object_data(boost::archive::detail::basic_iarchive&, void*, unsigned int) const':
SerializeEmpire.cpp:(.text._ZNK5boost7archive6detail11iserializerINS0_12xml_iarchiveE8BuildingE16load_object_dataERNS1_14basic_iarchiveEPvj[boost::archive::detail::iserializer<boost::archive::xml_iarchive, Building>::load_object_data(boost::archive::detail::basic_iarchive&, void*, unsigned int) const]+0x62): undefined reference to `void Building::serialize<boost::archive::xml_iarchive>(boost::archive::xml_iarchive&, unsigned int)'
collect2: ld returned 1 exit status
make[2]: *** [freeoriond] Error 1
make[1]: *** [server/CMakeFiles/freeoriond.dir/all] Error 2
make: *** [all] Error 2

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

Re: Both cmake and scons don't work for me.

#8 Post by Geoff the Medio »

SVN revision 3475 apparently fixed a problem with the build using GCC with revision 3474. You may have just picked a rather unlucky revision to try building... Could you try again with the latest SVN?

qubodup
Space Krill
Posts: 8
Joined: Sun Sep 30, 2007 9:27 am
Location: Berlin, Germany

Re: Both cmake and scons don't work for me.

#9 Post by qubodup »

Geoff the Medio wrote:SVN revision 3475 apparently fixed a problem with the build using GCC with revision 3474. You may have just picked a rather unlucky revision to try building... Could you try again with the latest SVN?
I did another checkout, now at r3484

I get following errors when compiling now:

Code: Select all

In file included from /home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_io.hpp:41,
                 from /home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_dynamic_io.hpp:37,
                 from /home/qubodup/src/subversion/freeorion/UI/CombatWnd.cpp:57:
/home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_io_private.hpp: In member function ‘void boost::gil::detail::png_reader::init()’:
/home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_io_private.hpp:183: error: ‘png_infopp_NULL’ was not declared in this scope
/home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_io_private.hpp:188: error: ‘png_infopp_NULL’ was not declared in this scope
/home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_io_private.hpp: In destructor ‘boost::gil::detail::png_reader::~png_reader()’:
/home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_io_private.hpp:202: error: ‘png_infopp_NULL’ was not declared in this scope
/home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_io_private.hpp: In member function ‘void boost::gil::detail::png_reader::apply(const View&)’:
/home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_io_private.hpp:214: error: ‘int_p_NULL’ was not declared in this scope
/home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_io_private.hpp: In member function ‘void boost::gil::detail::png_reader_color_convert<CC>::apply(const View&)’:
/home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_io_private.hpp:290: error: ‘int_p_NULL’ was not declared in this scope
/home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_io_private.hpp:315: error: there are no arguments to ‘png_set_gray_1_2_4_to_8’ that depend on a template parameter, so a declaration of ‘png_set_gray_1_2_4_to_8’ must be available
/home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_io_private.hpp:315: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_io_private.hpp:353: error: there are no arguments to ‘png_set_gray_1_2_4_to_8’ that depend on a template parameter, so a declaration of ‘png_set_gray_1_2_4_to_8’ must be available
In file included from /home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_io.hpp:41,
                 from /home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_dynamic_io.hpp:37,
                 from /home/qubodup/src/subversion/freeorion/UI/CombatWnd.cpp:57:
/home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_io_private.hpp: In member function ‘void boost::gil::detail::png_writer::init()’:
/home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_io_private.hpp:384: error: ‘png_infopp_NULL’ was not declared in this scope
In file included from /home/qubodup/src/subversion/freeorion/UI/CombatWnd.cpp:57:
/home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_dynamic_io.hpp: In member function ‘void boost::gil::detail::png_reader_dynamic::read_image(boost::gil::any_image<Types>&)’:
/home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_dynamic_io.hpp:91: error: ‘int_p_NULL’ was not declared in this scope
/home/qubodup/src/subversion/freeorion/UI/CombatWnd.cpp: At global scope:
/home/qubodup/src/subversion/freeorion/UI/CombatWnd.cpp:522: warning: ‘<unnamed>::temp_bool’ defined but not used
make[2]: *** [client/human/CMakeFiles/freeorion.dir/__/__/UI/CombatWnd.cpp.o] Error 1
make[1]: *** [client/human/CMakeFiles/freeorion.dir/all] Error 2
make: *** [all] Error 2
I have
extra/boost 1.41.0-1
extra/libpng 1.4.1-1
installed

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

Re: Both cmake and scons don't work for me.

#10 Post by Geoff the Medio »

png_infopp_NULL and int_p_NULL are defined in png.h which is part of libpng. I have version 1.2.34 of the png.h file in libpng, which has these defintions on lines 510 and 517. Are they missing in your png.h ?

qubodup
Space Krill
Posts: 8
Joined: Sun Sep 30, 2007 9:27 am
Location: Berlin, Germany

Re: Both cmake and scons don't work for me.

#11 Post by qubodup »

Code: Select all

grep png_infopp_NULL /usr/include/png.h
grep int_p_NULL /usr/include/png.h
returns nothing. I assume that these variables are not part of libpng 1.4 then..

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

Re: Both cmake and scons don't work for me.

#12 Post by Geoff the Medio »

Excerpted from png.h:

Code: Select all

#define int_p_NULL                (int *)NULL

#define png_infopp_NULL           (png_infopp)NULL

typedef png_info FAR * FAR * png_infopp;
and from zconf.h:

Code: Select all

#ifndef FAR
#  define FAR
#endif
so I'm guessing the FAR can be ignored.

However png_info is a complicated struct. If it is defined in your png.h then perhaps you can add the missing defines and see if it will compile, but it's still a bit of a long shot and I doubt we'll be able to make FreeOrion build easily against either version of libpng unless the GIL code is updated.

You could also try changing the code in CombatWnd.cpp:

Code: Select all

#include "../GG/src/GIL/image.hpp"
#include "../GG/src/GIL/extension/io/png_dynamic_io.hpp"
to

Code: Select all

#include "boost/gil/image.hpp"
#include "boost/gil/extension/io/png_dynamic_io.hpp"
There are apparently issues with those versions of the GIL headers, but they might be more compatible with later versions of libpng.

Alternatively, you may need to use an older version of libpng. We can't support every version of everything, and we can't always support the latest version of everything.

qubodup
Space Krill
Posts: 8
Joined: Sun Sep 30, 2007 9:27 am
Location: Berlin, Germany

Re: Both cmake and scons don't work for me.

#13 Post by qubodup »

Oh whoops, I didn't realize I should not have included the "_NULL" suffix. I can find the rest:

Code: Select all

$ grep png_infopp /usr/include/png*
/usr/include/png.h:typedef png_info FAR * FAR * png_infopp;
/usr/include/png.h:extern PNG_EXPORT(void,png_info_init_3) PNGARG((png_infopp info_ptr,
/usr/include/png.h:   png_infopp info_ptr_ptr));
/usr/include/png.h:   png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr));
/usr/include/png.h:   PNGARG((png_structpp png_ptr_ptr, png_infopp info_ptr_ptr));
$ grep int_p /usr/include/png*
/usr/include/pngconf.h:typedef png_fixed_point FAR * png_fixed_point_p;
/usr/include/pngconf.h:typedef png_fixed_point FAR * FAR * png_fixed_point_pp;
I thought I might just had to include png.h in GG/src/GIL/extension/io/png_io_private.hpp but that did not work out.

Here are my
zconf.h http://omploader.org/vNDVkZA
png.h http://omploader.org/vNDVkZQ
files just in case.

Changing the includes in CombatWnd.cpp as you suggested seems to have caused more errors: http://codepad.org/bfcANJj3

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

Re: Both cmake and scons don't work for me.

#14 Post by Geoff the Medio »

It looks like the version of GIL in boost 1.40 isn't compatible with libpng 1.4 either then. Switch back the the original includes.

But since you've got a define for png_infopp, you can probably just add one or both of

Code: Select all

#define int_p_NULL                (int *)NULL
#define png_infopp_NULL           (png_infopp)NULL
to the top of png_io_private.hpp and any other file that's causing the errors.

That might get it to compile, which might get it to run.

qubodup
Space Krill
Posts: 8
Joined: Sun Sep 30, 2007 9:27 am
Location: Berlin, Germany

Re: Both cmake and scons don't work for me.

#15 Post by qubodup »

Note: I had to remove the FATAL_ERROR clause from client/human/CMakeLists.txt

Last Changed Rev: 3484

After adding the two definitions, I get this error:

Code: Select all

In file included from /home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_io.hpp:41,
                 from /home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_dynamic_io.hpp:37,
                 from /home/qubodup/src/subversion/freeorion/UI/CombatWnd.cpp:57:
/home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_io_private.hpp: In member function ‘void boost::gil::detail::png_reader_color_convert<CC>::apply(const View&)’:
/home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_io_private.hpp:318: error: there are no arguments to ‘png_set_gray_1_2_4_to_8’ that depend on a template parameter, so a declaration of ‘png_set_gray_1_2_4_to_8’ must be available
/home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_io_private.hpp:318: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/home/qubodup/src/subversion/freeorion/UI/../GG/src/GIL/extension/io/png_io_private.hpp:356: error: there are no arguments to ‘png_set_gray_1_2_4_to_8’ that depend on a template parameter, so a declaration of ‘png_set_gray_1_2_4_to_8’ must be available
/home/qubodup/src/subversion/freeorion/UI/CombatWnd.cpp: At global scope:
/home/qubodup/src/subversion/freeorion/UI/CombatWnd.cpp:522: warning: ‘<unnamed>::temp_bool’ defined but not used
make[2]: *** [client/human/CMakeFiles/freeorion.dir/__/__/UI/CombatWnd.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [client/human/CMakeFiles/freeorion.dir/all] Error 2
make: *** [all] Error 2
hmm.. I've seen this before.

Post Reply