Author Topic: One final update for 2018: new gcc  (Read 5550 times)

0 Members and 1 Guest are viewing this topic.

Offline luke

  • Administrator
  • Seasoned Forum Regular
  • Posts: 324
    • View Profile
One final update for 2018: new gcc
« 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.

Offline jack

  • Seasoned Forum Regular
  • Posts: 408
    • View Profile
Re: One final update for 2018: new gcc
« Reply #1 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

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: One final update for 2018: new gcc
« Reply #2 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.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline RhoSigma

  • QB64 Developer
  • Forum Resident
  • Posts: 565
    • View Profile
Re: One final update for 2018: new gcc
« Reply #3 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...
My Projects:   https://qb64forum.alephc.xyz/index.php?topic=809
GuiTools - A graphic UI framework (can do multiple UI forms/windows in one program)
Libraries - ImageProcess, StringBuffers (virt. files), MD5/SHA2-Hash, LZW etc.
Bonus - Blankers, QB64/Notepad++ setup pack

Offline luke

  • Administrator
  • Seasoned Forum Regular
  • Posts: 324
    • View Profile
Re: One final update for 2018: new gcc
« Reply #4 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.

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: One final update for 2018: new gcc
« Reply #5 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?
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline luke

  • Administrator
  • Seasoned Forum Regular
  • Posts: 324
    • View Profile
Re: One final update for 2018: new gcc
« Reply #6 on: December 31, 2018, 08:39:09 am »
I encourage you to investigate possible ways to implement this and possibly do so.

Offline jack

  • Seasoned Forum Regular
  • Posts: 408
    • View Profile
Re: One final update for 2018: new gcc
« Reply #7 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?

Offline jack

  • Seasoned Forum Regular
  • Posts: 408
    • View Profile
Re: One final update for 2018: new gcc
« Reply #8 on: December 31, 2018, 09:27:04 am »
I also like SMcNeill idea, but why not also add an optimization option?
« Last Edit: December 31, 2018, 09:30:53 am by jack »

Offline RhoSigma

  • QB64 Developer
  • Forum Resident
  • Posts: 565
    • View Profile
Re: One final update for 2018: new gcc
« Reply #9 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?
My Projects:   https://qb64forum.alephc.xyz/index.php?topic=809
GuiTools - A graphic UI framework (can do multiple UI forms/windows in one program)
Libraries - ImageProcess, StringBuffers (virt. files), MD5/SHA2-Hash, LZW etc.
Bonus - Blankers, QB64/Notepad++ setup pack

Offline luke

  • Administrator
  • Seasoned Forum Regular
  • Posts: 324
    • View Profile
Re: One final update for 2018: new gcc
« Reply #10 on: December 31, 2018, 10:05:00 am »
Without checking, I'm pretty sure everything else is compiled with -O2 or -g as appropriate.

Offline Bert22306

  • Forum Regular
  • Posts: 206
    • View Profile
Re: One final update for 2018: new gcc
« Reply #11 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.

Offline jack

  • Seasoned Forum Regular
  • Posts: 408
    • View Profile

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
« Last Edit: December 31, 2018, 05:13:30 pm by SMcNeill »
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline jack

  • Seasoned Forum Regular
  • Posts: 408
    • View Profile
Re: One final update for 2018: new gcc
« Reply #14 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.