Both fbc32 and fbc64 on 64-bit Ubuntu (not a question)

Linux specific questions.
Post Reply
badidea
Posts: 2586
Joined: May 24, 2007 22:10
Location: The Netherlands

Both fbc32 and fbc64 on 64-bit Ubuntu (not a question)

Post by badidea »

This is not a question, but a remark. Might be obvious for some, but a useful for others. Also, this might have been documented or posted somewhere before.

On a 64-bit Linux installation, one can install both 32-bit and 64-bit FreeBASIC, however not both of them at the same time when following the default installation instructions (sudo ./install.sh -i) in the 'readme.txt' file that comes with the download.
Having both installed is a good thing for testing your code (e.g. before posting on the forum).

One can optionally specify the installation path with './install.sh -i [prefix]' (install FB into prefix directory).
What I did instead was:
* Run the default 32-bit install (sudo ./install.sh -i)
* Rename the 'fbc' executable to 'fbc32' (sudo mv /usr/local/bin/fbc /usr/local/bin/fbc32)
* Run the default 64-bit install (sudo ./install.sh -i)
* Rename the 'fbc' executable to 'fbc64' (sudo mv /usr/local/bin/fbc /usr/local/bin/fbc64)
In addition, the proper libraries need to be present or installed (see 'readme.txt').

Now I have both versions working:

Code: Select all

badidea@laptop:~$ ls -l /usr/local/bin/fb*
-rwxr-xr-x 1 root root 1186648 Jan 26  2016 /usr/local/bin/fbc32
-rwxr-xr-x 1 root root 1883968 May  4 23:12 /usr/local/bin/fbc64

badidea@laptop:~$ fbc32 --version
FreeBASIC Compiler - Version 1.05.0 (01-31-2016), built for linux-x86 (32bit)
Copyright (C) 2004-2016 The FreeBASIC development team.

badidea@laptop:~$ fbc64 --version
FreeBASIC Compiler - Version 1.05.0 (01-31-2016), built for linux-x86_64 (64bit)
Copyright (C) 2004-2016 The FreeBASIC development team.
The 'include files' (in /usr/local/include/freebasic/) are probably overwritten on second install, but I assume they are equal (for fbc32 and fbc64).
The 'library files' (in /usr/local/lib/freebasic/) are installed each in there own sub-directory (linux-x86/ and linux-x86_64/), so no problem there as well.
Where the 'example files' on Linux go, I don't know. At least still in my unzipped downloads, which is ok.

Let me know if this way of installing fbc 32-bit and 64-bit together is unwise. So far, it seems to work fine.
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: Both fbc32 and fbc64 on 64-bit Ubuntu (not a question)

Post by lizard »

badidea wrote:Let me know if this way of installing fbc 32-bit and 64-bit together is unwise. So far, it seems to work fine.
I cant see why this would be unwise. If it works for you, why not. On the other hand one may wish to test if the compiled 32-bit programs work on both, a pure 32-bit distro, too.

So i did it that way i have all on one HD:

Windows

Linux Mint 18.3 Xfce 64-bit

Linux Mint 18.2 Cinnamon 32-bit (because i already had the live-dvd ready burned)

Further distros

Each on an own partition. Chooseable with bootloader. i can reach my own .bas files on a separate 4,7 GB ntfs partition that can be reached from Linux and Windows. This then can be burned on dvd.

For the dependencies apt-get installs the same libraries. They work on both, 32 and 64 bit. Don `t know how Ubuntu realizes that. Like most things in Linux. You feel like swimming in a sea of troubles. But if one takes the known routes, it is likely to survive the next years. :-)
dkl
Site Admin
Posts: 3235
Joined: Jul 28, 2005 14:45
Location: Germany

Re: Both fbc32 and fbc64 on 64-bit Ubuntu (not a question)

Post by dkl »

It's nice to see this being used/noticed, because it was intended to work this way. Parallel installation of libraries for easy cross-compiling, and shared headers.

Also a note that's interesting for fbc development: The commands "fbc32 -arch 64" and "fbc64", aswell as "fbc64 -arch 32" and "fbc32", should generate the same code when compiling some project, otherwise there is a bug with cross-compiling.
Post Reply