Setting gcc compiler for WinFBE

Windows specific questions.
deltarho[1859]
Posts: 2698
Joined: Jan 02, 2017 0:34
Location: UK

Setting gcc compiler for WinFBE

Postby deltarho[1859] » Aug 29, 2019 10:37

The title of this thread says it all. We can change the gcc compilers used by WinFBE by running 'SetGCCVersion.exe' before opening WinFBE. I tried to do this from within WinFBE but failed miserably.

Step 1

srvaldez has 'pulled' the builds at the link below. The following can still be used, but we must use other builds.

Go to the opening post of FreeBASIC-1.06.0-Win gcc-9.1.

Now download the 32-bit and 64-bit of the gcc compilers that you may want to use from the list headed 'more builds from git 2019-08-23'. I qualify as being barking mad, so I downloaded all of them. <smile>

Step 2

Very important

Open WinFBE and navigate to Options>Environment Options...>Compiler Setup and copy the FBC 32-bit and 64-bit entries. Needless to say I very much hope that you will not need to restore these entries but it is better to be safe than sorry.

Step 3

NOTE: SetGCCVersion has been changed to SetGCCforWinFBE ( 2 Sept 2019) - see later post.

'SetGCCVersion' needs an ini file and you will have to write it. What? Shut up and just do it.

This is what mine looks like:

Code: Select all

"E:\WinFBE\Settings\WinFBE.ini"
"5.2", "C:\Program Files (x86)\FreeBASIC\fbc.exe", "E:\Downloads\FreeBASIC-1.07.0-win64\fbc.exe"
"7.4", "E:\Downloads\fb107-win32-gcc740\FreeBASIC-1.07.0-win32\fbc.exe", "E:\Downloads\fb107-win64-gcc740\FreeBASIC-1.07.0-win64\fbc.exe"
"8.3", "E:\Downloads\fb107-win32-gcc830\FreeBASIC-1.07.0-win32\fbc.exe", "E:\Downloads\fb107-win64-gcc830\FreeBASIC-1.07.0-win64\fbc.exe"
"9.2", "E:\Downloads\fb107-win32-gcc920\FreeBASIC-1.07.0-win32\fbc.exe", "E:\Downloads\fb107-win64-gcc920\FreeBASIC-1.07.0-win64\fbc.exe"

The first entry is the path to WinFBE's ini file. You will find this in WinFBE's 'Settings' folder. The safest way to get the path is to hold a shift key down, right click on WinFBE.ini and choose, if available, 'Copy as path'.

The second and subsequent entries are in three parts. The first part is a description of the compiler. As you can see my descriptions are short and sweet. The second and third parts are the paths to the 32-bit and 64-bit paths respectively. 'SetGCCVersion.ini' should have at most four sets of paths and 'SetGCCVersion.exe' will display four radio buttons. If, for example, you only supply two sets, then the last two radio buttons will be disabled. I have just realized that I do not check that you have supplied no more than four sets, tch, tch. I will think on that one, so make sure that you do not supply more than four sets.

I have installed fbc 1.07 and the 64-bit version via Version 1.07.0 released and that is where the 5.2 paths come from.

When done save as SetGCCVersion.ini.

Step 4

Download SetGCCVersion.zip.

I write sparse forms and do not use buttons which duplicate tasks. 'setGCCVersion.exe' is bereft of buttons. If we close the form WinFBE.ini will remain as found, effectively cancelling the form. We will do this if the current compiler is what we actually want. If we select a radio button WinFBE.ini will be edited accordingly, and we just close the form.

This is what I get running 'SetGCCVersion.exe', indicating that the current compiler used is 8.3. If I am happy with that then I would just close the form otherwise I would choose another compiler and then close the form.

Image

When SetGCCVersion runs it will try to match the current 32-bit compiler path in WinFBE.ini with the second part of each of the compilers paths in 'SetGCCVersion.ini'. If successful then the appropriate radio button will be set. If it fails to match then a message box will display "Could not determine existing setup". This will, undoubtedly, occur on the very first run of 'SetGCCVersion.exe'. Don't worry, just click on the compiler you wish to use; on subsequent runs of 'SetGCCVersion.exe' you should see a set radio button indicating the current compiler used.

'SetGCCVersion.exe' runs TopMost.

Some of you rascals will probably try to run 'SetGCCVersion.exe' more than one once. You can try it but it won't get you anywhere - I have blocked you. <smile>

Any problems with 'SetGCCVersion.exe' then please let me know. I will put money on it that you will. Step 2 should get you out of trouble.

You can thank me for this if you want but, believe me, I would not be the slightest bit upset if you didn't. What I have done here pale into insignificance compared with srvaldez's monumental task of providing us with a rich set of gcc compilers to choose from. While I am at it, and not mentioned enough, is ST_W's fbc builds, coderJeff knocking two fbc versions in the same year and fxm updating the Help file at the drop of a hat. Oh, and counting_pine who probably does a lot more than we think he does. Have I missed anyone out? I sometimes regret my 'having a go' at both coderJeff and counting_pine some time ago resulting in my departing to the hills for a while but I do have a short temper. Of course, we got Imortis as a Moderator out of it so there was a good side. Blimey, it took me a long time to divulge that. <smile>

I cannot remember when I first tried gcc 7.3, from a srvaldez build, but found that the 64-bit version was a tad unreliable. I am finding the same with 7.4. The more people experimenting with 7.4 the better because if it turns out that it is unreliable for others then that would be worthwhile for coderJeff to hear about it as version 7 looks to be the likeliest version to become the 'official line'. gcc 8.3 may be a better option. WinFBE's default is 8.1 and I have found that to be stable.
Last edited by deltarho[1859] on Sep 04, 2019 0:59, edited 5 times in total.
deltarho[1859]
Posts: 2698
Joined: Jan 02, 2017 0:34
Location: UK

Re: Setting gcc compiler for WinFBE

Postby deltarho[1859] » Aug 29, 2019 11:32

I forgot to mention that if you use José Roca's WinFBX then you will need to add his Afx folder to each of the compiler path's inc folder. The default WinFBE paths does that for us.
srvaldez
Posts: 2540
Joined: Sep 25, 2005 21:54

Re: Setting gcc compiler for WinFBE

Postby srvaldez » Aug 29, 2019 12:10

thank you deltarho[1859] :-)
deltarho[1859]
Posts: 2698
Joined: Jan 02, 2017 0:34
Location: UK

Re: Setting gcc compiler for WinFBE

Postby deltarho[1859] » Aug 29, 2019 13:01

<smile>

I have done very little compared to what you did, srvaldez. Anyway, thanks for the thanks.

You know, there is one guy I forgot to mention in my 'credits', Paul Squires for WinFBE. Without WinFBE this thread would not exist. <laugh>

We can do a similar exercise for poseidonFB and other IDEs I shouldn't wonder but I don't want to get into that because I am a WinFBE fan.
deltarho[1859]
Posts: 2698
Joined: Jan 02, 2017 0:34
Location: UK

Re: Setting gcc compiler for WinFBE

Postby deltarho[1859] » Aug 29, 2019 16:14

I have just uploaded a new version of 'SetGCCVersion.zip'. If 'SetGCCVersion.ini' has more than four compiler pairs they will be ignored. I did not like having an open manhole even if it had a danger sign.
deltarho[1859]
Posts: 2698
Joined: Jan 02, 2017 0:34
Location: UK

Re: Setting gcc compiler for WinFBE

Postby deltarho[1859] » Aug 29, 2019 16:40

Just done a test on Encrypternet to look at the size of binaries. I am not interested in speed of execution as most of the time is I/O.

Code: Select all

      32     64
5.2 129024 128000
7.4 125952  FAIL
8.3 122368 133120
9.2 121856 125952

There is a reduction with each later compiler except for 8.3 64-bit.

Eight compilations and seven successes - with 7.4 64-bit letting the side down. If I remember correctly 7.3 64-bit failed to compile some of my random number generators. I hope that others will test 7.4, so that we know where we stand with it. It may be that I have just been unlucky with it.
srvaldez
Posts: 2540
Joined: Sep 25, 2005 21:54

Re: Setting gcc compiler for WinFBE

Postby srvaldez » Aug 29, 2019 17:14

interesting, do you have any multithreaded test programs available for testing?
deltarho[1859]
Posts: 2698
Joined: Jan 02, 2017 0:34
Location: UK

Re: Setting gcc compiler for WinFBE

Postby deltarho[1859] » Aug 29, 2019 17:42

I might have some but it is some time since I did any multi-threading, and they were snippets to see if it was worthwhile or not.

Why do you ask?
srvaldez
Posts: 2540
Joined: Sep 25, 2005 21:54

Re: Setting gcc compiler for WinFBE

Postby srvaldez » Aug 29, 2019 18:14

just wondering whether everything is working in my builds
deltarho[1859]
Posts: 2698
Joined: Jan 02, 2017 0:34
Location: UK

Re: Setting gcc compiler for WinFBE

Postby deltarho[1859] » Aug 29, 2019 18:22

So far so good.

It is just 7.4 64-bit which is troublesome but, as mentioned, I had issues with 7.3 64-bit last year so it seems something untoward is occurring with gcc version 7 64-bit rather than your 7.4 build. The most common issue is " undefined reference to `frame' ", whatever that means.

Added: <rant> What I would really like to happen is for a bunch of folk who use WinFBE to take the time out and do as the opening post. We need more than just a couple of guys testing. Step 2 allows us to return WinFBE to its default set up so no damage can be done. The problem is that with human nature being the way it is most folk would rather others do the grind and then 'cash in'. If gcc version 7 64-bit is a dog then it needs to be avoided. There would be hell to pay if 7.3 (or 7.4) became the 'official' line and then confirmed to be a dog. <rant over>
coderJeff
Site Admin
Posts: 3342
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: Setting gcc compiler for WinFBE

Postby coderJeff » Aug 29, 2019 23:25

thank-you deltarho. thank-you srvaldez.

I am thrilled that you guys are exploring new possibilities and sharing the results. It is your effort that will help guide the next release. I haven't changed to a new version of gcc in the release because I honestly don't know what's best. If you guys are willing to work together to make a recommendation, then I am willing to accept it. Simple as that.

Just a hunch: feels like we should make incremental steps of gcc version, which is my only inclination towards 7.3 or .4. Or have a release that offers 2 versions of gcc (and related binutils if that's important).

Again, I think it's great what you guys are sharing here. I think I've posted about it before that I don't quite understand the hang-up about "official" versus "unofficial", so if a release package passes all the tests, then it should be considered validated, and users should feel safe in using it.

Thank-you for helping in this area of project development.
deltarho[1859]
Posts: 2698
Joined: Jan 02, 2017 0:34
Location: UK

Re: Setting gcc compiler for WinFBE

Postby deltarho[1859] » Aug 30, 2019 18:57

My opening post says: " 'SetGCCVersion.exe' before opening WinFBE. ". So there I am working with WinFBE64 and decide to change the compiler with 'SetGCCVersion.exe'. I realized my mistake so closed WinFBE64 and opened it again forgetting "Guess what, WinFBE's ini file gets updated on closing."; which I wrote in the 'FreeBASIC-1.06.0-Win gcc-9.1' thread. So my 'SetGCCVersion.exe' change got overwritten. Talk about R.T.F.M I didn't read my own. <laugh>.

I have just uploaded a new version of 'SetGCCVersion.zip'.

'SetGCCVersion.zip' will now first check for another instance and if found will terminate. No change there. The next step is to check whether WinFBE32.exe or WinFBE64.exe are running and if so issues a warning and then terminates. I use WinFBE64.exe and get this if found running.

Image

I use the command line tool 'tasklist' so there is a very brief song and dance routine from the console before 'SetGCCVersion.exe' responds.

'SetGCCVersion.exe' is now a little larger coming in at a whopping 67.5KB. <smile>
srvaldez
Posts: 2540
Joined: Sep 25, 2005 21:54

Re: Setting gcc compiler for WinFBE

Postby srvaldez » Aug 30, 2019 20:03

thanks for the update :-)
deltarho[1859]
Posts: 2698
Joined: Jan 02, 2017 0:34
Location: UK

Re: Setting gcc compiler for WinFBE

Postby deltarho[1859] » Sep 01, 2019 23:58

Cosmetic changes. We needed to be specific. Beta to release. <smile>

Name changed from SetGCCVersion.exe to SetGCCforWinFBE.exe.

ini file changed from SetGCCVersion.ini to SetGCCforWinFBE.ini.

GUI now looks like
Image

Download SetGCCforWinFBE.zip

Best place for exe and ini is in the WinFBE_Suite folder. A shortcut to the exe can be put onto the desktop. I have pinned a shortcut to the Win10 Start Menu.
srvaldez
Posts: 2540
Joined: Sep 25, 2005 21:54

Re: Setting gcc compiler for WinFBE

Postby srvaldez » Sep 02, 2019 1:15

thank you :-)

Return to “Windows”

Who is online

Users browsing this forum: No registered users and 5 guests