FreeBASIC-win-gcc-11-20200517

Windows specific questions.
srvaldez
Posts: 2578
Joined: Sep 25, 2005 21:54

FreeBASIC-win-gcc-11-20200517

Postby srvaldez » May 12, 2020 11:15

here's FreeBASIC-1.07.1 and 1.08.0 built with the work-in-progress gcc-11
all FB versions built with Equation's toolchains are faulty at interpreting the command line
I just noticed this today while trying to build FBfrog, cd into the src folder and then do fbc *.bas -m fbfrog
you will probably get something like *.bas() error 23: File not found, *.bas
I have removed all the faulty versions from GitHub
the bad versions are gcc 7.4, 8.3, 9.2, 10 and 11
Last edited by srvaldez on Jun 03, 2020 23:21, edited 6 times in total.
deltarho[1859]
Posts: 2756
Joined: Jan 02, 2017 0:34
Location: UK

Re: FreeBASIC-1.08.0-win-gcc-11-20200510

Postby deltarho[1859] » May 12, 2020 12:52

Great stuff, srvaldez.

From FB's perspective I think that gcc 8.3 is the one to beat. I look forward to equation.com upping the ante to 8.4.
UEZ
Posts: 665
Joined: May 05, 2017 19:59
Location: Germany

Re: FreeBASIC-1.08.0-win-gcc-11-20200510

Postby UEZ » May 12, 2020 12:58

srvaldez wrote:here's FreeBASIC-1.08 built with the work-in-progress gcc-11
I also included the latest binutils and gendef so you will have the tools to build import libs
the packages are smaller than that of gcc-10
FreeBASIC-1.08.0-win32-gcc-11.7z
FreeBASIC-1.08.0-win64-gcc-11.7z

Thanks for v11.

I made a quick benchmark test with lines and v11 seems to be the fastest on using x64 and some compile options. For x86 v7.4 is the fastest.
deltarho[1859]
Posts: 2756
Joined: Jan 02, 2017 0:34
Location: UK

Re: FreeBASIC-1.08.0-win-gcc-11-20200510

Postby deltarho[1859] » May 12, 2020 13:56

The problem with benchmarking tests is that the results tell us which 'product' is the most likely to be the fastest. What they do not tell us is which 'product' will be the fastest for a particular application. The only way to do that is to test each 'product' on a particular application.
Arachnophilia
Posts: 7
Joined: Sep 04, 2015 13:33

Re: FreeBASIC-1.08.0-win-gcc-11-20200510

Postby Arachnophilia » May 12, 2020 18:07

hi srvaldez

thank you for taking the trouble to upgrade to gcc v11x. It works very well for me so far.
I had updated it on my computer some time ago, but it was very tedious to copy the files into the right directories. Maybe I was just too cumbersome.
Thanks again.
srvaldez
Posts: 2578
Joined: Sep 25, 2005 21:54

Re: FreeBASIC-1.08.0-win-gcc-11-20200510

Postby srvaldez » May 12, 2020 18:29

hello Arachnophilia
thanks for the feedback, as far as copying all the files into the right directories, the make script does it for you, I will revise my notes on how to build FB on Windows using Msys2 and post it here when ready
srvaldez
Posts: 2578
Joined: Sep 25, 2005 21:54

Re: FreeBASIC-1.08.0-win-gcc-11-20200510

Postby srvaldez » May 12, 2020 20:06

here's basically what I do to build FB
I hope I didn't make any mistakes in writing down the instructions
========================================================
Download a mingw distribution and set up a bash shell
The only solution that I found is by using msys2, note that in this example, we copy a mingw distribution that's not part of msys2, therefore, it's not intended to be updated by using pacman.

I am assuming that msys2 will be installed in C:\msys64, which is the default.

First download msys2 https://sourceforge.net/projects/msys2/ ... e/download

Download the gcc toolchain version of your choice, in this example it's version 7.3.0
Download the 32-bit gcc toolchain 7.3.0 https://sourceforge.net/projects/mingw- ... v5-rev0.7z

Download the 64-bit gcc toolchain 7.3.0 https://sourceforge.net/projects/mingw- ... v5-rev0.7z

Install msys2

after installing msys2 do the following From the msys64 shell
pacman -Syu
pacman -S make
pacman -S patch
pacman -S git
pacman -S zip
pacman -S p7zip

Extract i686-7.3.0-release-win32-sjlj-rt_v5-rev0.7z into the msys64 folder
Extract x86_64-7.3.0-release-win32-sjlj-rt_v5-rev0.7z into the msys64 folder

Copy C:\msys64\mingw32\opt\lib\libffi-3.2.1\include\ffi.h into C:\msys64\mingw32\i686-w64-mingw32\include
Copy C:\msys64\mingw32\opt\lib\libffi-3.2.1\include\ffitarget.h into C:\msys64\mingw32\i686-w64-mingw32\include
Copy C:\msys64\mingw64\opt\lib\libffi-3.2.1\include\ffi.h into C:\msys64\mingw64\x86_64-w64-mingw32\include
Copy C:\msys64\mingw64\opt\lib\libffi-3.2.1\include\ffitarget.h into C:\msys64\mingw64\x86_64-w64-mingw32\include

download FB 32-bit https://downloads.sourceforge.net/fbc/f ... z?download
right-click on the archive -> 7-zip -> open archive
double-click on the fbc folder then selectct the bin, include and lib folders and drag&drop them into C:\msys64\mingw32

download FB 64-bit https://downloads.sourceforge.net/fbc/f ... z?download
right-click on the archive -> 7-zip -> open archive
double-click on the fbc folder then selectct the bin, include and lib folders and drag&drop them into C:\msys64\mingw64

=========================================================================================================

at this point you are ready to build FB, the first thing I do is build FB with the current toolchain and replace it, I do it twise
download the FB source by going to https://github.com/freebasic/fbc with your web browser and download
after extracting the archive
launch mingw32.exe and cd into fbc-master
make rtlib
rm /c/msys64/mingw32/lib/freebasic/win32/*
cp lib/freebasic/win32/* /c/msys64/mingw32/lib/freebasic/win32
make
cp lib/freebasic/win32/* /c/msys64/mingw32/lib/freebasic/win32
cp bin/fbc.exe /c/msys64/mingw32/bin
make clean
make
cp bin/fbc.exe /c/msys64/mingw32/bin
cp -R tests tests2
make unit-tests GEN=gas
make log-tests GEN=gas
if all the tests passed, delete the test folder and rename the folder test2 to test, then
make unit-tests GEN=gcc
make log-tests GEN=gcc
make clean

if all the tests passed you are ready to build the windows standalone version

Open a new document in notepad and add the following text
ENABLE_STANDALONE=1
Save As "config.mk" into the folder fbc-master

Now go back to mingw32.exe and type

make
cd lib/win32
make
cd ../..
make mingw-libs

mkdir -p bin/win32
wget http://www.godevtool.com/Gorc.zip
7z e Gorc.zip
cp GoRC.exe bin/win32

cp /c/msys64/mingw32/bin/ar.exe bin/win32
cp /c/msys64/mingw32/bin/as.exe bin/win32
cp /c/msys64/mingw32/bin/dlltool.exe bin/win32
cp /c/msys64/mingw32/bin/gcc.exe bin/win32
cp /c/msys64/mingw32/bin/gdb.exe bin/win32
cp /c/msys64/mingw32/bin/gprof.exe bin/win32
cp /c/msys64/mingw32/bin/ld.exe bin/win32
cp -R /c/msys64/mingw32/libexec bin

cleanup libexec by deleting all except cc1.exe, then from the shell
============================================
almost forgot that for this toolchain you also need to copy libgcc_s_dw2-1.dll and zlib1.dll into the bin\win32 folder before you make bindist
the toolchain from Equation is free of dll dependencies

at this point I run the test suits as before and if all is well then

make bindist

======================================================================================================
build fbc-64bit
Rename fbc-master to fbc-master32
extract fbc-master again to have a clean copy

launch mingw64.exe and cd into fbc-master
make rtlib
rm /c/msys64/mingw64/lib/freebasic/win64/*
cp lib/freebasic/win64/* /c/msys64/mingw64/lib/freebasic/win64
make
cp lib/freebasic/win64/* /c/msys64/mingw64/lib/freebasic/win64
cp bin/fbc.exe /c/msys64/mingw64/bin
make clean
make
cp bin/fbc.exe /c/msys64/mingw64/bin
make unit-tests GEN=gcc
make log-tests GEN=gcc
make clean

if all the tests passed you are ready to build the windows standalone version

copy config.mk from fbc-master32 to fbc-master

make
make mingw-libs
mkdir -p bin/win64

copy GoRC.exe from fbc-master32 to fbc-master\bin\win64

cp /c/msys64/mingw64/bin/ar.exe bin/win64
cp /c/msys64/mingw64/bin/as.exe bin/win64
cp /c/msys64/mingw64/bin/dlltool.exe bin/win64
cp /c/msys64/mingw64/bin/gcc.exe bin/win64
cp /c/msys64/mingw64/bin/gdb.exe bin/win64
cp /c/msys64/mingw64/bin/gprof.exe bin/win64
cp /c/msys64/mingw64/bin/ld.exe bin/win64
cp -R /c/msys64/mingw64/libexec bin

cleanup libexec by deleting all except cc1.exe, then from the shell

at this point I run the test suits as before and if all is well then

make bindist
Last edited by srvaldez on May 12, 2020 21:14, edited 5 times in total.
srvaldez
Posts: 2578
Joined: Sep 25, 2005 21:54

Re: FreeBASIC-1.08.0-win-gcc-11-20200510

Postby srvaldez » May 12, 2020 20:36

when using the toolchain from Equation http://www.equation.com/servlet/equation.cmd?fa=fortran
I first rename or delete the folders C:\msys64\mingw32 and C:\msys64\mingw64
after installing the 32-bit toolchain into C:\msys64\mingw32 and the 64-bit into C:\msys64\mingw64
there are some steps that I follow to make things work
I copy the latest binutils into C:\msys64\mingw32\bin and C:\msys64\mingw64\bin respectively
copy C:\msys64\usr\bin\make.exe into C:\msys64\mingw32\bin and C:\msys64\mingw64\bin
download libffi from https://sourceware.org/libffi/ and extract
using mingw32.exe cd into the extracted folder
./configure --build=i686-pc-mingw32 --host=i686-pc-mingw32 --target=i686-pc-mingw32
make
copy the include files from libffi-3.3\i686-pc-mingw32\include into C:\msys64\mingw32\i686-pc-mingw32\include
copy also the libs if you want into the respective lib folder
delete libffi-3.3 and extract the archive again
using mingw64.exe cd into the extracted folder
./configure
make
copy the include files from libffi-3.3\x86_64-pc-mingw64\include into C:\msys64\mingw64\x86_64-w64-mingw32\include
copy also the libs if you want into the respective lib folder

copy fbc and associated files/folders into the respective folders
now you are ready to build FB
deltarho[1859]
Posts: 2756
Joined: Jan 02, 2017 0:34
Location: UK

Re: FreeBASIC-1.08.0-win-gcc-11-20200510

Postby deltarho[1859] » May 12, 2020 21:22

@srvaldez

It seems to me that your last two posts are indicative of a particular mindset, and we should be very grateful that you, and only a few others at FB, have it. I, for one, would not dream of contemplating such ventures and that has nothing to do with age - I would not have ventured so, forty years ago.

Absolutely well done, you have my full respect.
srvaldez
Posts: 2578
Joined: Sep 25, 2005 21:54

Re: FreeBASIC-1.08.0-win-gcc-11-20200510

Postby srvaldez » May 12, 2020 21:42

@deltarho[1859]
thank you for the kind words :smile:
deltarho[1859]
Posts: 2756
Joined: Jan 02, 2017 0:34
Location: UK

Re: FreeBASIC-1.08.0-win-gcc-11-20200510

Postby deltarho[1859] » May 12, 2020 21:55

@srvaldez

I don't know about being kind. I don't have many mantras but one is simply: "If credit is due then give it."
srvaldez
Posts: 2578
Joined: Sep 25, 2005 21:54

Re: FreeBASIC-1.07.1-win-gcc-11-20200517

Postby srvaldez » May 19, 2020 21:30

updated
Arachnophilia
Posts: 7
Joined: Sep 04, 2015 13:33

Re: FreeBASIC-1.07.1-win-gcc-11-20200517

Postby Arachnophilia » May 23, 2020 12:48

srvaldez wrote:updated


Hello srvaldez

thank you for the update!
srvaldez
Posts: 2578
Joined: Sep 25, 2005 21:54

Re: FreeBASIC-win-gcc-11-20200517

Postby srvaldez » Jun 03, 2020 23:21

all FB versions built with Equation's toolchains are faulty at interpreting the command line
I just noticed this today while trying to build FBfrog, cd into the src folder and then do fbc *.bas -m fbfrog
you will probably get something like *.bas() error 23: File not found, *.bas
I have removed all the faulty versions from GitHub
the bad versions are gcc 7.4, 8.3, 9.2, 10 and 11
deltarho[1859]
Posts: 2756
Joined: Jan 02, 2017 0:34
Location: UK

Re: FreeBASIC-win-gcc-11-20200517

Postby deltarho[1859] » Jun 03, 2020 23:35

So, why is it that I have been using 8.3 since it was first published without any apparent issues?

Return to “Windows”

Who is online

Users browsing this forum: No registered users and 6 guests