QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: luke on December 30, 2018, 11:36:21 pm

Title: One final update for 2018: new gcc
Post by: luke on December 30, 2018, 11:36:21 pm
The development build now comes with gcc 8.1.0 on Windows, which is a refreshing change from  whatever god-awful version it was using before (hint: I don't think it'd been updated since 2012 or so). If you have C++ compilation errors post them here and I'll sort things out quick smart.

Early next year we'll probably see an official 64 bit download appearing for Windows, based on Steve's work. Most people are probably using 64 bit machines these days but rest assured, the 32 bit version won't be going anywhere.

There's also the matter of Linux binaries not being launchable from some new file managers - that'll get some love soon, too.

We have variable length strings in UDT's now but don't hold your breath for arrays in there as well.
Title: Re: One final update for 2018: new gcc
Post by: jack on December 31, 2018, 05:33:22 am
hello Luke
may I suggest that you add -O2 to the makeline text files that are in the directory qb64/internal/c ?
that way the programs compiled with QB64 will be optimized and run significantly faster and the executables will probably be smaller as well
Title: Re: One final update for 2018: new gcc
Post by: SMcNeill on December 31, 2018, 06:15:09 am
Why -O2? 

Why not -O3, -O4, -Ofast, or -ffast-math?  -Os is almost the same as -O2, but focuses on size reduction more, which is a concern you mentioned; why not use it?

Or even better: Why not let the end user decide if they want/need the additional flags, and let them edit the makeline themselves, if they choose to do so?  One edit after install, and you can have the custom flag set which suits your needs from that point on.
Title: Re: One final update for 2018: new gcc
Post by: RhoSigma on December 31, 2018, 07:17:23 am
I agree to Steve's point here, there should only be the required things in makeline_xxx.txt. Everything else should be on the user's needs and experience, some know how to program and compile C/C++, others are pure BASIC hobbyists, not even knowing there's a C/C++ stage beneath QB64. However, a wiki page pointing out to the useful vs. useless/dangerous options might be a good idea for the future.

Happy New Year...
Title: Re: One final update for 2018: new gcc
Post by: luke on December 31, 2018, 07:37:19 am
The required work here is to ensure any optimisation options are removed when compiling with debugging enabled.
Title: Re: One final update for 2018: new gcc
Post by: SMcNeill on December 31, 2018, 07:55:37 am
The required work here is to ensure any optimisation options are removed when compiling with debugging enabled.

Wouldn’t the easy solution there be to have makeline add -Og at the end, when the debug box is checked in options; and remove it when it’s not?
Title: Re: One final update for 2018: new gcc
Post by: luke on December 31, 2018, 08:39:09 am
I encourage you to investigate possible ways to implement this and possibly do so.
Title: Re: One final update for 2018: new gcc
Post by: jack on December 31, 2018, 08:59:15 am
Why -O2? 

Why not -O3, -O4, -Ofast, or -ffast-math?  -Os is almost the same as -O2, but focuses on size reduction more, which is a concern you mentioned; why not use it?

Or even better: Why not let the end user decide if they want/need the additional flags, and let them edit the makeline themselves, if they choose to do so?  One edit after install, and you can have the custom flag set which suits your needs from that point on.
Why -O2?  , because it's a safe near optimal setting
-O3 or -Ofast is risky in my opinion and quite often does very little to increase the running speed
as for letting the users choose, that's fine, but how many know about makeline and how to add optimization?
Title: Re: One final update for 2018: new gcc
Post by: jack on December 31, 2018, 09:27:04 am
I also like SMcNeill idea, but why not also add an optimization option?
Title: Re: One final update for 2018: new gcc
Post by: RhoSigma on December 31, 2018, 09:38:25 am
BTW - What's with all that pre-compiled and later linked in content? - Shouldn't it match to the same optimization settings as used for compiling the main program (the final EXE) in each single case?
Title: Re: One final update for 2018: new gcc
Post by: luke on December 31, 2018, 10:05:00 am
Without checking, I'm pretty sure everything else is compiled with -O2 or -g as appropriate.
Title: Re: One final update for 2018: new gcc
Post by: Bert22306 on December 31, 2018, 02:12:08 pm
The development build now comes with gcc 8.1.0 on Windows, which is a refreshing change from  whatever god-awful version it was using before (hint: I don't think it'd been updated since 2012 or so). If you have C++ compilation errors post them here and I'll sort things out quick smart.

Early next year we'll probably see an official 64 bit download appearing for Windows, based on Steve's work. Most people are probably using 64 bit machines these days but rest assured, the 32 bit version won't be going anywhere.

Just feel the need to voice my thanks and appreciation for these changes. Thanks, Luke and Steve! Am looking forward to the early 2019 development build!

As to optimization options, perhaps an explanation in the Wiki would help, if not built into the IDE somehow? It sounds like some safe options are available (speed or size of .exe) which could possibly be options listed in the IDE? Just wondering.
Title: Re: One final update for 2018: new gcc
Post by: jack on December 31, 2018, 04:19:42 pm
just for your information, https://stackoverflow.com/questions/1778538/how-many-gcc-optimization-levels-are-there
Title: Re: One final update for 2018: new gcc
Post by: SMcNeill on December 31, 2018, 04:58:31 pm
just for your information, https://stackoverflow.com/questions/1778538/how-many-gcc-optimization-levels-are-there

A better link for you is here:  https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html

And if you want a full listing of flags go to either of the following:

https://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html#Option-Summary
https://gcc.gnu.org/onlinedocs/gcc/Invoking-GCC.html#Invoking-GCC

Title: Re: One final update for 2018: new gcc
Post by: jack on December 31, 2018, 05:34:18 pm
@SMcNeill
I don't know why I struck a wrong note with you, I have nothing against you and I am familiar with the gcc compiler options, the link I provided was not for you but for the rest who are not familiar with gcc's intrinsics.
Title: Re: One final update for 2018: new gcc
Post by: SMcNeill on December 31, 2018, 09:17:15 pm
@SMcNeill
I don't know why I struck a wrong note with you, I have nothing against you and I am familiar with the gcc compiler options, the link I provided was not for you but for the rest who are not familiar with gcc's intrinsics.

No wrong note at all.  ;)

I just thought you might like the list of the complete options, as well as a better description of what those -O, -O2, and -O3 flags are actually doing.  :D
Title: Re: One final update for 2018: new gcc
Post by: FellippeHeitor on December 31, 2018, 09:22:39 pm
All's working well on my Windows XP VM.