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 | |
---|
12 | sudo yum update |
---|
13 | |
---|
14 | # asumimos que existe una variable de entorno TOLROOT debajo de la cual |
---|
15 | # compilaremos TOL |
---|
16 | # |
---|
17 | |
---|
18 | export TOLROOT=${HOME}/TOL |
---|
19 | |
---|
20 | # para asegurar que en siguientes sesiones este creada la variable |
---|
21 | # ejecutamos |
---|
22 | |
---|
23 | echo export TOLROOT=${HOME}/TOL >> ${HOME}/.bash_profile |
---|
24 | |
---|
25 | # |
---|
26 | # creamos directorios de trabajo |
---|
27 | # |
---|
28 | mkdir -p ${TOLROOT}/tools |
---|
29 | mkdir -p ${TOLROOT}/contribs |
---|
30 | mkdir -p ${TOLROOT}/contribs/rpms |
---|
31 | |
---|
32 | # |
---|
33 | # incorporamos el repositorio EPEL |
---|
34 | # |
---|
35 | sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm |
---|
36 | |
---|
37 | # para poder hacer X11 remoto |
---|
38 | sudo yum install xauth |
---|
39 | |
---|
40 | sudo yum install rlwrap |
---|
41 | |
---|
42 | # Instalamos los paquetes base |
---|
43 | sudo 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 |
---|
49 | cd ${TOLROOT}/contribs |
---|
50 | wget ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.2.tar.gz |
---|
51 | tar zxf unixODBC-2.3.2.tar.gz |
---|
52 | cd unixODBC-2.3.2 |
---|
53 | mkdir build |
---|
54 | cd build |
---|
55 | CC='gcc -m32' CXX='g++ -m32' ../configure --prefix=/usr/local/unixODBC-2.3.0 |
---|
56 | make |
---|
57 | sudo make install |
---|
58 | |
---|
59 | |
---|
60 | # tcl-devel.i686 tk-devel.i686 tk.i686 no ya que compilamos desde el fuente el 8.4 |
---|
61 | cd ${TOLROOT}/contribs |
---|
62 | wget http://downloads.sourceforge.net/project/tcl/Tcl/8.4.20/tcl8.4.20-src.tar.gz |
---|
63 | tar zxf tcl8.4.20-src.tar.gz |
---|
64 | cd tcl8.4.20 |
---|
65 | mkdir build |
---|
66 | cd build |
---|
67 | CC='gcc -m32' CXX='g++ -m32' ../unix/configure --prefix=/usr/local/tcl8.4.20 --enable-threads --enable-shared |
---|
68 | make |
---|
69 | sudo make install install-private-headers |
---|
70 | cd ${TOLROOT}/contribs |
---|
71 | wget http://downloads.sourceforge.net/project/tcl/Tcl/8.4.20/tk8.4.20-src.tar.gz |
---|
72 | tar zxf tk8.4.20-src.tar.gz |
---|
73 | cd tk8.4.20 |
---|
74 | mkdir build |
---|
75 | cd build |
---|
76 | CC='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 |
---|
77 | make |
---|
78 | sudo 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 |
---|
88 | sudo yum install atlas-sse2.i686 atlas-sse2-devel.i686 |
---|
89 | |
---|
90 | # bash_profile |
---|
91 | export BLAPI_BLAS_LIB=/usr/lib/atlas-sse2/libf77blas |
---|
92 | export 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 |
---|
97 | sudo yum install R-core.i686 R-devel.i686 glpk-devel.i686 |
---|
98 | echo 'options(repos="http://cran.r-project.org")' > /tmp/Rinstall.R |
---|
99 | echo 'install.packages("coda")' >> /tmp/Rinstall.R |
---|
100 | echo 'install.packages("quadprog")' >> /tmp/Rinstall.R |
---|
101 | echo 'install.packages("Rglpk")' >> /tmp/Rinstall.R |
---|
102 | sudo R BATCH -f /tmp/Rinstall.R |
---|
103 | rm /tmp/Rinstall.R |
---|
104 | |
---|
105 | # |
---|
106 | # instalo Boost Build 2: bjam |
---|
107 | # |
---|
108 | cd ${TOLROOT}/tools |
---|
109 | wget http://www.boost.org/boost-build2/boost-build.tar.bz2 |
---|
110 | tar jxf boost-build.tar.bz2 |
---|
111 | cd boost-build/engine |
---|
112 | ./build.sh |
---|
113 | # lo copio en bin pues su debe encontrarlo para hacer tareas de instalacion |
---|
114 | sudo cp bin.linuxx86_64/bjam /usr/bin/. |
---|
115 | cd .. |
---|
116 | export BOOST_BUILD_PATH=`pwd` |
---|
117 | echo export BOOST_BUILD_PATH=`pwd` >> ${HOME}/.bash_profile |
---|
118 | |
---|
119 | # |
---|
120 | # instalo google sparse hash |
---|
121 | # |
---|
122 | sudo yum install sparsehash-devel |
---|
123 | |
---|
124 | # |
---|
125 | # compilo ZipArchive |
---|
126 | # |
---|
127 | cd ${TOLROOT}/contribs |
---|
128 | mkdir ZipArchive |
---|
129 | cd ZipArchive |
---|
130 | wget http://packages.tol-prj.org/linux/sources/ziparchive_src.zip |
---|
131 | unzip ziparchive_src.zip |
---|
132 | cp _projects/Linux/Makefile ZipArchive/. |
---|
133 | cd ZipArchive |
---|
134 | sed -e 's/$(CC)/g++ -m32 -fPIC/' -e 's/$(CCC)/gcc -m32 -fPIC/' < Makefile > Makefile.fix |
---|
135 | make -e -f Makefile.fix |
---|
136 | |
---|
137 | # |
---|
138 | # compilo fftw3 |
---|
139 | cd ${TOLROOT}/contribs |
---|
140 | wget http://packages.tol-prj.org/linux/sources/fftw-3.3.1.tar.gz |
---|
141 | tar zxf fftw-3.3.1.tar.gz |
---|
142 | cd fftw-3.3.1 |
---|
143 | CC='gcc -m32' CXX='g++ -m32' ./configure --prefix=/usr/local/fftw-3.3.1 |
---|
144 | make |
---|
145 | sudo make install |
---|
146 | |
---|
147 | # |
---|
148 | # compilamos ANN |
---|
149 | # |
---|
150 | cd ${TOLROOT}/contribs/ |
---|
151 | #wget http://www.cs.umd.edu/%7Emount/ANN/Files/1.1.2/ann_1.1.2.tar.gz |
---|
152 | wget http://packages.tol-prj.org/linux/sources/ann_1.1.2.tar.gz |
---|
153 | tar zxf ann_1.1.2.tar.gz |
---|
154 | cd ann_1.1.2 |
---|
155 | cp Make-config Make-config.original |
---|
156 | sed 's/"C++ = g++"/"C++ = g++ -m32"/' < Make-config.original > Make-config |
---|
157 | make -e linux-g++ |
---|
158 | |
---|
159 | # |
---|
160 | # instalamos Cint: C interpretado |
---|
161 | # |
---|
162 | sudo yum install root-cint.i686 |
---|
163 | |
---|
164 | # |
---|
165 | # |
---|
166 | # compilamos GBLA |
---|
167 | # |
---|
168 | cd ${TOLROOT} |
---|
169 | svn co https://www.tol-prj.org/svn/gbla |
---|
170 | cd gbla/trunk/libltdl |
---|
171 | chmod +x configure |
---|
172 | CC='gcc -m32' CXX='g++ -m32' ./configure |
---|
173 | cd .. |
---|
174 | bjam address-model=32 release |
---|
175 | # verificamos que el codigo generado funciona, pasamos los test de blas |
---|
176 | cd examples/blas |
---|
177 | bjam address-model=32 release |
---|
178 | bin/gcc-4.4.7/release/address-model-32/blas1_check |
---|
179 | bin/gcc-4.4.7/release/address-model-32/blas2_check |
---|
180 | bin/gcc-4.4.7/release/address-model-32/blas3_check |
---|
181 | cd ${TOLROOT}/gbla/trunk |
---|
182 | sudo BOOST_BUILD_PATH=`echo $BOOST_BUILD_PATH` bjam address-model=32 release install |
---|
183 | |
---|
184 | # |
---|
185 | # compilamos SuiteSparse_TOL |
---|
186 | # |
---|
187 | cd ${TOLROOT}/contribs/ |
---|
188 | wget http://packages.tol-prj.org/linux/sources/SuiteSparse_TOL.tar.bz2 |
---|
189 | tar jxf SuiteSparse_TOL.tar.bz2 |
---|
190 | cd SuiteSparse_TOL/BB2/CHOLMOD |
---|
191 | =========================================================================== |
---|
192 | edit the metis-4.0/Lib/rename.h file and replace the last line in the file: |
---|
193 | |
---|
194 | #define log2 __log2 |
---|
195 | |
---|
196 | with the following: |
---|
197 | |
---|
198 | #define log2 METIS__log2 |
---|
199 | =========================================================================== |
---|
200 | |
---|
201 | bjam address-model=32 release |
---|
202 | sudo BOOST_BUILD_PATH=`echo $BOOST_BUILD_PATH` bjam address-model=32 release install |
---|
203 | |
---|
204 | sudo yum install libcurl-devel.i686 |
---|
205 | # compilamos tclcurl, observar que se compila con -m32 |
---|
206 | cd ${TOLROOT}/contribs |
---|
207 | wget http://packages.tol-prj.org/linux/sources/TclCurl-7.19.6.tar.gz |
---|
208 | tar zxf TclCurl-7.19.6.tar.gz |
---|
209 | cd TclCurl-7.19.6 |
---|
210 | PKG_CONFIG_PATH=/usr/lib/pkgconfig CC='gcc -m32' CXX='g++ -m32' ./configure --with-tcl=/usr/local/tcl8.4.20/lib |
---|
211 | make -e |
---|
212 | sudo make install |
---|
213 | |
---|
214 | |
---|
215 | # |
---|
216 | # Compilamos TOL: vamos a por tol!!!! |
---|
217 | # |
---|
218 | cd ${TOLROOT} |
---|
219 | #sudo ln -s /usr/include /usr/include/postgresql |
---|
220 | svn co https://www.tol-prj.org/svn/tolp/trunk |
---|
221 | cd trunk/tol |
---|
222 | cp 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 |
---|
227 | sudo mv /usr/local/tol32/bin/tolcon /usr/local/tol32/bin/tolcon.bin |
---|
228 | echo '#!/bin/bash' > /tmp/tolcon |
---|
229 | echo '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 |
---|
230 | chmod a+x /tmp/tolcon |
---|
231 | sudo mv /tmp/tolcon /usr/local/tol32/bin/tolcon |
---|
232 | |
---|
233 | # verificamos que arranca bien |
---|
234 | cd .. |
---|
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 | # |
---|
245 | cd ${TOLROOT}/trunk/toltcl/release |
---|
246 | CC='gcc -m32' CXX='g++ -m32' ./default_config.sh --with-tol=/usr/local/tol32 --with-tcl=/usr/local/tcl8.4.20/lib |
---|
247 | make |
---|
248 | sudo make install |
---|
249 | |
---|
250 | # instalamos tcllib |
---|
251 | |
---|
252 | cd ${TOLROOT}/contribs |
---|
253 | wget https://github.com/tcltk/tcllib/archive/tcllib_1_16.tar.gz |
---|
254 | tar zxf tcllib_1_16.tar.gz |
---|
255 | cd tcllib-tcllib_1_16/ |
---|
256 | ./configure --prefix=/usr/local/tcl8.4.20 |
---|
257 | sudo make install |
---|
258 | |
---|
259 | # |
---|
260 | # compilamos tolsh: la consola de tol con Tcl_EvalEx |
---|
261 | # |
---|
262 | cd ${TOLROOT}/trunk/tolsh |
---|
263 | sudo cp -r tolsh.vfs/lib/app-tolsh /usr/local/tcl8.4.20/lib/. |
---|
264 | sudo cp -r tolsh.vfs/lib/tequila /usr/local/tcl8.4.20/lib/. |
---|
265 | sudo cp -r tolsh.vfs/lib/tlogger /usr/local/tcl8.4.20/lib/. |
---|
266 | sudo cp -r tolsh.vfs/lib/tolcomm /usr/local/tcl8.4.20/lib/. |
---|
267 | echo '#!/bin/bash' > /tmp/tolsh |
---|
268 | echo '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 |
---|
269 | chmod a+x /tmp/tolsh |
---|
270 | sudo mv /tmp/tolsh /usr/local/tol32/bin/tolsh |
---|
271 | |
---|