Tuesday, July 21, 2009

Compiling Tora from Sources

Hi folks (Still I'm not sure if anyone reads me) today in talk about Linux I'm going to show you how to compile Tora mostly focused in Slackware 12.2 but also for Ubuntu 9.04 (Ubuntu as well)

Tora it's a really good tool for Developers and Administrators who work with Oracle under Linux. To start we need to download sources from here http://sourceforge.net I'm focusing in Tora 1.3.23 and previous versions, I'm testing version 2.0 without success yet.

PRE-REQUISITES
When I compile from sources I usually do that as Super User in a terminal, so for Slackware use
# su
Password:
if you are using Ubuntu use "sudo -i" to simulate initial login as super user
# sudo -i
[sudo] password for UR-USER:

For slackers we need to install QSCintilla so you should install 1.6 or 1.7 version you can download source file from http://ftp.aarnet.edu.au, uncompress it as shown below
# tar -xzvf qscintilla_1.7.1.orig.tar.gz
# cd QScintilla-1.71-gpl-1.7.1
# cd qt
# qmake qscintilla.pro
# make
# make install

To install in Ubuntu just type:
#apt-get install libqscintilla7 libqscintilla-dev
or install those files using Synaptic.

Before you do something in Ubuntu it's necessary to get basic compilers and QT development tools
# apt-get install build-essential qt3-dev-tools

In addition just for Ubuntu you should not forget to install gcc cpp and g++ packages version 4.2. if you don't do that you'll have a headache trying to compile. The good think is both 4.3 and 4.2 can be together without affect your system
# apt-get install gcc-4.2 gcc-4.2-base cpp-4.2 g++-4.2

After installing those packages you need to make a link between files in order to compile tora as shown below
# cd /usr/bin
# ln -s gcc-4.2 gcc
# ln -s cpp-4.2 cpp
# ln -s g++-4.2 g++

COMPILING TORA
In this case I'm going to compile Tora without KDE, also indicating I'm going to work with Oracle Instant Client and Installing it under /usr, so go ahead

Take your Tora source file and uncompress it
# tar -xjvf tora-1-3-end-of-life.tar.bz2
# cd tora-1-3-end-of-life
# ./configure --prefix=/usr --with-oracle=$ORACLE_HOME --with-oci-version=10G --with-instant-client --without-rpath --disable-new-check --with-qt-dir=/usr/lib/qt --without-kde --with-oracle-includes=/usr/lib/instantclient_11_1/sdk/include --with-oracle-libraries=$ORACLE_HOME --enable-libsuffix=
# make
# make install

Compile job it's done. To try your new Database administration and developer tool, open a terminal and type:
# tora

And Voilá you should be getting to work in Tora GUI



































COMMENTS:
While you are compiling sources if you get an error like that:
../ext/loki/loki-0.1.6/src/SmallObj.cpp:296: error: ‘UCHAR_MAX’ was not declared in this scope
../ext/loki/loki-0.1.6/src/SmallObj.cpp: In member function ‘bool Loki::Chunk::IsCorrupt(unsigned char, size_t, bool) const’:
../ext/loki/loki-0.1.6/src/SmallObj.cpp:428: error: ‘UCHAR_MAX’ was not declared in this scope
../ext/loki/loki-0.1.6/src/SmallObj.cpp:428: error: template argument 1 is invalid
../ext/loki/loki-0.1.6/src/SmallObj.cpp:428: error: invalid type in declaration before ‘;’ token
../ext/loki/loki-0.1.6/src/SmallObj.cpp:460: error: request for member ‘set’ in ‘foundBlocks’, which is of non-class type ‘int’
../ext/loki/loki-0.1.6/src/SmallObj.cpp:475: error: request for member ‘test’ in ‘foundBlocks’, which is of non-class type ‘int’
../ext/loki/loki-0.1.6/src/SmallObj.cpp:486: error: request for member ‘count’ in ‘foundBlocks’, which is of non-class type ‘int’
../ext/loki/loki-0.1.6/src/SmallObj.cpp: In member function ‘bool Loki::Chunk::IsBlockAvailable(void*, unsigned char, size_t) const’:
../ext/loki/loki-0.1.6/src/SmallObj.cpp:522: error: ‘UCHAR_MAX’ was not declared in this scope
../ext/loki/loki-0.1.6/src/SmallObj.cpp:522: error: template argument 1 is invalid
../ext/loki/loki-0.1.6/src/SmallObj.cpp:522: error: invalid type in declaration before ‘;’ token
../ext/loki/loki-0.1.6/src/SmallObj.cpp:527: error: request for member ‘set’ in ‘foundBlocks’, which is of non-class type ‘int’
../ext/loki/loki-0.1.6/src/SmallObj.cpp:536: error: request for member ‘test’ in ‘foundBlocks’, which is of non-class type ‘int’
make[3]: *** [tora-SmallObj.o] Error 1
make[3]: Leaving directory `/mnt/data/linux/src/tora/tora-1-3-end-of-life/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/mnt/data/linux/src/tora/tora-1-3-end-of-life/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mnt/data/linux/src/tora/tora-1-3-end-of-life'
make: *** [all] Error 2

It usually happens thanks to your compilers version, you should read prerequisites again step by step to fix that.

No comments: