building from trunk failed

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

rion
Above Average
Above Average
Posts: 17
Joined: Fri Jul 10, 2009 10:38 am

building from trunk failed

Post by rion »

just tried to build oolite from trunk on my gentoo system but got next error

Code: Select all

src/Core/Entities/Entity.m:53: error: static declaration of 'class_getInstanceSize' follows non-static declaration
# eix -cI gnustep
gnustep-base/gnustep-base ([email protected]): A library of general-purpose, non-graphical Objective C objects.
gnustep-base/gnustep-gui ([email protected]): Library of GUI classes written in Obj-C
gnustep-base/gnustep-make ([email protected]): GNUstep Makefile Package

oolite-1.73.4 builds and works fine
xmpp: rion [at] jabber.ru
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Is this the only error you get? It builds successfully on other distributions of Linux, plus Win and Mac as is.

Things I would check:
1. What version of GCC are you running? Versions 3.4.2 (used on Windows) and 4.0 and 4.2 (used on Mac (I think)) do fine there.
2. You seem to be building with 'make use_distro_deps'. Try building using gnustep-base 1.18 by running just make, all necessary files should be included in the trunk tree. It could be some gnustep-1.20 incompatibility.
3. What is OOINLINE defined as in your system?
rion
Above Average
Above Average
Posts: 17
Joined: Fri Jul 10, 2009 10:38 am

Post by rion »

another_commander wrote:
Is this the only error you get?
compilation just stops here. so the only
another_commander wrote:
1. What version of GCC are you running? Versions 3.4.2 (used on Windows) and 4.0 and 4.2 (used on Mac (I think)) do fine there.
4.4.3
another_commander wrote:
2. You seem to be building with 'make use_distro_deps'. Try building using gnustep-base 1.18 by running just make, all necessary files should be included in the trunk tree. It could be some gnustep-1.20 incompatibility.
related part of ebuild

Code: Select all

src_compile() {
	cd deps/Cross-platform-deps/SpiderMonkey/js/src
	BUILD_OPT=1 make -f Makefile.ref || die "make failed"
	cd "${S}"
	make debug=no || die "make failed"
}
ok, i've rolled back to gnustep-base-0.18 and gnustep-gui-0.16 and Entity.m compiled w/o errors. so yes its compatibility issue.
but i got another error:

Code: Select all

In file included from /usr/include/zlib.h:35,
                 from deps/Linux-deps/include/png.h:392,
                 from src/SDL/MyOpenGLView.m:43:
/usr/include/zconf.h:333: error: duplicate 'unsigned'
/usr/include/zconf.h:333: error: two or more data types in declaration specifiers
In file included from deps/Linux-deps/include/png.h:396,
                 from src/SDL/MyOpenGLView.m:43:
deps/Linux-deps/include/pngconf.h:366: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
deps/Linux-deps/include/pngconf.h:367: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'include'
make[3]: *** [obj.spk/oolite.obj/MyOpenGLView.m.o] Error 1
make[2]: *** [internal-objc_program-all_] Error 2
make[1]: *** [oolite.all.objc-program.variables] Error 2
make: *** [internal-all] Error 2
i have zlib 1.2.5 and bunch of programs compiled with it if it makes sense.
related line of zconf.h looks like

Code: Select all

typedef unsigned char  Byte;  /* 8 bits */
which seems to be ok
i didn't check pngconf.h error though
another_commander wrote:
3. What is OOINLINE defined as in your system?
I don't know what is this and where to check
xmpp: rion [at] jabber.ru
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Good to know that it was gnustep-1.20 that was the problem and it's fixed with 1.18.

The other error you are getting now (zconf.h line 333) is under investigation. The pngconf.h one in line 366 is due to setjmp.h being included in some other header and libpng does not allow its inclusion again. Yesterday I commited some code for saving PNG screenshots and, apparently, either including png.h in MyOpenGLView.m or something in the PNG saving code itself is causing Linux to blow up, although Windows seem to go fine with it. We hope to be able to resolve this relatively quickly. Unfortunately, I do not have a Linux system to run checks on, so I need to wait for one of our Linux gurus to comment.

Oh, and don't worry about OOINLINE, it looks like it was unrelated after all.
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6312
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Post by Diziet Sma »

another_commander wrote:
Unfortunately, I do not have a Linux system to run checks on, so I need to wait for one of our Linux gurus to comment.
So install Sun VirtualBox, then you can run any number of Linux flavours inside Windows.. (or vice-versa..) 8)

I do both.. it's very handy for testing.. especially the way you can revert to a snapshot of the system if you break something..
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
User avatar
Getafix
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 979
Joined: Tue Apr 01, 2008 12:55 pm
Location: A small ice asteroid, orbiting Oresrati in Galaxy 8 (a.k.a. northwest Armorica).
Contact:

Post by Getafix »

rion wrote:
but i got another error:

Code: Select all

In file included from /usr/include/zlib.h:35,
                 from deps/Linux-deps/include/png.h:392,
                 from src/SDL/MyOpenGLView.m:43:
/usr/include/zconf.h:333: error: duplicate 'unsigned'
/usr/include/zconf.h:333: error: two or more data types in declaration specifiers
In file included from deps/Linux-deps/include/png.h:396,
                 from src/SDL/MyOpenGLView.m:43:
deps/Linux-deps/include/pngconf.h:366: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
deps/Linux-deps/include/pngconf.h:367: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'include'
make[3]: *** [obj.spk/oolite.obj/MyOpenGLView.m.o] Error 1
make[2]: *** [internal-objc_program-all_] Error 2
make[1]: *** [oolite.all.objc-program.variables] Error 2
make: *** [internal-all] Error 2
Fixed in r3317. 8)
"Any sufficiently advanced information is indistinguishable from noise." [Newman, Lachmann, Moore]
rion
Above Average
Above Average
Posts: 17
Joined: Fri Jul 10, 2009 10:38 am

Post by rion »

now it fails on pulseaudio linking, which is not installed on my system at all.
as far as i see, oolite itself doesn't use pulseaudio, but espeak can be linked with it (at least on gentoo). so probably its better to make pulseaudio optional or exclude it at all.
xmpp: rion [at] jabber.ru
User avatar
Getafix
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 979
Joined: Tue Apr 01, 2008 12:55 pm
Location: A small ice asteroid, orbiting Oresrati in Galaxy 8 (a.k.a. northwest Armorica).
Contact:

Post by Getafix »

Suggestion #1
Install the missing library libpulse-dev.

Suggestion #2
Do not install libpulse-dev, but build with distro-release option.
In that case you will most probably need to install the libespeak-dev library (with all its dependencies).
"Any sufficiently advanced information is indistinguishable from noise." [Newman, Lachmann, Moore]
rion
Above Average
Above Average
Posts: 17
Joined: Fri Jul 10, 2009 10:38 am

Post by rion »

Getafix wrote:
Suggestion #1
Install the missing library libpulse-dev.
not acceptable on gentoo since there is no separate library. moreover i don't want to have whole pulseaudio installed just to make oolite linkable
Getafix wrote:
Suggestion #2
Do not install libpulse-dev, but build with distro-release option.
In that case you will most probably need to install the libespeak-dev library (with all its dependencies).
distro-release option ? can you give me example?

i looked in makefile and pulse is hardcoded there when espeak is enabled, so oolite won't link w/o libpulse in any case.
and i have gentoo system. so i already have dev packages installed for everything

to make it work either with pulseaudio or w/o it its enough to just remove -lpulse string from makefile.
i can't say anything about other systems except gentoo though.
xmpp: rion [at] jabber.ru
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

You can try from a clean source tree checkout:

Code: Select all

make -f Makefile distro-release
-lpulse is not used when building with the distro's dependencies.
rion
Above Average
Above Average
Posts: 17
Joined: Fri Jul 10, 2009 10:38 am

Post by rion »

another_commander wrote:
You can try from a clean source tree checkout:

Code: Select all

make -f Makefile distro-release
-lpulse is not used when building with the distro's dependencies.
thanks for clarification. now it compiles w/o errors =)

gentoo users can try my 9999(trunk) ebuild as always by adding "rion" overlay and unmasking this package
xmpp: rion [at] jabber.ru
rion
Above Average
Above Average
Posts: 17
Joined: Fri Jul 10, 2009 10:38 am

Post by rion »

about compatibility issue with latest gnustep-base

error refers to first declaration in /usr/GNUstep/System/Library/Headers/ObjectiveC2/runtime.h
which looks like

Code: Select all

size_t class_getInstanceSize(Class cls);
as you can see its not static.

i also noticed that this function is not declared anywhere in the previous version of gnustep-base.

so probably a trivial solution will be conditional compiling of this function in oolite.

Code: Select all

--- src/Core/Entities/Entity.m	2010-05-13 14:24:30.360987504 +0600
+++ src/Core/Entities/Entity.m	2010-05-13 14:16:57.392987425 +0600
@@ -50,12 +50,16 @@
 #if OOLITE_MAC_OS_X
 #import <objc/objc-class.h>
 #endif
+#if GNUSTEP_BASE_MAJOR_VERSION < 1 || \
+     GNUSTEP_BASE_MAJOR_VERSION == 1 && \
+     GNUSTEP_BASE_MINOR_VERSION < 20
 OOINLINE size_t class_getInstanceSize(Class cls)
 {
 	return cls->instance_size;
 }
 #endif
 #endif
+#endif
 
 
 static NSString * const kOOLogEntityAddToList				= @"entity.linkedList.add";
--- src/Core/Universe.m	2010-05-13 14:24:17.678986950 +0600
+++ src/Core/Universe.m	2010-05-13 14:20:06.751237014 +0600
@@ -200,11 +200,15 @@
 #if OOLITE_MAC_OS_X
 #import <objc/objc-class.h>
 #endif
+#if GNUSTEP_BASE_MAJOR_VERSION < 1 || \
+     GNUSTEP_BASE_MAJOR_VERSION == 1 && \
+     GNUSTEP_BASE_MINOR_VERSION < 20
 OOINLINE size_t class_getInstanceSize(Class cls)
 {
 	return cls->instance_size;
 }
 #endif
+#endif
 
 
 @implementation Universe
--- ./src/Core/NSNumberOOExtensions.m	2010-05-13 15:53:02.542237662 +0600
+++ ./src/Core/NSNumberOOExtensions.m	2010-05-13 16:04:43.933987708 +0600
@@ -73,7 +73,9 @@
 @end
 
 
-#ifdef GNUSTEP
+#if defined(GNUSTEP) && (GNUSTEP_BASE_MAJOR_VERSION < 1 || \
+    GNUSTEP_BASE_MAJOR_VERSION == 1 && \
+    GNUSTEP_BASE_MINOR_VERSION < 20)
 
 /*	As an optimization, we override the implementation on NSBoolNumber to
 	always return YES. In practical terms, we could always return NO in
but i'm not sure about implementation int the gnustep.

the next error i got isalready in linking stage

Code: Select all

 Linking objc_program oolite ...
./obj.spk/oolite.obj/NSNumberOOExtensions.m.o:(.data.rel+0x8): undefined reference to `__objc_class_name_NSBoolNumber'
Edit: ok, i've updated patch above with fixed conditions and addition for linkage
xmpp: rion [at] jabber.ru
rion
Above Average
Above Average
Posts: 17
Joined: Fri Jul 10, 2009 10:38 am

Post by rion »

anyone?..

i've uploaded ready to apply patch http://filebin.ca/skftnm/oolite-gnustep-1.20.patch
xmpp: rion [at] jabber.ru
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Thanks rion! I'm not sure when we're going to go from our present - fairly old - gnustep build system to a more recent one, but when we do we'll definitely use your work! :)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
rion
Above Average
Above Average
Posts: 17
Joined: Fri Jul 10, 2009 10:38 am

Post by rion »

Kaks wrote:
Thanks rion! I'm not sure when we're going to go from our present - fairly old - gnustep build system to a more recent one, but when we do we'll definitely use your work! :)
this patch does not abolish support for old versions of gnustep-base. so its safe to apply it, but probably i'd made it more proper if had experience in gnustep programming.
anyway it just works =)
xmpp: rion [at] jabber.ru
Post Reply