Linux

From NEOSYS Dev Wiki
Revision as of 17:12, 31 March 2009 by Steve (talk | contribs) (New page: == Installing dependencies == Tested on Centos 5.2/Boost 1.38/Postgres 8.3/Gnu Compiler 4.1.2 It might work with versions as far back as Boost 1.35 and Postgres 8.1 perhaps with minor tw...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Installing dependencies

Tested on Centos 5.2/Boost 1.38/Postgres 8.3/Gnu Compiler 4.1.2

It might work with versions as far back as Boost 1.35 and Postgres 8.1 perhaps with minor tweaks.

Installing Boost

Required for complete build of Boost - but those bits of Boost may not actually be required by Exodus.

yum install python-devel
yum install bzip2-devel

Download it

wget http://downloads.sourceforge.net/boost/boost_1_38_0.tar.bz2?use_mirror=garr

Unpack it

tar xvf boost_1_38_0.tar.bz2
cd boost_1_38_0

Become superuser to build and install it

su
./configure
make
make install

Quit superuser

exit

Installing Postgres

Version 8.3

yum install postgresql

Setting up Postgres for Exodus

become user postgres and get into postgres command prompt

su - postgres
psql

create a user and database for exodus

CREATE ROLE exodus LOGIN
 PASSWORD 'somesillysecret'
 CREATEDB CREATEROLE;
CREATE DATABASE exodus
 WITH ENCODING='UTF8'
   OWNER=exodus;
#quit postgres command prompt and quite postgres user
\q
exit

Allow login from 127.0.0.1 using username/unencrypted password (instead of only logged-in username without password) http://developer.postgresql.org/pgdocs/postgres/auth-pg-hba-conf.html

nano /var/lib/pgsql/data/pg_hba.conf
#host    all         all         127.0.0.1/32          ident sameuser
host    all         all         127.0.0.1/32          password
service postgresql reload

Installing g++ compiler

yum list|grep gcc
yum install gcc-c++.i386

Installing Postgres development libraries

Look for all available postgres packages and if they are installed

yum list|grep postgres

yum install postgresql-devel

Locate postgres.h for interest

updatedb
locate postgres.h

Downloading and Building Exodus

Downloading Exodus

Make a folder for exodus

cd ~
mkdir exodus
cd exodus

Download the main trunk of Exodus

svn checkout http://svn.neosys.com/svn/trunk

Building pgexodus

pgexodus.so is a shared library addin c function for postgres to perform sort/select.

Currently hand built without even a make file. standard configure/make using autoconf/automake will be available soon http://www.lrde.epita.fr/~adl/dl/autotools.pdf

cd trunk
export BOOST_PATH=/root/exodus/boost_1_38_0
export POSTGRES_PATH=`pg_config --pkglibdir`/server
g++ -fpic -c pgexodus.c extract.c callexodus.cpp -I "$POSTGRES_PATH/server" -I "$BOOST_PATH"
g++ -shared -o pgexodus.so pgexodus.o extract.o callexodus.o -lrt -lpq

Installing pgexodus

cp pgexodus.so `pg_config --libdir`

Building libexodus

libexodus.so is a shared library that allows you to write c++ programs with the style and semantics of pick basic.

Currently hand built without even a make file. standard configure/make using autoconf/automake will be available soon http://www.lrde.epita.fr/~adl/dl/autotools.pdf

cd ~/exodus/trunk/agency/mv
g++ -fPIC -c *.cpp -I../../../boost_1_38_0
gcc -fPIC -c *.c -I../../../boost_1_38_0
#ld -shared -soname libexodus.so.1 -o libexodus.so.1.0 -lc *.o
g++ -shared -o libexodus.so.1.0 -lc *.o

once after creation of library as above

ldconfig -v -n .
ln -sf libexodus.so.1 libexodus.so

Debugging

http://www.ibm.com/developerworks/library/l-shobj/

ldd libexodus.so|grep "not found"
ldd -u libexodus.so

Testing libexodus

once before running libexodus

export LD_LIBRARY_PATH=.:/usr/local/lib:$LD_LIBRARY_PATH

Compile and Link

g++ -o test test.cpp -I../../../boost_1_38_0 -L. -L/usr/local/lib -lexodus -lpq -lboost_filesystem-gcc41-mt -lboost_regex-gcc41-mt -lboost_thread-gcc41-mt

Execute

./test
ldd -u test

Building service

service is an incomplete multithreaded framework to support dynamic loading of library routines and serving a request/response queue.

www provides an optional web interface to the request/response queue.

Building service

g++ -fPIC -c *.cpp -I../../../boost_1_38_0 -I../mv
g++ -shared -o service.so -lc *.o
g++ -o service main.cpp -I../../../../boost_1_38_0 -L. -L/usr/local/lib -lexodus -lpq -lboost_filesystem-gcc41-mt -lboost_regex-gcc41-mt -lboost_thread-gcc41-mt -L../mv -I../mv -I../.. /../boost_1_38_0 -L./ -lagency

Developing libexodus/service

Committing your developments

First get a username and password by running the following unix command and send the output to an exodus subversion administrator eg steve.bush@neosys.com

htpasswd -nm YOURDESIREDUSERNAME

The administrator needs to run the following command as root and enter the encrypted pass (the bit AFTER the :) ignoring the warning about plain text password because it is already encrypted.

htpasswd -p /etc/apache2/dav_svn.passwd YOURDESIREDUSERNAME