File: install.html

package info (click to toggle)
torch 2-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,488 kB
  • ctags: 3,217
  • sloc: cpp: 14,272; makefile: 201
file content (181 lines) | stat: -rw-r--r-- 10,091 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <meta name="GENERATOR" content="Mozilla/4.77 [en] (X11; U; Linux 2.4.10 i686) [Netscape]">
   <meta name="Author" content="Ronan Collobert">
   <meta name="Description" content="Torch Library.">
   <meta name="Keywords" content="Machine Learning.">
   <title>Torch Install</title>
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#0000EE" vlink="#551A8B" alink="#FF0000">

<center><img SRC="images/title.jpeg" ALT="[Torch]" NOSAVE height=137 width=220><img SRC="images/release.jpeg" NOSAVE height=18 width=77>
<p><img SRC="images/torche.jpeg" ALT="[XXXXX]" NOSAVE height=32 width=32></center>

<div align=right><i><font size=-1><a href="http://www.idiap.ch/~collober">Ronan
Collobert</a>, <a href="mailto:collober@iro.umontreal.ca">collober@iro.umontreal.ca</a></font></i></div>

<center><table COLS=5 WIDTH="100%" BGCOLOR="#FFCC00" NOSAVE >
<tr ALIGN=CENTER VALIGN=CENTER NOSAVE>
<td NOWRAP NOSAVE><a href="about.html"><img SRC="images/about_b.jpeg" ALT="[About]" NOSAVE BORDER=0 height=32 width=60></a></td>

<td NOWRAP NOSAVE><a href="introduction.html"><img SRC="images/introduction_b.jpeg" ALT="[Introduction]" NOSAVE BORDER=0 height=32 width=95></a></td>

<td NOWRAP NOSAVE><a href="docs.html"><img SRC="images/docs_b.jpeg" ALT="[Docs]" NOSAVE BORDER=0 height=32 width=52></a></td>

<td NOWRAP NOSAVE><a href="install.html"><img SRC="images/install_bx.jpeg" ALT="[Install]" NOSAVE BORDER=0 height=32 width=65></a></td>

<td NOWRAP NOSAVE><a href="downloads.html"><img SRC="images/downloads_b.jpeg" ALT="[Downloads]" NOSAVE BORDER=0 height=32 width=89></a></td>
</tr>
</table></center>
<img SRC="images/new.jpg" ALT="[new!]" NOSAVE height=11 width=28><i><font color="#3333FF"><font size=-2>Warning:
there is new stuff on this page!</font></font></i>
<center><font color="#FF0000"><font size=+2>5 easy steps to install <b><i>Torch</i></b>
on a Linux/Unix machine</font></font></center>

<p><img SRC="images/boule.gif" ALT="[X]" NOSAVE height=12 width=12><b><u><font size=+1>What
do I need ?</font></u></b>
<blockquote>
<li>
A Linux/Unix machine (a motherboard, an hard disk, a screen,a keyboard
and a processor could be interesting).</li>

<br><i><font color="#FF0000">Note that I'll never support Windows systems</font></i>.
<li>
A C++ compiler. You can take for example the <a href="http://www.gnu.org/software/gcc/gcc.html">GNU
compiler</a>, but other compilers should work.</li>

<li>
<a href="http://www.gnu.org/software/make/make.html">GNU make</a>. (a version
<i>posterior</i>
to 1997) (If you don't have it, it's fast and easy to install) (Note that
other make program will probably <i><font color="#FF0000">not</font></i>
work)</li>
</blockquote>

<p><br><img SRC="images/boule.gif" ALT="[X]" NOSAVE height=12 width=12><b><u><font size=+1>Download
the library an unpack archives</font></u></b>
<blockquote>The library is divided into several parts: the <b><tt>kernel</tt></b>,
which is the core of the library (it should be stable...) and some packages
developed by any user. Just go in <a href="downloads.html">the download
section</a> to take what you need (at least the <b><tt>kernel</tt></b>).
<p>Unpack the <b><tt>kernel</tt></b>: a <b><tt>Torch</tt></b> directory
should appear, with some directories inside (the sources of the <b><tt>kernel</tt></b>
will be in the <b><tt>kernel</tt></b> directory...).
<p>If you have downloaded packages, unpack them in the <b><tt>Torch</tt></b>
directory.</blockquote>
<img SRC="images/boule.gif" ALT="[X]" NOSAVE height=12 width=12><b><u><font size=+1>Set
your compilation options&nbsp;</font></u></b><img SRC="images/new.jpg" ALT="[new!]" NOSAVE height=11 width=28>
<blockquote>The library needs a file named "<tt>Makefile_options_&lt;os></tt>"
to compile, where <tt>&lt;os></tt> is the name of you operating system,
given by the command "<tt>uname -s</tt>". This file must be in the <b><tt>Torch</tt></b>
directory. There are some examples of this file in the <b><tt>config</tt></b>
directory.
<p>Therefore, check the name of your OS with "<tt>uname -s</tt>" and copy
an example of <tt>Makefile_options_* </tt>from the directory <b><tt>config</tt></b>
to the root of <b><tt>Torch</tt></b>. For example, if you have a <b><tt>SunOs</tt></b>
system, and you're using the CC workshop compiler, copy the file <b><tt>Torch/config/Makefile_options_CC
</tt></b>in
the file<b><tt> Torch/Makefile_options_SunOs</tt></b>.
<p>After you've copied this file, edit it. It should look like the following
(if you are using the GNU compiler file example).
<br>(Red comments are not in the file)
<p><tt><font color="#000099"># Packages you want to use</font></tt>
<br><tt><font color="#FF0000"># For example if you have dowloaded addons
and speech, put "PACKAGES = addons speech"</font></tt>
<br><tt><font color="#FF0000"># Don't include packages which contain main
programs (such as "examples")</font></tt>
<br><tt><font color="#FF0000"># Don't include "kernel"</font></tt>
<br><tt><font color="#000099">PACKAGES =</font></tt>
<p><tt><font color="#000099"># Magik key if you have several makefile</font></tt>
<br><tt><font color="#000099"># for the same platform</font></tt>
<br><tt><font color="#FF0000"># (It's useful if you're using two different
compilers: a different file</font></tt>
<br><tt><font color="#FF0000"># for dependencies will be generated for
each MAGIC_KEY)</font></tt>
<br><tt><font color="#000099">MAGIK_KEY =</font></tt>
<p><tt><font color="#000099"># Compiler, linker and archiver</font></tt>
<br><tt><font color="#000099">CC = g++</font></tt>
<br><tt><font color="#000099">LD = g++</font></tt>
<br><tt><font color="#000099">AR = ar -rus&nbsp;</font></tt><img SRC="images/new.jpg" ALT="[new!]" NOSAVE height=11 width=28>
<p><tt><font color="#000099"># Command for creating dependencies</font></tt>
<br><tt><font color="#FF0000"># Check the documentation of your compiler
if you don't know that...</font></tt>
<br><tt><font color="#000099">DEP = g++ -MM&nbsp;</font></tt><img SRC="images/new.jpg" ALT="[new!]" NOSAVE height=11 width=28>
<p><tt><font color="#000099"># Your librairies</font></tt>
<br><tt><font color="#000099"># (for example "-lm", but not needed on most
systems...)</font></tt>
<br><tt><font color="#000099">MYLIBS =</font></tt>
<p><tt><font color="#000099"># optimize mode</font></tt>
<br><tt><font color="#FF0000"># Comment one of these lines... OPT is for
optimized code,</font></tt>
<br><tt><font color="#FF0000"># and DBG for debug code (if you plan to
use a debugger)</font></tt>
<br><tt><font color="#000099">DEBUG = OPT</font></tt>
<br><tt><font color="#000099"># debug mode</font></tt>
<br><tt><font color="#000099">#DEBUG = DBG</font></tt>
<p><tt><font color="#FF0000"># Comment one of these lines... if you take
DOUBLE (and comment FLOAT)</font></tt>
<br><tt><font color="#FF0000"># the "real" variables will be "double".
Otherwise "float".</font></tt>
<br><tt><font color="#000099"># double version</font></tt>
<br><tt><font color="#000099">#FLOATING = DOUBLE</font></tt>
<br><tt><font color="#000099"># floating version</font></tt>
<br><tt><font color="#000099">FLOATING = FLOAT</font></tt>
<p><tt><font color="#FF0000"># Check here the flags for your compiler.</font></tt>
<br><tt><font color="#FF0000"># -DUSEDOUBLE is used to define USEDOUBLE
in the code (for CFLAGS_*_DOUBLE flags).</font></tt>
<br><tt><font color="#000099"># Debug double mode</font></tt>
<br><tt><font color="#000099">CFLAGS_DBG_DOUBLE = -g -Wall -pedantic-errors
-DUSEDOUBLE</font></tt>
<p><tt><font color="#000099"># Debug float mode</font></tt>
<br><tt><font color="#000099">CFLAGS_DBG_FLOAT = -g -Wall -pedantic-errors</font></tt>
<p><tt><font color="#000099"># Optimized double mode</font></tt>
<br><tt><font color="#000099">CFLAGS_OPT_DOUBLE = -Wall -pedantic-errors
-O9 -ffast-math -mcpu=i686 -march=i686 -malign-double -DUSEDOUBLE</font></tt>
<p><tt><font color="#000099"># Optimized float mode</font></tt>
<br><tt><font color="#000099">CFLAGS_OPT_FLOAT = -Wall -pedantic-errors
-O9 -ffast-math -mcpu=i686 -march=i686 -malign-double</font></tt>
<p><tt><font color="#FF0000"># Don't care about the end of the file</font></tt>
<br><tt><font color="#000099">[...]</font></tt>
<br>&nbsp;</blockquote>
<img SRC="images/boule.gif" ALT="[X]" NOSAVE height=12 width=12><b><u><font size=+1>Compile
the library</font></u></b>
<blockquote>That's easy. Just do "<tt>make depend</tt>" and then "<tt>make</tt>".
If you want you can use the option "<tt>-j</tt>" of the GNU make file (for
example "<tt>make -j 4</tt>"): it could improve the speed of the compilation,
especially on multiprocessor systems. If everything went ok, several directories
should have been created: <b><tt>objs</tt></b> in which you'll find all
the object files, and <b><tt>lib</tt></b> in which you'll find the library.
<p>You should'nt have any warning during the compilation... otherwise,
send me an email, if it's related to the code of the library.
<p>In fact, the following commands are available for <tt>make</tt>:
<ul>
<li>
<tt>make</tt> : compile the library</li>

<li>
<tt>make clean</tt> : remove the dependency files, the objects and the
library <i>for the current system</i>.</li>

<li>
<tt>make distclean</tt> : remove the dependency files, the objects and
the library <i>for all the systems</i>.</li>

<li>
<tt>make depend </tt>: create the dependency files.</li>
</ul>
</blockquote>
<img SRC="images/boule.gif" ALT="[X]" NOSAVE height=12 width=12><b><u><font size=+1>Compile
your program</font></u></b>
<blockquote>Create a directory in <b><tt>Torch</tt></b>. Go in this directory,
edit your program. Then copy in the directory the <b><tt>Makefile</tt></b>
that you'll found in <b><tt>Torch/config</tt></b>. After that, if the name
of you program is foo.cc, just do "<tt>make foo</tt>" (without the .<tt>cc
</tt>extension!).
A subdirectory will appear (with a name corresponding to your compilation
flags and your OS) with the program "<tt>foo</tt>"...</blockquote>

</body>
</html>