Firebird SQL 32-bit client library install on 64-bit CentOS 7

The use-case for this is wanting to run a custom 32bit utility developed in Lazarus with FreePascal, using Interbase Objects for the Firebird SQL connectivity.  (As of August 2014, IBObjects worked 32-bit for Linux but not 64-bit. That has since changed.)    This particular utility needed to be deployed on a range of 32- and 64-bit CentOS 5, 6 and 7 servers, so it seemed to make sense to figure out how to get the Firebird 32bit client library going regardless of the machine architecture.

CentOS 7 in December 2017

The "yum update" step gets all tied up in knots if you keep trying to use the EPEL6 repo, which might be the situation if you previously used EPEL6 win32 to get your Firebird client file.  You have this problem when the result of yum update lists a problem with filenames containing .el6.  Those should be .el7. locations.  

This should be all you need to switch to the latest epel-release repositories for CentOS 7:

yum remove epel-release
yum install epel-release

I went to the https://pkgs.org/download/libfbclient collection of links for the Firebird client packages, hunting for ways to install a 32bit version.  I found the latest file with i386 in the name.  I tried many things but this is what worked. 

I downloaded the RPM to an Ubuntu system, where it could be easily be opened and viewed with the Archive Manager.  In the /usr/lib folder of the .rpm, I found the single file required, libfbclient.so  (for i386).  I put this file onto one of my public servers, renamed it with _lin32 on the end, and then used wget to bring it to the real target machines (which are non-gui, just terminal, no gnome).

wget http://data.rubicon.href.com/FirebirdSQL_Client/libfbclient.so.2.5.7_lin32

I then renamed it again to remove the suffix.  

mv libfbclient.so.2.5.7_lin32  libfbclient.so
ls /usr/lib/libfb* -l




CentOS 6 in August 2014

CentOS 6 works with the EPEL 6 Firebird installers.

Note: if you are not running as root then you will need to add 'sudo' to the beginning of most commands.

There are two hurdles.  The first is getting 32bit libc etc libraries to enable any FreePascal code to execute.  The second hurdle is getting a set of 32bit shared object files even though the machine architecture is 64bit.

To start, check whether you already have an EPEL repo file.  If not, create it.

# vi /etc/yum.repos.d/epel.repo

Here are the file contents to be added (with no guarantee that this is the absolute best GPGKEY -- it works -- might not be best one):

[EPEL32]
name=Extra Packages for Enterprise Linux 32bit
baseurl=http://dl.fedoraproject.org/pub/epel/6/i386/
gpgkey=http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6 

Then you can easily install a 32bit version of glibc 

# yum install glibc.i686

Then check for the latest available libfbclient.   On 14-Aug-2014, firebird-libfbclient-2.5.3.26778.0-1.el6.i686 was available (but in July 2016, epel/6/x86_64 is here for 64bit on fedoraproject.orgs ); I used this yum install syntax in 2014:

# yum install firebird-libfbclient-2.5.3.26778.0-1.el6.i686



CentOS 6 in 2016

I used this yum install syntax in November 2016, to get the 32bit Firebird client files onto a CentOS 64-bit server:

# yum install firebird-libfbclient-2.5.5.26952.0-2.el6.i686 

(Reminder: always drop the .rpm extension  from what you see listed on fedoraproject.org when you want to yum install the package )


To make sure the necessary files have arrived, look in /usr/lib

# cd /usr/lib
# ls libfb*

You should see 2 libfbclient shared object files.  (Linux SO Shared Objects are like Windows Dynamic Link Library DLL files).

Then, for programs compiled with Free Pascal, you need a symbolic link so that the executable can find the shared object.

# ln /usr/lib/libfbclient.so.2 /usr/lib/libfbclient.so

Hope that works for you as well as it did for me.

PS. Some more follow-up.  If the Firebird client is automatically updated, the symbolic link becomes obsolete.  It shows in red (on my system) when doing a file listing with ls -l.  This can be fixed if you know the name of the latest shared object file for Firebird.  In July 2016, this syntax with -sfn worked to change the symbolic link:

# ln -sfn /usr/lib/libfbclient.so.2.5.5 /usr/lib/libfbclient.so






Comments

Popular Posts