Friday, February 18, 2011

LD_LIBRARY_PATH: how to make sure nelwy installed binaries' locations are a part of the LD_LIBRARY_PATH

This was on a Suse Linux 11 64 bit machine.

I installed two thridparty softwares freetds and unixodbc. After the customary installation steps of unixodbc. I installed freetds with the following set of commands

./configure --with-unixodbc=/usr/local
make
make install

Both the softwares generated a few so files and placed it under /usr/local/lib ( could be lib64 as well). If it places in lib64 , then you will not need to worry about the next few steps. However in my case the binaries were put into /usr/local/lib

To make the binaries available in the LD_LIBRARY_PATH, I followed the below steps

vi /etc/ld.so.conf; add /usr/local/lib i.e: the path where both freetds and unixodbc binaries are installed
ldconfig ; this is run to include the newly added lib path into the LD_LIBRARY_PATH
ldconfig -p | grep libtdsodb; to check if I will be able to find the newly added nbinaries eg: libtdsodb using the LD_LIBRARY_PATH set by the system

Just to check if my database connections were working

cp *.ini /usr/local/etc/ ; these ini's are pre configured with the database ip addresses and the

connection details
To test if DB connects, use the below command

isql -v MSSQLTestServer sa admin
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>

No comments:

Post a Comment