Project

General

Profile

Topology Manager Compilation

Get the sources

You need to have postgres development files (see Postgres installation).
You need P42, topology-generator and the topology-manager, here mercurial is your friend :

Prompt>mkdir topology-generator-lab
Prompt>mkdir topology-generator-lab/p42-dev
Prompt>mkdir topology-generator-lab/topology-generator-dev
Prompt>mkdir topology-generator-lab/topology-manager-dev
Prompt>cd topology-generator-lab/p42-dev
Prompt>hg init
Prompt>hg pull ssh:/p42-repo
Prompt>hg update
Prompt>cd ../topology-generator-dev
Prompt>hg init
Prompt>hg pull ssh:/narval-topology-generator-repo
Prompt>hg update
Prompt>cd ../topology-manager-dev
Prompt>hg init
Prompt>hg pull ssh:/topology-repo
Prompt>hg update topology-manager-dev

Configure, compilation and installation phases

Be careful, a second installation of topology-generator may need manual cleaning of installed files.

Prompt>cd topology-generator-lab/p42-dev
Prompt>./configure --prefix=Where_You_Want_Your_Soft_Installed
Prompt>make && make install
Prompt>cd ../topology-generator-dev
Prompt>make prefix=Where_You_Want_Your_Soft_Installed install
Prompt>cd ../topology-manager-dev
Prompt>autoconf
Prompt>ADA_PROJECT_PATH=Where_You_Want_Your_Soft_Installed/include:Where_You_Want_Your_Soft_Installed/share/gpr:path_to_gnatpro/include ./configure --prefix=Where_You_Want_Your_Soft_Installed
Prompt>make && make install

Postgres installation

Under GNU/Debian Linux :

RootPrompt> apt-get install postgresql
RootPrompt> apt-get install libpq-dev

Manage postgres stuff :

RootPrompt> su - postgres

To create the user :

Prompt> createuser agata_tm
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) n
Shall the new role be allowed to create more new roles? (y/n) n

To set a password for agata_tm :

Prompt>psql
postgres=# \password agata_tm
Saisissez le nouveau mot de passe :
Saisissez-le à nouveau :
postgres=#

To allow local connections, add these lines to /etc/postgresql/8.4/main/pg_hba.conf (!!! this line need to be the first of local ones !!!)

# connexion AGATADEVICES
local   AGATADEVICES agata_tm password

Then restart service :

postgres@rangifer-tarandus:~$ /etc/init.d/postgresql restart
Restarting PostgreSQL 8.4 database server: main.

To create the database :

Prompt> createdb --owner agata_tm --encoding UTF8 --template template0 AGATADEVICES "Agata Electronic Devices collection"

To list the databases :

Prompt> psql
postgres=# \l+
List of databases
Name | Owner | Encoding | Collation | Ctype | Access privileges | Size | Tablespace | Description
--------------+----------+-----------+-----------+-------+-----------------------+---------+------------+-------------------------------------
AGATADEVICES | agata_tm | UTF8 | C | C | | 5510 kB | pg_default | Agata Electronic Devices collection

To create the tables (or reset) as postgres user :

Prompt>psql --password --username=agata_tm AGATADEVICES

Then using database.sql file from Mercurial revision 128:0cfe2008fcf5

AGATADEVICES=> \i database.sql
AGATADEVICES=> \dt+
List of relations
Schema | Name | Type | Owner | Size | Description
--------+---------------+-------+----------+---------+-------------
public | adc | table | agata_tm | 0 bytes |
public | ancillary | table | agata_tm | 0 bytes |
public | carrier | table | agata_tm | 0 bytes |
public | cluster | table | agata_tm | 0 bytes |
public | crate | table | agata_tm | 0 bytes |
public | crystal | table | agata_tm | 0 bytes |
public | detector | table | agata_tm | 0 bytes |
public | digitizer | table | agata_tm | 0 bytes |
public | fiber_channel | table | agata_tm | 0 bytes |
public | gts | table | agata_tm | 0 bytes |
public | macip | table | agata_tm | 0 bytes |
public | mainboard | table | agata_tm | 0 bytes |
public | mezzanine | table | agata_tm | 0 bytes |
public | narval_node | table | agata_tm | 0 bytes |
public | preampli | table | agata_tm | 0 bytes |
public | relations | table | agata_tm | 0 bytes |
public | server | table | agata_tm | 0 bytes |
(17 rows)

To create the tables (or reset) as any user in topology-manager-dev directory :

UserPrompt> psql --username agata_tm --password -f database/database.sql AGATADEVICES

Debian configuration

Squeeze

To compile new Topology Manager using gnat-4.6 one need as root to do :

RootPrompt>cd /usr/lib/ada/adalib/log4ada
RootPrompt>ln -s /usr/lib/liblog4ada.so

But using gnat pro is recommended.