FreeBASIC 1.08 Development
FreeBASIC 1.08 Development
Development on fbc 1.08.0 started around September 2019.
I would like to use this topic to help concentrate discussions related to fbc 1.08 development. Sometimes the conversations and discussions can get spread out all over the forums and it's tough to keep track. So if there is a another topic about development, it can be linked from here.
For discussions on bugs / development, there is also:
Issue tracker on github: https://github.com/freebasic/fbc/issues
Bug tracker on sourceforge.net: https://sourceforge.net/p/fbc/bugs/
For discussion on the 1.07.1 release see: FreeBASIC 1.07.1 Release Discussion
I would like to use this topic to help concentrate discussions related to fbc 1.08 development. Sometimes the conversations and discussions can get spread out all over the forums and it's tough to keep track. So if there is a another topic about development, it can be linked from here.
For discussions on bugs / development, there is also:
Issue tracker on github: https://github.com/freebasic/fbc/issues
Bug tracker on sourceforge.net: https://sourceforge.net/p/fbc/bugs/
For discussion on the 1.07.1 release see: FreeBASIC 1.07.1 Release Discussion
Re: FreeBASIC 1.08 Development
I don't know if it's of any importance, but some recent commit on master broke the TDM-GCC build.
Code: Select all
CC src/rtlib/obj/win32/file_htruncate.o
In file included from src/rtlib/win32/file_htruncate.c:4:0:
d:\tdm-gcc-32\include\unistd.h:41:20: error: unknown type name 'off_t'
int ftruncate(int, off_t);
Re: FreeBASIC 1.08 Development
Sorry, I have not tested with TDM tool chain in ages. Looks like 'ftruncate' in unistd.h refers to 'off_t' when it should refer to '_off_t'. Normally, unistd.h <= io.h <= sys/types.h, would define 'off_t', but we prefer non-old-names so it only gets defined as '_off_t'. Changing the declaration in unistd.h to '_off_t' should fix it.
Wondering if should not even try to use ftruncate/ftruncate64 on windows toolchains, and just call windows API SetEndOfFile, only.
Wondering if should not even try to use ftruncate/ftruncate64 on windows toolchains, and just call windows API SetEndOfFile, only.
Re: FreeBASIC 1.08 Development
To catch everybody up on changes made this month:
- __FB_BUILD_ISO_DATE__ and __FB_BUILD_SHA1__ added, discussion at __FB_BUILD_DATE__ should be changed to ISO-Date
- Exposing the fb's internal array descriptor added, discussion at Array Descriptor (Split from Wiki Improvements)
- extern "rtlib" added, with example at extern "rtlib"
- FileFlush & FileSetEof functions (only in ./inc/file.bi) added. Discussion at FileFlush and FileTruncate functions #178. FileTruncate soon to be renamed FileSetEof.
- sf.net #904; gcc backend: pass '-Wno-format' to prevent format string errors in gcc 9.x (enabled by default with -Wall)
- sf.net #910: cast(string, variable) can cause fbc to segfault (infinite recursion), due to misplaced const & non-const casting, from the discussion at fb 1.07 tests
Re: FreeBASIC 1.08 Development
Compiling Git Cloned 1.08 on OpenSUSE Leap 15.1 x86_64
PROBLEM:
WhoMeYeahYou:~/dev/fbc> make
mkdir -p src/compiler/obj/linux-x86_64
FBC src/compiler/obj/linux-x86_64/ast-gosub.o
fbc: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
make: *** [makefile:576: src/compiler/obj/linux-x86_64/ast-gosub.o] Error 127
SOLUTION:
WhoMeYeahYou:~/dev/fbc> sudo zypper in libncurses5
There are symlink workarounds for the libtinfo.so.5 problem but it would be simpler if libncurses5 is added to the OpenSUSE Installing development packages section of the Compiling FB on Linux page of the FBWiki at
https://www.freebasic.net/wiki/wikka.ph ... BuildLinux
Also under the OpenSUSE Installing development packages section the line
libffi48-devel
should be changed to
libffi-devel
I had the same problem with libtinfo.so.5 when compiling 1.08 on Kubuntu Eoan Ermine 19.10 x86_64 but
sudo apt-get install libtinfo5
solved the problem, so maybe
libtinfo5
could be added to the Debian-based systems (including Ubuntu, Mint etc.): Installing development packages section of the Compiling FB on Linux page of the FBWiki
PROBLEM:
WhoMeYeahYou:~/dev/fbc> make
mkdir -p src/compiler/obj/linux-x86_64
FBC src/compiler/obj/linux-x86_64/ast-gosub.o
fbc: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
make: *** [makefile:576: src/compiler/obj/linux-x86_64/ast-gosub.o] Error 127
SOLUTION:
WhoMeYeahYou:~/dev/fbc> sudo zypper in libncurses5
There are symlink workarounds for the libtinfo.so.5 problem but it would be simpler if libncurses5 is added to the OpenSUSE Installing development packages section of the Compiling FB on Linux page of the FBWiki at
https://www.freebasic.net/wiki/wikka.ph ... BuildLinux
Also under the OpenSUSE Installing development packages section the line
libffi48-devel
should be changed to
libffi-devel
I had the same problem with libtinfo.so.5 when compiling 1.08 on Kubuntu Eoan Ermine 19.10 x86_64 but
sudo apt-get install libtinfo5
solved the problem, so maybe
libtinfo5
could be added to the Debian-based systems (including Ubuntu, Mint etc.): Installing development packages section of the Compiling FB on Linux page of the FBWiki
Re: FreeBASIC 1.08 Development
This seems to be a common problem. Yeah, I usually just fix with a symlink...lazy, I know.robert wrote:fbc: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
Sorry, I don't have any experience with OpenSUSE. If I understand correctly, 'ncurses-devel' is listed but this command must be run also? Or should 'libncurses5' be added to the list of OpenSUSE packages?WhoMeYeahYou:~/dev/fbc> sudo zypper in libncurses5
OK, done.should be changed to
libffi-devel
Should this be "-dev" package? Maybe add separate list for Kubuntu?I had the same problem with libtinfo.so.5 when compiling 1.08 on Kubuntu Eoan Ermine 19.10 x86_64 but
sudo apt-get install libtinfo5
robert, thanks for your feedback.
Re: FreeBASIC 1.08 Development
OK, I applied a change that should fix this. I did not install TDM and test. For the windows toolchains, not using unistd.h at all now. And left some notes in the source.St_W wrote:I don't know if it's of any importance, but some recent commit on master broke the TDM-GCC build.
Re: FreeBASIC 1.08 Development
Documentation added:changelog.txt wrote:- rtlib: inc/file.bi:FileFlush() function, usable for file, PIPE, CONS, and ERR streams opened for BINARY, RANDOM, OUTPUT, APPEND.
- rtlib: inc/file.bi;FileTruncate() function
- FILESETEOF
- FILEFLUSH
Re: FreeBASIC 1.08 Development
To avoid having to make a symlink on OpenSUSE, 'libncurses5' should be added to the list of OpenSUSE packages.coderJeff wrote:This seems to be a common problem. Yeah, I usually just fix with a symlink...lazy, I know.robert wrote:fbc: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
Sorry, I don't have any experience with OpenSUSE. If I understand correctly, 'ncurses-devel' is listed but this command must be run also? Or should 'libncurses5' be added to the list of OpenSUSE packages?WhoMeYeahYou:~/dev/fbc> sudo zypper in libncurses5
OK, done.should be changed to
libffi-devel
Should this be "-dev" package? Maybe add separate list for Kubuntu?I had the same problem with libtinfo.so.5 when compiling 1.08 on Kubuntu Eoan Ermine 19.10 x86_64 but
sudo apt-get install libtinfo5
robert, thanks for your feedback.
At the bottom of the FBWiki page at
https://www.freebasic.net/wiki/wikka.ph ... Installing
there is a note, concerning the libtinfo.so.5 issue, (which I'm sure has wrecked more than one noobie's compilation ambitions) titled
Compiling under Ubuntu 10.04 LTS, 64-bit:
which indicates to me that the libtinfo.so.5 missing problem on Ubuntu goes back to at least Lucid (10.04 LTS) which came out nine years ago. So to avoid having to make a symlink on Ubuntu variants, 'libtinfo5' should be added to the list of Ubuntu etc packages. Maybe Debian doesn't have the problem. All the flavours and versions derived from Debian make a real rat's nest of possibilities.
This note, concerning the libtinfo.so.5 issue, is not found on the Compiling FB on Linux page at
https://www.freebasic.net/wiki/wikka.ph ... BuildLinux
Noobies, do not despair. Even people using CERN's data analytics couldn't figure it out and had to ask for help. See
https://root-forum.cern.ch/t/cannot-loa ... 04-2/33195
Ubuntu 19.10 is due for release on October 17, 2019.
Re: FreeBASIC 1.08 Development
re TDM: build works again, thank you.
re new file functions: any reason why the function is called fileTruncate in the changelog and fileSetEOF in the wiki?
re new file functions: any reason why the function is called fileTruncate in the changelog and fileSetEOF in the wiki?
Re: FreeBASIC 1.08 Development
Is there any chance that audio support could be added, in this version, as it has been discussed on https://freebasic.net/forum/viewtopic.php?f=17&t=26256 ?
Re: FreeBASIC 1.08 Development
@robert, I believe I have added the needed notes to wiki documentation regarding libtinfo/libncurses for installing and building fbc. You are welcome to change as needed.
If I understand a little of this issue: libncurses and libncursesw both need libtinfo functionality, but libtinfo may or may not be separate library. Some lInux distros have the libtinfo package available for install, but only serves to install a symlink to ncurses. However, if the package dependencies are correct, then all dependencies should get installed when installing ncurses-dev, which includes libtinfo-dev, which may be a library or a just symlink.
If I understand a little of this issue: libncurses and libncursesw both need libtinfo functionality, but libtinfo may or may not be separate library. Some lInux distros have the libtinfo package available for install, but only serves to install a symlink to ncurses. However, if the package dependencies are correct, then all dependencies should get installed when installing ncurses-dev, which includes libtinfo-dev, which may be a library or a just symlink.
Re: FreeBASIC 1.08 Development
Name was changed. Should read FileSetEof() in fbc/master now. Thanks.St_W wrote:re new file functions: any reason why the function is called fileTruncate in the changelog and fileSetEOF in the wiki?
Re: FreeBASIC 1.08 Development
I had a quick look at the library source only. Looks like a pretty good start. I will follow-up there.angros47 wrote:Is there any chance that audio support could be added, in this version, as it has been discussed on https://freebasic.net/forum/viewtopic.php?f=17&t=26256 ?
Re: FreeBASIC 1.08 Development
This weekend I took the time to update a few bindings (headers for 3rd party libraries) shipped with FreeBasic. Luckily dkl has provided us a great tool which drastically simplifies binding creation called "fbfrog" (https://github.com/dkl/fbfrog). Beside that there's a repository with fbfrog configuration files and additional scripts to automate the binding creation for many common libraries (https://github.com/dkl/fbbindings). As dkl stopped working on FreeBasic these repositories are unmaintained, but (in my consideration) still very valuable for FreeBasic.
What about making these two repositories/projects official FreeBasic projects? Which would involve
- having them maintained by the https://github.com/freebasic user
- FreeBasic dev team managing pull requests for those projects
This would allow a simplified maintenance of the bindings and other FB users could easily provide their own or help updating. Everything one needs to do to update a binding that already exists in the fbbindings repository is to
- update the makefile to download the latest version of the C headers
- repeat: run the fbfrog tool & manually review results & update the fbfrog configuration if needed; until headers look fine
- test binding (e.g. compile & run example application (ideally on different platforms)) and apply fixes to fbfrog config (preferable) or manually (if needed)
- submit a PR for the fbbindings repo with the updated configurations and headers
What about making these two repositories/projects official FreeBasic projects? Which would involve
- having them maintained by the https://github.com/freebasic user
- FreeBasic dev team managing pull requests for those projects
This would allow a simplified maintenance of the bindings and other FB users could easily provide their own or help updating. Everything one needs to do to update a binding that already exists in the fbbindings repository is to
- update the makefile to download the latest version of the C headers
- repeat: run the fbfrog tool & manually review results & update the fbfrog configuration if needed; until headers look fine
- test binding (e.g. compile & run example application (ideally on different platforms)) and apply fixes to fbfrog config (preferable) or manually (if needed)
- submit a PR for the fbbindings repo with the updated configurations and headers