AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Question about the compilation from cvs (https://forums.alliedmods.net/showthread.php?t=462)

NiLuJe 03-24-2004 18:09

Question about the compilation from cvs
 
I juste realized that the binaries i compiled from the cvs need the libstdc++ to work! If not, the server segfault :/

Is that normal or did i do something wrong?

BAILOPAN 03-24-2004 18:10

which module

NiLuJe 03-25-2004 16:47

Oops, nothing, that were other libs that were missing ;)

NiLuJe 03-26-2004 16:20

Another question :

If I compile amxx (or mmx, or amxx modules, or everything ^^) with the -O2 flag (or even -O3), does it really improve performance? And is it stable?

And what does the defaut flag -O6 of the makefiles?

BAILOPAN 03-26-2004 16:34

The highest O flag is O3 I think, beyond that it really has no effect. I may be wrong. All it does is specificy another level of compile time optimizations.

NiLuJe 03-26-2004 16:39

Okay, for the moment, i just noticed that with the -o2 flags, the compile time is a little bit longer, but the binaries is a bit smaller, and it "works" (not heavily tested, i just checked that it launches everything without crashing xD )

And what about the -d0 flags for the small compiler?

BAILOPAN 03-26-2004 16:53

-d0 is highest optimization for small scripts, and contains no debugging information. while it works, be warned the compiler may take "shortcuts" that have unexpected results with more complicated operations.

also note you can turn all optimizations off with this:
-d3 -C+

MagicShot 03-27-2004 04:46

hmm
 
Bail: What is the best for decent optimization?

XAD 03-27-2004 05:01

Which version are you guys compiling with??
I run the latest Slackware with GCC 3.2.3 and this one doesn't like some of the coding...

/X

PS! Original AMXmod 0.9.6j compiles fine (testing now with ahtlon-xp optimization)...

NiLuJe 03-27-2004 05:56

Compiling everything with gcc 2.95.4 from a debian package, I'll try with the latest gcc 3.3.3, but i think i already tried and it doesn't works, sometimes compilation error, sometimes the binarie is not "complete" :/

And same question as magicshot : what is the best for decent optimisation?

XAD: What do you change to have an athlon-xp otpimisation?

EDIT: Same as XAD, the original amx 0.9.6j compile well with gcc 3.3.3, (no compilation error) but the binaries is a lot smaller (default optimisation)

gcc 2.95 : 268,8 ko
gcc 3.3.3 : 190,5 ko

... and ... Got a bad load with the gcc 3.3 compile ^^ The 2.95 one works fine. :?

EDIT2: Apparently, I got the same binaries (in size at least) with the -O3 & -O6 flags... :? And with the -O2 flags, the binaires are a little bit smaller... :?

XAD 03-27-2004 10:09

Quote:

Originally Posted by NiLuJe
... the original amx 0.9.6j compile well with gcc 3.3.3, (no compilation error) but the binaries is a lot smaller (default optimisation)

How did you get it to compile with GCC 3.3.3? Did you use the default AMXmodX' Makefile or did you change any options??

When I compile with GCC 3.2.3 I get following compile error:
Code:

CModule.h: At global scope:
CModule.h:76: template-argument `AMX_NATIVE_INFO*' uses anonymous type
CModule.h:76: ISO C++ forbids declaration of `natives' with no type

Is this a problem only with GCC 3.2.3 or a compiler option fix??

/X

PS! To AMXmod 0.9.6j to run with "athlon-xp" I added "-lstdc++" to the link options...

PM 03-27-2004 10:33

It looks like GCC 3.3 (i have 3.3.1) doesn't like the __attribute(packed) thing. To compile, try changing
#ifdef __GCC__
#define PACKED something
...

to
#ifdef __GCC__
#define PACKED

in amx.h

It compiles, but i am not sure whether it affects something else. I'll try to find an another way of doing it.

XAD 03-27-2004 17:23

Quote:

Originally Posted by PM
It looks like GCC 3.3 (i have 3.3.1) doesn't like the __attribute(packed) thing. To compile, try changing
#ifdef __GCC__
#define PACKED something
...

Yepp... it compiled (but it was called "__GNUC__")...

To bad you guys started with AMXmod 0.9.6j and not my "fixed" version as I changed the original code to fix all warnings (except the two in the amx engine)...

Thanks... I will test it to see if it broke something ;-)
/X

BAILOPAN 03-27-2004 17:33

Where is your fixed version? ;]

XAD 03-27-2004 17:57

Quote:

Originally Posted by BAILOPAN
Where is your fixed version? ;]

On my machine... :wink:

I didn't mean I expected you to have used it, only that it was bad as I think compile warnings indicates some possible issues with the code and therefore should be recoded (even if it's causing any problems).

I suppose this is the same reason I "hate" people saying that plugin compile indentation warnings should be ignored as to me it indicates that the coder have created code that is error prone and easy to read wrong (also for the coder him/herself)... but hey, it's my personally opinion (and only a problem for you if I'm your boss :wink:).

/X

PS! It's no magic or complicated only a fix of what the warnings suggest...

BAILOPAN 03-27-2004 18:03

Could you send it to me? I have tried reducing a great many of the warnings but some I could not fix (such as ones about Vector casts)

NiLuJe 03-28-2004 05:15

Xad : No, used the defaut makefile of amx 0.9.6j for my "test compile" with gcc 3.3.3 (amx 0.9.7 from the CVS at AMXMOD project on sourceforge)

PM: I'll try that ;)
EDIT: Doesn't work, it compiles, but the file is small (~ 190Ko ) and got a nice
Code:

[META] ERROR: dll: Failed query plugin '<amxx_mm_i686.so>'; Couldn't open file '/home/niluje/HLDS_L/cstrike/addons/amxx/dlls/amxx_mm_i686.so': /home/niluje/HLDS_L/cstrike/addons/amxx/dlls/amxx_mm_i686.so: undefined symbol: __gxx_personality_v0
:/

I would also like to know how to make my compile compatible with the glibc 2.2 system (because mine is under 2.3)? I saw in the metamod makefile this line
Code:

        # link against older libc for compatibility
        EXTRA_LINK = -L../priv/libc -lc

So it may be possible, but how can i install the old libc without screwing up my system?

PM 03-28-2004 07:42

NiLuJe: Try compiling everything with gcc 3.3;
Update: it looks like the PACKED attribute should only be removed after the names, that is, things like

typedef struct
{
a PACKED;
b PACKED;
} mytype /* no PACKED */;

NiLuJe 03-28-2004 08:07

PM : Okay 'ill try ;)

Metamodx : OK, works fine :) (after changing the -malign-xx flags to -faling-xx, like the warning said :) )

Amxmodx: Hu, what should i do with the packed thing? Edit by hand the amx.h to remove every packet after the names? (will try that ^^ ) : Done it and it WORKS ;) And the binarie is A LOT smaller! (also changed the -malign)

csstats: Works (-malign too)

fun: Works (-malign)

csstrike: Works (-malign)

engine: Works (-malign) binarie A LOT smaller too (/2 !)

mysql: Not tested but should works too ;)

EDIT: If you want to test, i uploaded all the compiles i made today :
http://n1luj3.free.fr/compil_test.tar.gz (5,4mo lot of compile ^^)

BAILOPAN 03-28-2004 11:13

If gcc-3.3 binaries are stable for you I will distribute 686 binaries compiled by gcc-3.3 from now on

NiLuJe 03-28-2004 12:49

I dont know if they are really "stable" because i didn't test them heavily, but at least, amxx loads fine ^^

I could try them if i can compile them with compatibility with glibc 2.2 system, because my public server is under glbic 2.2 :/ But for now, i don't know how to do that, any idea?

XAD 03-28-2004 17:39

Quote:

Originally Posted by BAILOPAN
Could you send it to me? I have tried reducing a great many of the warnings but some I could not fix (such as ones about Vector casts)

I have PM you "my" version of AMXmod...

Also I'm running GCC 3.2.3 with "athlon-xp" optimization on MetaMod 1.17 (+ valve updates), AMX Mod X 0.16, csstats (my reworked version based on csstats 0.9.3)... so far so good... So I would suggest you to test with both pentium4 and athlon-xp if you will release versions based on GCC 3.x.x to see if they are faster...

/X

NiLuJe 03-29-2004 09:39

:) I have succefully compiled metamodx linked to gcc 2.2, and it works :), but only with gcc 2.95, with gcc 3.3, i got a meta error undefined symbol :/ Is it normal?

NiLuJe 03-31-2004 13:02

:/ Got an error only with amxx_mm, when compiling with gcc-2.95 linked to libc 2.2.5 :

Code:

[META] ERROR: dll: Failed query plugin '<amxx_mm_i386.so>'; Couldn't open file '/halflife/game2877/bin/cstrike/addons/amxx/dlls/amxx_mm_i386.so': /halflife/game2877/bin/cstrike/addons/amxx/dlls/amxx_mm_i386.so: undefined symbol: __ctype_tolower_loc
But with the same config, everything else works fine :/ (mmx + all modules)

BAILOPAN 03-31-2004 13:04

AMXx is going through rapid development right now and I'd be surprised if anything from the CVS even compiled properly. Be careful with what you use in there because it may not be stable.

NiLuJe 03-31-2004 14:12

Thats what i was wondering, so i tried from the "stable" source of the 0.16, and obtained the same result, so i guess this problem came from my side ^^

BAILOPAN 03-31-2004 16:29

Make sure your makefile is correct... undefined symbols usually mean there was a linking problem. Try installing lstdc++

NiLuJe 04-01-2004 07:38

Can you give me an example of a mekfile wich works to wompile amxx with a link to glibc2.2 (and with what version of that lib?)

> Same thing with -lstdc++ :/

NiLuJe 04-06-2004 13:31

Hum, i finnally installed a debian 3.0 stable on my test box, and compiled everything from here, and it works ;)


All times are GMT -4. The time now is 21:50.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.