Recherche
Bookmarks Labo

Identifiant :
Mot de passe :

 RSS - Forums   SujetsRV
#Debian etch configuration.

apt-get install                                        \
emacs21 tree                                           \
sudo zsh                                               \
postgresql-8.1  postgresql-contrib-8.1 sqlite3         \
python python-imaging                                  \
python-psycopg2 python-psycopg2 python-pysqlite2       \
python-docutils python-unit python-mode python-django  \
python-feedparser                                      \
apache2 libapache2-mod-python                          \
openssl ssl-cert                                       \
libapache2-mod-proxy-html                              \
gnat libgmp3c2 libgmpxx4  zip unzip                    \
gcc binutils gzip zip unzip tar make                   \
python-dev libgmp3-dev                                 \
apache2-mpm-prefork                                    \
sun-java5-bin sun-java5-jdk sun-java5-jre

update-java-alternatives -s java-1.5.0-sun

cd /usr/src
mkdir build
cd build

# Compilation last version MPFR
# If I prefer use the package version, simply do
# apt-get install libmpfr1 libmpfr-dev
# but it's note buggy by GCC compiler configuration script

mkdir MPFR
cd MPFR
wget http://www.mpfr.org/mpfr-current/mpfr-2.2.1.tar.gz
tar zxvf mpfr-2.2.1.tar.gz
cd mpfr-2.2.1
wget http://www.mpfr.org/mpfr-2.2.1/patches
patch -N -Z -p1 < patches
./configure
make
make check
make install
cd ../..


# Compilation GCC 4.2.0

mkdir GCC
cd GCC
svn checkout svn://gcc.gnu.org/svn/gcc/branches/gcc-4_2-branch gcc-4.2
mkdir build
cd build
../gcc-4.2/configure --enable-threads=posix --prefix=/usr/local/gcc-4.2 --enable-languages=c,c++,java
# don't test yet with, peharps better :
#../gcc-4.2/configure --enable-threads=posix --prefix=/usr/local/gcc-4.2 --enable-languages=c,c++,java --disable-multilib
make bootstrap 2>err.txt >ok.txt
make install
cd ../..

#remplace package version GCC by new 4.2.0
mv /usr/bin/gcc /usr/bin/gcc-init
ln -s /usr/local/gcc-4.2/bin/gcc /usr/bin/gcc
mv /usr/bin/gcj /usr/bin/gcj-init
ln -s /usr/local/gcc-4.2/bin/gcj /usr/bin/gcj


# trick needed.
ln -s /lib/libgcc_s.so.1 /usr/lib/libgcc_s.so.1

# Compilation pylucene SVN

mkdir PYLUCENE
cd PYLUCENE
svn checkout http://svn.osafoundation.org/pylucene/trunk/ pylucene-2.1-trunk
cd pylucene-2.1-trunk

#Edit Makfile with this cobfiguration.

PYTHON_VER=2.4

PREFIX=/usr/local
PREFIX_PYTHON=/usr
LIBDIR_NAME=lib
GCJ_HOME=/usr/local/gcc-4.2
GCJ_LIBDIR=$(GCJ_HOME)/$(LIBDIR_NAME)
GCJ_STATIC=1
LIB_INSTALL=libstdc++.so.6 libgcc_s.so.1
#DB=$(PYLUCENE)/db-$(DB_VER)
PREFIX_DB=/usr/local/BerkeleyDB.4.5
ANT=ant
PYTHON=$(PREFIX_PYTHON)/bin/python

# Add -lrt in LDFLAGS for linux
# for correct clock_gettime error
ifeq ($(OS),Linux)
...
LDFLAGS=-g -lrt
...
LDFLAGS=-lrt

# Compile
make 2>err.txt >ok.txt
make install
make test
cd ..

# reset initial GCC configuration :
rm /usr/bin/gcc
mv /usr/bin/gcc-init /usr/bin/gcc
rm /usr/bin/gcj
mv /usr/bin/gcj-init /usr/bin/gcj


#################################################################
Result
#################################################################

It's ok with shell and Thread, but it's not work with mod_python




 patch.txt : add a methode JvAttachCurrentThread2 in PyLucene

 testthread.py : thread simple (error with shell, error with mod_python)

 testthread3.py : patch JvAttachCurrentThread2 (ok with shell, error with mod_python)

 testthread2.py : PyLucene.PythonThread thread solution. (ok with shell error with mod_python)
 ok.txt  err.txt : trace compilation pylucene ( make 2>err.txt >ok.txt)