close Warning: Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.

LinuxDevelEnvironment: CentOS6.x_Install.txt

File CentOS6.x_Install.txt, 8.4 KB (added by Jorge, 10 years ago)
Line 
1
2#
3# instrucciones para compilar tol/tolbase en centos 6.x X86_64,
4# concretamente:
5#
6# Linux brw07.localbayes.es 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
7#
8
9# Se recomienda hacer un update para evitar posibles conflictos entre
10# los paquetes x86_64 y i686
11
12sudo yum update
13
14# asumimos que existe una variable de entorno TOLROOT debajo de la cual
15# compilaremos TOL
16#
17
18export TOLROOT=${HOME}/TOL
19
20# para asegurar que en siguientes sesiones este creada la variable
21# ejecutamos
22
23echo export TOLROOT=${HOME}/TOL >> ${HOME}/.bash_profile
24
25#
26# creamos directorios de trabajo
27#
28mkdir -p ${TOLROOT}/tools
29mkdir -p ${TOLROOT}/contribs
30mkdir -p ${TOLROOT}/contribs/rpms
31
32#
33# incorporamos el repositorio EPEL
34#
35sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
36
37# para poder hacer X11 remoto
38sudo yum install xauth
39
40sudo yum install rlwrap
41
42# Instalamos los paquetes base
43sudo yum install bc unzip wget cvs subversion gcc-c++ gcc-c++.i686 libgcc.i686 glibc.i686 glibc-devel.i686 gcc-gfortran.i686 libstdc++-devel libstdc++-devel.i686 autoconf make bzip2-devel.i686 gsl-devel.i686 boost-devel.i686 mysql-devel.i686 postgresql-devel.i686 openssl-devel.i686 zlib-devel.i686 libtool-ltdl-devel.i686 libX11-devel.i686 libX11.i686  libXt.i686 libXt-devel.i686
44
45# No package gcc-c++.i686 available.
46# No package gcc-gfortran.i686 available.
47
48# unixODBC-devel.i686, no ya que usamos el fuente unixODBC-2.3.0
49cd ${TOLROOT}/contribs
50wget ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.2.tar.gz
51tar zxf unixODBC-2.3.2.tar.gz
52cd unixODBC-2.3.2
53mkdir build
54cd build
55CC='gcc -m32' CXX='g++ -m32' ../configure --prefix=/usr/local/unixODBC-2.3.0
56make
57sudo make install
58
59
60# tcl-devel.i686 tk-devel.i686 tk.i686 no ya que compilamos desde el fuente el 8.4
61cd ${TOLROOT}/contribs
62wget http://downloads.sourceforge.net/project/tcl/Tcl/8.4.20/tcl8.4.20-src.tar.gz
63tar zxf tcl8.4.20-src.tar.gz
64cd tcl8.4.20
65mkdir build
66cd build
67CC='gcc -m32' CXX='g++ -m32' ../unix/configure --prefix=/usr/local/tcl8.4.20 --enable-threads --enable-shared
68make
69sudo make install install-private-headers
70cd ${TOLROOT}/contribs
71wget http://downloads.sourceforge.net/project/tcl/Tcl/8.4.20/tk8.4.20-src.tar.gz
72tar zxf tk8.4.20-src.tar.gz
73cd tk8.4.20
74mkdir build
75cd build
76CC='gcc -m32' CXX='g++ -m32' ../unix/configure --prefix=/usr/local/tcl8.4.20 --enable-threads --enable-shared --with-tcl=/usr/local/tcl8.4.20/lib
77make
78sudo make install install-private-headers
79
80#
81# instalamos atlas/blas/lapack, estos pasos parten de la base que el
82# procesador implementa las extensiones sse2, algo que puede saberse
83# ejecutando:
84#
85# cat /proc/cpuinfo | grep flags
86#
87# en nuestro caso las extensiones son sse2
88sudo yum install atlas-sse2.i686 atlas-sse2-devel.i686
89
90# bash_profile
91export BLAPI_BLAS_LIB=/usr/lib/atlas-sse2/libf77blas
92export BLAPI_LAPACK_LIB=/usr/lib/atlas-sse2/liblapack
93
94#
95# instalamos R-project
96# quizas se puede instalar el R de 64 bits, ya que se usa en modo comando
97sudo yum install R-core.i686 R-devel.i686 glpk-devel.i686
98echo 'options(repos="http://cran.r-project.org")' > /tmp/Rinstall.R
99echo 'install.packages("coda")' >> /tmp/Rinstall.R
100echo 'install.packages("quadprog")' >> /tmp/Rinstall.R
101echo 'install.packages("Rglpk")' >> /tmp/Rinstall.R
102sudo R BATCH -f /tmp/Rinstall.R
103rm /tmp/Rinstall.R
104
105#
106# instalo Boost Build 2: bjam
107#
108cd ${TOLROOT}/tools
109wget http://www.boost.org/boost-build2/boost-build.tar.bz2
110tar jxf boost-build.tar.bz2
111cd boost-build/engine
112./build.sh
113# lo copio en bin pues su debe encontrarlo para hacer tareas de instalacion
114sudo cp bin.linuxx86_64/bjam /usr/bin/.
115cd ..
116export BOOST_BUILD_PATH=`pwd`
117echo export BOOST_BUILD_PATH=`pwd` >> ${HOME}/.bash_profile
118
119#
120# instalo google sparse hash
121#
122sudo yum install sparsehash-devel
123
124#
125# compilo ZipArchive
126#
127cd ${TOLROOT}/contribs
128mkdir ZipArchive
129cd ZipArchive
130wget http://packages.tol-prj.org/linux/sources/ziparchive_src.zip
131unzip ziparchive_src.zip
132cp _projects/Linux/Makefile ZipArchive/.
133cd ZipArchive
134sed -e 's/$(CC)/g++ -m32 -fPIC/' -e 's/$(CCC)/gcc -m32 -fPIC/' < Makefile > Makefile.fix
135make -e -f Makefile.fix
136
137#
138# compilo fftw3
139cd ${TOLROOT}/contribs
140wget http://packages.tol-prj.org/linux/sources/fftw-3.3.1.tar.gz
141tar zxf fftw-3.3.1.tar.gz
142cd fftw-3.3.1
143CC='gcc -m32' CXX='g++ -m32' ./configure --prefix=/usr/local/fftw-3.3.1
144make
145sudo make install
146
147#
148# compilamos ANN
149#
150cd ${TOLROOT}/contribs/
151#wget http://www.cs.umd.edu/%7Emount/ANN/Files/1.1.2/ann_1.1.2.tar.gz
152wget http://packages.tol-prj.org/linux/sources/ann_1.1.2.tar.gz
153tar zxf ann_1.1.2.tar.gz
154cd ann_1.1.2
155cp Make-config Make-config.original
156sed 's/"C++ = g++"/"C++ = g++ -m32"/' < Make-config.original > Make-config
157make -e linux-g++
158
159#
160# instalamos Cint: C interpretado
161#
162sudo yum install root-cint.i686
163
164#
165#
166# compilamos GBLA
167#
168cd ${TOLROOT}
169svn co https://www.tol-prj.org/svn/gbla
170cd gbla/trunk/libltdl
171chmod +x configure
172CC='gcc -m32' CXX='g++ -m32' ./configure
173cd ..
174bjam address-model=32 release
175# verificamos que el codigo generado funciona, pasamos los test de blas
176cd examples/blas
177bjam address-model=32 release
178bin/gcc-4.4.7/release/address-model-32/blas1_check
179bin/gcc-4.4.7/release/address-model-32/blas2_check
180bin/gcc-4.4.7/release/address-model-32/blas3_check
181cd ${TOLROOT}/gbla/trunk
182sudo BOOST_BUILD_PATH=`echo $BOOST_BUILD_PATH` bjam address-model=32 release install
183
184#
185# compilamos SuiteSparse_TOL
186#
187cd ${TOLROOT}/contribs/
188wget http://packages.tol-prj.org/linux/sources/SuiteSparse_TOL.tar.bz2
189tar jxf SuiteSparse_TOL.tar.bz2
190cd SuiteSparse_TOL/BB2/CHOLMOD
191===========================================================================
192edit the metis-4.0/Lib/rename.h file and replace the last line in the file:
193
194#define log2    __log2
195
196with the following:
197
198#define log2    METIS__log2
199===========================================================================
200
201bjam address-model=32 release
202sudo BOOST_BUILD_PATH=`echo $BOOST_BUILD_PATH` bjam address-model=32 release install
203
204sudo yum install libcurl-devel.i686
205# compilamos tclcurl, observar que se compila con -m32
206cd ${TOLROOT}/contribs
207wget http://packages.tol-prj.org/linux/sources/TclCurl-7.19.6.tar.gz
208tar zxf TclCurl-7.19.6.tar.gz
209cd TclCurl-7.19.6
210PKG_CONFIG_PATH=/usr/lib/pkgconfig CC='gcc -m32' CXX='g++ -m32' ./configure --with-tcl=/usr/local/tcl8.4.20/lib
211make -e
212sudo make install
213
214
215#
216# Compilamos TOL: vamos a por tol!!!!
217#
218cd ${TOLROOT}
219#sudo ln -s /usr/include /usr/include/postgresql
220svn co https://www.tol-prj.org/svn/tolp/trunk
221cd trunk/tol
222cp prj-config.jam.CentOS6x prj-config.jam
223./bjam-gcc-release address-model=32
224./sudo_install address-model=32
225
226# script de arranque de tolcon
227sudo mv /usr/local/tol32/bin/tolcon /usr/local/tol32/bin/tolcon.bin
228echo '#!/bin/bash' > /tmp/tolcon
229echo 'LD_LIBRARY_PATH=/usr/local/lib:/usr/local/unixODBC-2.3.0 BLAPI_BLAS_LIB=/usr/lib/atlas-sse2/libf77blas BLAPI_LAPACK_LIB=/usr/lib/atlas-sse2/liblapack /usr/local/tol32/bin/tolcon.bin  ${1+"$@"}' >> /tmp/tolcon
230chmod a+x /tmp/tolcon
231sudo mv /tmp/tolcon /usr/local/tol32/bin/tolcon
232
233# verificamos que arranca bien
234cd ..
235/usr/local/tol32/bin/tolcon -ndp -i -c"WriteLn(\"Hola soy TOL \")"
236
237# puede dar problemas al arrancar
238# cannot restore segment prot after reloc: Permission denied
239# sudo /usr/sbin/setenforce 0
240# vease http://www.appistry.com/community/forums/content/cannot-restore-segment-prot-after-reloc-permission-denied
241
242#
243# compilamos toltcl: el puente con tcl.
244#
245cd ${TOLROOT}/trunk/toltcl/release
246CC='gcc -m32' CXX='g++ -m32' ./default_config.sh --with-tol=/usr/local/tol32 --with-tcl=/usr/local/tcl8.4.20/lib
247make
248sudo make install
249
250# instalamos tcllib
251
252cd ${TOLROOT}/contribs
253wget https://github.com/tcltk/tcllib/archive/tcllib_1_16.tar.gz
254tar zxf tcllib_1_16.tar.gz
255cd tcllib-tcllib_1_16/
256./configure --prefix=/usr/local/tcl8.4.20
257sudo make install
258
259#
260# compilamos tolsh: la consola de tol con Tcl_EvalEx
261#
262cd ${TOLROOT}/trunk/tolsh
263sudo cp -r tolsh.vfs/lib/app-tolsh /usr/local/tcl8.4.20/lib/.
264sudo cp -r tolsh.vfs/lib/tequila /usr/local/tcl8.4.20/lib/.
265sudo cp -r tolsh.vfs/lib/tlogger /usr/local/tcl8.4.20/lib/.
266sudo cp -r tolsh.vfs/lib/tolcomm /usr/local/tcl8.4.20/lib/.
267echo '#!/bin/bash' > /tmp/tolsh
268echo 'LD_LIBRARY_PATH=/usr/local/lib:/usr/local/unixODBC-2.3.0/lib BLAPI_BLAS_LIB=/usr/lib/atlas-sse2/libf77blas BLAPI_LAPACK_LIB=/usr/lib/atlas-sse2/liblapack TOLSessionPath=/usr/local/tol32/bin/tolsh /usr/local/tcl8.4.20/bin/tclsh8.4 /usr/local/tcl8.4.20/lib/app-tolsh/tolsh.tcl ${1+"$@"}' >> /tmp/tolsh
269chmod a+x /tmp/tolsh
270sudo mv /tmp/tolsh /usr/local/tol32/bin/tolsh
271