Netglub

Really Open Source Information Gathering

How to compile the master

No Comments »

Translate original post with Google Translate

Only available on GNU Linux distributions.

step 1 : Prerequisites

The sources are not available yet

Mandatory Dependencies and package needed

Some package are mandatory to compile and run the master :

  • build-essential
  • mysql-server ( see step 2 )
  • libmysqlclient16-dev
sudo aptitude install build-essential mysql-server libmysqlclient16-dev

Step 2 : Install Database.

Netglub master use a mysql database. a file containing all the tables is available in the package.
Location :

@Netglub_location)/trunk/master/tools/sql/netglub.sql 

The user that will be used must have all right in this database.

In the following hint, we create a database named netglub with user netglub (password : netglub)

bash~$ mysql -u (@MYSQL_USER_NAME (root)) -p(@MYSQL_PASSWORD)
mysql> create database netglub;
mysql> use netglub;
mysql> create user "netglub"@"localhost";
mysql> set password for "netglub"@"localhost" = password("netglub");
mysql> GRANT ALL ON netglub.* TO "netglub"@"localhost";
mysql> quit
bash~$ mysql -u (@MYSQL_USER_NAME (root)) -p(@MYSQL_PASSWORD) netglub < (@Netglub_location)/trunk/master/tools/sql/netglub.sql
Now the database is available.

Step 3 : Qt framework install

The master depend on Qt framework (version 4.6 at least).

Actually, the latest release of Qt framework is the 4.6.3. The packages available on Ubuntu official repository being too old, two solutions may be used :

First Solution: Install Qt SDK.

You can download the 64bit version of Qt SDK at http://qt.nokia.com/downloads/sdk-linux-x11-64bit-cpp or download it from our local mirror (private link). netglub master can be used on a 32bit processor too, if you made this choose, you should dowload the Qt SDK 32bit version http://get.qt.nokia.com/qtsdk/qt-sdk-linux-x86-opensource-2010.03.bin or dirrectly here (private link)

The SDK take up more disk space than compiling Qt sources, but it contains a inary version of Qt libraries which avoid a complete compile. Furthermore, the compilation is trivial via graphical wizard.

wget http://get.qt.nokia.com/qtsdk/qt-sdk-linux-x86_64-opensource-2010.03.bin
chmod +x qt-sdk-linux-x86_64-opensource-2010.03.bin
./qt-sdk-linux-x86_64-opensource-2010.03.bin

Second solution : Compiling Qt Sources

the first solution is recomended

This solution, more laborious, is to download the Qt source (http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src -4.6.3.tar.gz) and to make yourself compile it

sudo aptitude install libxq11-dev libxext-dev
tar xf qt-everywhere-opensource-src-4.6.3.tar.gz
cd qt-everywhere-opensource-src-4.6.3 cd qt-everywhere-opensource-src-4.6.3
./configure -opensource -fast -nomake examples -nomake demos -qt-sql-mysql -plugin-sql-mysql
make
sudo make install
To compile Qt in debug mode :

 ./configure -opensource -fast -nomake examples -nomake demos -debug -no-separate-debug-info

Getting mysql to work :

The mysql plugins are not included in the sdk you may need some help to instal it :

if you have compiled the sources, you may not need the following (if you installed the mysql plugins.)
cd (@Qt)/qt/src/plugins/sqldrivers/mysql
qmake (qmake is locate in the bin directory of qt)
make
You may have some problems to detects mysql headers, if it's the case, you can force a path to this headers :
qmake INCLUDEPATH+=(@mysql_headers_path) ex: qmake INCLUDEPATH+=/usr/include/mysql/
then retry make.
cp libqsqlmysql.so ../../../../plugins/sqldrivers/
  or cp libqsqlmysql.so (@Qt)/qt/plugins/sqldrivers/
Now, Qt is installed, you can begin the master install.

step 4 : install the master :

you can now compile the master :

cd (@netglub_location)/master
qmake
make

to finish the instalation :

cd tools
sudo ./install.sh

to launch the master :

./(@netglub_location)/master/tools/netglub_master start
the master will automaticaly start at each boot.
You can tip :
sudo ./master -h
for help
If you want to change some configuration, you can change the file
(@netglub_location)/master/tools/master.conf
and launch install.sh again.

Leave a Reply