Re: progress
Also I've been looking at your src code and didn't find anything wrong. But I've figured that the optimisation flags may need altered a bit.
Code:
-O2 -march=i686 -mtune=generic -msse2 -mfpmath=sse -fomit-frame-pointer -finline-functions \ Code:
bot_t::bot_t(): respawn_state(0), bShouldInit(false), skin{}, not_started(0), start_action(0), kick_time(0), Code:
#ifdef WIN32 |
Re: progress
The C++ runtime can be statically linked to the binary. This will resolve all problems with
the ABI. It will also increase the binary size of the final .so file but nowadays that is really not as issue. |
Re: progress
1 Attachment(s)
@tschumann
Also I've been using the trial version of PVS Studio Analyser on SandBot and spotted a few performance issues here:- |
Re: progress
Quote:
There's an init function that sets all those things that the constructor should set - it's a change I'll get around to sooner or later. There's plenty of messy and non-performant code that I want to fix but I've been concentrating on features for now (converting HBP Bot which was mostly C to C++ is still in progress). Quote:
Quote:
|
Re: progress
Well I wasn't sure if adding MMX and SSE were necessary as well as adding too many opt flags as well as using -O3 could cause some adverse effects as well increase the build size. As for using like -march=pentium4 or higher may not be compatible with the old GoldSrc engine as it was released since 1997/1998 and maybe pushed to it's limit. Also some older compilers like GCC 4.8 appear to recompile those builds in a smaller size but won't have the latest C++14 nor C++17 standard features - if I am not mistaken.
|
Re: progress
@tschumann It's a bit tricky for GCC but not hard. Locate the 32bit version of libstdc++.a file on your system and copy it on the same location where your Makefile is, then add -L. to the linker flags. Thats all. :)
@RoboCop You've got it wrong about optimization flags. It does not matter if the engine is compiled with or without these flags, the only thing that matters is if the target CPU supports them. MMX and SSE are pretty common in modern CPUs and even in CPUs that are 10 years old. :) Of-course one should be careful with the newer revisions of these instructions such as SSE3 and SSE4.x as these are not available on the 10 years old CPUs. Also -03 may increase the build size but it optimize much more on performance which is good. Modern HDDs are not 20MB so the size does not matter that much. :) However -03 is not recommended for legacy code base until all warnings that the compiler outputs on the highest warning level are not fixed(this does NOT include 3rd party static analyzers). That's because -03 is much more aggressive(but conforming) to optimizations and many bugs that are caused by code that is somewhat in the category undefined behavior(like signed integer overflow for example) will pop up. :) |
Re: progress
Quote:
Quote:
|
Re: progress
Well, actually it does not makes sense, because the GCC compiler is always choosing the dynamic C++ runtime if it sees them both in the same directory, regardless of staticlib flags. This trick is just bringing the static file in the first search path, so the compiler have no choice but to use it. :)
|
Re: progress
Ah okay - that's probably why it didn't work last time.
|
Re: progress
Okay, a question for those who know g++ and Makefiles better than I do - where do I put -Wall -Wextra -Werror etc and have warnings get displayed etc? I tried putting them in various places but things which should have generated warnings (assigning 256 to char for example) did not.
|
All times are GMT +2. The time now is 10:35. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.