FBMath update

Headers, Bindings, Libraries for use with FreeBASIC, Please include example of use to help ensure they are tested and usable.
Luxan
Posts: 222
Joined: Feb 18, 2009 12:47
Location: New Zealand

Re: FBMath update

Post by Luxan »

I'm using Ubuntu 20.04 upon an x86_64 computer.

I'm encountering some difficulty installing and then running fbmath ; what
version of FreeBasic and fbmath should I use.

Does the prepackaged Ubuntu 20.04 include fbmath ?
jdebord
Posts: 547
Joined: May 27, 2005 6:20
Location: Limoges, France
Contact:

Re: FBMath update

Post by jdebord »

I have tested with Ubuntu 22.04 and FB 1.0.9

What is your problem exactly ?

FBMath is not included in the FB distribution. You must download it from SourceForge :

sourceforge.net/projects/fbmath

Then you must recompile it for Linux. There are compilation scripts in the "modules" subfolder.
dodicat
Posts: 7976
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: FBMath update

Post by dodicat »

There is an fbmath.bi in the official distribution.
I mentioned this clash to the developers a few weeks ago, jdebord's fbmath is maths, the current fbmath.bi in the distribution comprises of random number generators only.
I think they might change the name at some point.
win 10
coderJeff
Site Admin
Posts: 4313
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: FBMath update

Post by coderJeff »

dodicat wrote: Jul 22, 2022 13:57 I mentioned this clash to the developers a few weeks ago, jdebord's fbmath is maths, the current fbmath.bi in the distribution comprises of random number generators only.
I think they might change the name at some point.
Yes, thank-you. It is already renamed in development version, It will be renamed to 'fbprng.bi' in the next release (fbc 1.10.0), since the header relates to random number generators only.
Luxan
Posts: 222
Joined: Feb 18, 2009 12:47
Location: New Zealand

Re: FBMath update

Post by Luxan »

Using

FreeBASIC-1.09.0-ubuntu-20.04-x86_64.tar.gz

with Ubuntu 20.04, x86_64, upon x86_64 computer.

Then attempting to use, separately, with various versions Fbmath, 055,
060, 066 ... by copying, with sudo, library files to usr/local/lib/freebasic/
linux-x86_64.
Also *.bi files to usr/local/include/freebasic/



Now when I attempt to compile a fbmath demo file, using Geany with
build settings :
compile fbc -w all "%f"
make make
Make Custom _Target make
Make _Object make
Execute "./%e"

An error message appears :
skipping incompatible libfbmath

and the file doesn't seem to compile to completion


Haven't attempted compilation of fbmath, within freebasic distribution directory prior
to install; is this possible with FreeBASIC-1.09.0-ubuntu-20.04-x86_64.tar.gz , or do
I require the source ; a debian package isn't usable for this.
jdebord
Posts: 547
Joined: May 27, 2005 6:20
Location: Limoges, France
Contact:

Re: FBMath update

Post by jdebord »

The libfbmath.a file included in the FBMath distribution is for Windows only. So, it's uncompatible with Linux.

You must recompile the library on Linux.

Go to the modules subfolder of the FBMath distribution and run the compil.sh script. You will obtain the correct libfbmath.a, which then must be placed in /usr/local/lib/freebasic/linux-x86_64
Luxan
Posts: 222
Joined: Feb 18, 2009 12:47
Location: New Zealand

Re: FBMath update

Post by Luxan »

What I did, to get a working version of fbmath
for Ubuntu 20.04

Downloaded
FreeBASIC-1.09.0-ubuntu-20.04-x86_64,
from
https://sourceforge.net/projects/fbc/fi ... ntu-20.04/

fbmat066.zip
from
https://sourceforge.net/projects/fbmath ... math/0.66/


Extracted both, within Downloads folder; this produced folders :

FreeBASIC-1.09.0-ubuntu-20.04-x86_64
fbmat066

Within FreeBASIC-1.09.0-ubuntu-20.04-x86_64 folder gave install.sh
permission to run as an executable script .
Using the terminal, navigating to /Downloads/FreeBASIC-1.09.0-ubuntu-20.04-x86_64
I then used the command sudo ./install.sh -i
This installed FreeBasic into usr/local/lib , usr/local/include , and
probably usr/bin

Next,I went to the Downloads/fbmat066/modules directory .
There I gave compil.sh permission to run as an executable script .
Using the terminal, navigating to /Downloads/FreeBASIC-1.09.0-ubuntu-20.04-x86_64
I then used the command sudo ./compil.sh
This installed compiled all of the files within the modules directory.
There were a lot of warnings generated, mostly relating to the now obsolete,
for more recent versions of freebasic, use of the suffix $ for various string
operations.
Using Geany, I edited all of the occurences of these; then recompiled using
the same command again sudo ./compil.sh , this produced libfbmath.a , there
were a few remaining errors about redefining a language constant which I
ignored.

Now using the terminal I used sudo nautilus , to open a file browser in
command mode.
I then copied libfbmath.a, from Downloads/fbmat066/modules
to /usr/local/lib/freebasic/linux-x86_64.
I also copied /Downloads/fbmat066/fbmath.bi and /Downloads/fbmat066/largeint.bi
to /usr/local/include/freebasic
I exited the terminal.

This now provided the fbmath library and *.bi files for the whole of Ubuntu 20.04.

Now using the standard file browser, I went to /Downloads/fbmat066/demo,
There I gave compil.sh permission to run as an executable script; right
click on file compil.sh,properties,permissions,enable
Allow executing this program.
Using the terminal, navigating to /Downloads/fbmat066/demo I then used
the command sudo ./compil.sh.
This installed compiled most of the files within the demo directory.
Again, there were warning messages about use of the suffix $ for various string
operations. And again I used Geany to edit all relevant files, recompiled using
command sudo ./compil.sh from within the same directory.
Most of the demo files there, now run by double clicking upon them from the
file browser.

Perhaps I didn't need to edit out all of the occurrences of the suffix $
in the fbmath/modules files .
Luxan
Posts: 222
Joined: Feb 18, 2009 12:47
Location: New Zealand

Re: FBMath update

Post by Luxan »

There was a mistake in the previous message, this is the
corrected version.



What I did, to get a working version of fbmath
for Ubuntu 20.04

Downloaded
FreeBASIC-1.09.0-ubuntu-20.04-x86_64,
from
https://sourceforge.net/projects/fbc/fi ... ntu-20.04/

fbmat066.zip
from
https://sourceforge.net/projects/fbmath ... math/0.66/


Extracted both, within Downloads folder; this produced folders :

FreeBASIC-1.09.0-ubuntu-20.04-x86_64
fbmat066

Within FreeBASIC-1.09.0-ubuntu-20.04-x86_64 folder gave install.sh
permission to run as an executable script .
Using the terminal, navigating to /Downloads/FreeBASIC-1.09.0-ubuntu-20.04-x86_64
I then used the command sudo ./install.sh -i
This installed FreeBasic into usr/local/lib , usr/local/include , and
probably usr/bin

Next,, using the file browser, I went to the Downloads/fbmat066/modules directory .
There I gave compil.sh permission to run as an executable script .
Using the terminal, I then went to Downloads/fbmat066/modules directory
I then used the command sudo ./compil.sh
This compiled all of the files within the modules directory.
There were a lot of warnings generated, mostly relating to the now obsolete,
for more recent versions of freebasic, use of the suffix $ for various string
operations.
Using Geany, I edited all of the occurrences of these; then recompiled using
the same command again sudo ./compil.sh , this produced libfbmath.a , there
were a few remaining errors about redefining a language constant which I
ignored.

Now using the terminal I used sudo nautilus , to open a file browser in
command mode.
I then copied libfbmath.a, from Downloads/fbmat066/modules
to /usr/local/lib/freebasic/linux-x86_64.
I also copied /Downloads/fbmat066/fbmath.bi and /Downloads/fbmat066/largeint.bi
to /usr/local/include/freebasic
I exited the terminal.

This now provided the fbmath library and *.bi files for the whole of Ubuntu 20.04.

Now using the standard file browser, I went to /Downloads/fbmat066/demo,
There I gave compil.sh permission to run as an executable script; right
click on file compil.sh,properties,permissions,enable
Allow executing this program.
Using the terminal, navigating to /Downloads/fbmat066/demo I then used
the command sudo ./compil.sh.
This compiled most of the files within the demo directory.
Again, there were warning messages about use of the suffix $ for various string
operations. And again I used Geany to edit all relevant files, recompiled using
command sudo ./compil.sh from within the same directory.
Most of the demo files there, now, run by double clicking upon them from the
file browser.

Perhaps I didn't need to edit out all of the occurrences of the suffix $
in the fbmath/modules files .
Post Reply