Linux: add a debug option to launch Scilab under rr
[scilab.git] / scilab / modules / core / help / pt_BR / scilab.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
3         xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml"
4         xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
5         xmlns:scilab="http://www.scilab.org" xml:id="scilab" xml:lang="pt">
6     <refnamediv>
7         <refname>scilab</refname>
8         <refpurpose>principal script para executar o Scilab e ferramentas de miscelânea
9         </refpurpose>
10     </refnamediv>
11     <refsynopsisdiv>
12         <title>Sqeüência de Chamamento</title>
13         <synopsis>
14 scilab &lt;Options&gt;
15         </synopsis>
16     </refsynopsisdiv>
17     <refsection role="arguments">
18         <title>Parâmetros</title>
19         <variablelist>
20             <varlistentry>
21                 <term>-args arg#1 arg#2 ..</term>
22                 <listitem>
23                     <para>
24                         This option allows to send some data to the Scilab session:
25                         <itemizedlist>
26                             <listitem>Consecutive data are separated by one or several spaces.
27                             </listitem>
28                             <listitem>An expression between double-quotes is a single data.
29                             </listitem>
30                             <listitem>To include a double-quote in a data, write <literal>\"</literal> instead of <literal>"</literal>.
31                             </listitem>
32                             <listitem>The single quote <literal>'</literal> is a regular character. It has no special meaning.
33                             </listitem>
34                         </itemizedlist>
35                     </para>
36                     <para>
37                       Inside the opened session, these data can be retrieved as separated strings with <link linkend="sciargs">sciargs()</link>.
38                      </para>
39                      <para>
40                       Example:
41                         <screen><![CDATA[C:\Users\Me> scilex -nb -args "Hello \"%USERNAME%\"" 1.2345 \"%cd%\"]]></screen>
42                         <programlisting><![CDATA[
43 // Inside the opened session:
44 a = sciargs()
45 i = find(a=="-args")
46 a(i+1)
47 evstr(a(i+2))*2
48 "This session has been launched from " + a(i+3)
49                         ]]>
50                         </programlisting>
51                         <screen><![CDATA[
52 --> // Inside the opened session:
53 --> a = sciargs()
54  a  =
55 !c:\SCIdir\bin\scilex  -nw  -nb  -noatomsautoload  -args  Hello "John"  1.2345  "C:\Users\Me" !
56
57 --> i = find(a=="-args")
58  i  =
59     5.
60
61 --> a(i+1)
62  ans  =
63  Hello "John"
64
65 --> evstr(a(i+2))*2
66  ans  =
67     2.469
68
69 --> "This session has been launched from " + a(i+3)
70  ans  =
71  This session has been launched from "C:\Users\Me"
72
73 -->
74 ]]></screen>
75                      </para>
76                      <para>
77                      <note>Using <literal>-args</literal> as the <emphasis role="italic">last</emphasis> command line option is safer.
78                      </note>
79                      </para>
80                 </listitem>
81             </varlistentry>
82             <varlistentry>
83                 <term>-display Display</term>
84                 <listitem>
85                     <para>Para uso apenas em sistemas Xwindow para ajustar um display de
86                         servidor X. O display padrão é unix:0.0
87                     </para>
88                     <para>
89                         <literal>-display</literal> pode ser abreviado por
90                         <literal>-d</literal>
91                     </para>
92                 </listitem>
93             </varlistentry>
94             <varlistentry>
95                 <term>-e Instructions</term>
96                 <listitem>
97                     <para>
98                         No final de toda a sessão de inicialização, esta opção
99                         <itemizedlist>
100                             <listitem>
101                                 <para>Define o diretório de trabalho atual para o diretório shell do qual o Scilab foi lançado. Por favor veja o exemplo dado aqui-abaixo para a opção <literal> -f </literal>. Então,
102                                 </para>
103                             </listitem>
104                             <listitem>
105                                 <para>executa dado Scilab <literal>Instructions</literal>. Exemplo :
106                                     <screen><![CDATA[ scilab-cli -e  "disp(\"Hello\"); a=%pi+%i; disp(exp(a)); exit;" -nb]]></screen>
107                                 </para>
108                             </listitem>
109                         </itemizedlist>
110                     </para>
111                     <warning>
112                         As opções <literal>-e</literal> e <literal>-f</literal> são mutuamente exclusivas.
113                     </warning>
114                 </listitem>
115             </varlistentry>
116             <varlistentry>
117                 <term>-f file</term>
118                 <listitem>
119                     <para>
120                         If this option is used, then at the beginning of the Scilab session, after the execution of the scilab and user startup files, and after the setting of user Preferences -- including the working directory ones --,
121                         <itemizedlist>
122                             <listitem>
123                                 <para>
124                                     the current Scilab working directory is set to the shell directory from which Scilab has been launched. For instance,
125                                     <screen><![CDATA[ D:\users\me\scilab\dev> C:\scilab-5.5.2\bin\scilex -f ..\test.sce]]></screen>
126                                     will do a <literal>cd("D:\users\me\scilab\dev")</literal>.
127                                 </para>
128                             </listitem>
129                             <listitem>
130                                 <para>
131                                     the Scilab script <literal>file</literal> is executed. If a relative path is used (default <literal>.\</literal>, or like <literal>..\</literal> in the sample here-above), it refers to the new Scilab working directory.
132                                 </para>
133                             </listitem>
134                         </itemizedlist>
135                     </para>
136                     <para>
137                         A file with .xcos extension will be opened by Xcos.
138                     </para>
139                 </listitem>
140             </varlistentry>
141             <varlistentry>
142                 <term>-quit</term>
143                 <listitem>
144                     <para>This option forces scilab to always exit after the instruction(s) passed with the <literal>-e</literal>
145                     option, or the script referred to by the <literal>-f</literal> option, have been executed,
146                     even in case of a runtime error. This option should always be used in batch mode.
147                     It is ignored if neither <literal>-e</literal> nor <literal>-f</literal> options are present.
148                     </para>
149                 </listitem>
150             </varlistentry>
151             <varlistentry>
152                 <term>-l idioma</term>
153                 <listitem>
154                     <para>Se esta opção estiver presente, ela fica o idioma do usuário.
155                         Os possíveis valores para <literal>idioma</literal> são
156                         <literal>'fr'</literal> para francês, <literal>'en'</literal> para
157                         inglês e 'br' para português brasileiro. O idioma padrão é inglês. O
158                         valor padrão é fixado no arquivo
159                         <literal>scilab.start</literal>.
160                     </para>
161                 </listitem>
162             </varlistentry>
163             <varlistentry>
164                 <term>-nb</term>
165                 <listitem>
166                     <para>"no banner" : Se esta opção está presente, então o cartão de boas-vindas não é impresso.
167                     </para>
168                 </listitem>
169             </varlistentry>
170             <varlistentry>
171                 <term>-ns</term>
172                 <listitem>
173                     <para>"No Startup files" : Se esta opção está presente, o arquivo de inicialização
174                         <literal>SCI/etc/scilab.start</literal> e os arquivos de
175                         inicialização do usuário <literal>SCIHOME/.scilab</literal>,
176                         <literal>SCIHOME/scilab.ini</literal> não são executados.
177                     </para>
178                 </listitem>
179             </varlistentry>
180             <varlistentry>
181                 <term>-nouserstartup</term>
182                 <listitem>
183                     <para>Se esta opção estiver presente, os arquivos de inicialização
184                         do usuário <literal>SCIHOME/.scilab</literal>,
185                         <literal>SCIHOME/scilab.ini</literal> não são executados.
186                     </para>
187                 </listitem>
188             </varlistentry>
189             <varlistentry>
190                 <term>-nw</term>
191                 <listitem>
192                     <para>Se esta opção estiver presente, então o Scilab não é executado
193                         em uma janela específica.
194                     </para>
195                 </listitem>
196             </varlistentry>
197             <varlistentry>
198                 <term>-nwni / -nogui</term>
199                 <listitem>
200                     <important>
201                         This mode prevents loading the Java Virtual Machine.
202                         It starts faster and uses less memory.
203                     </important>
204                     <para>Se esta opção estiver presente, então o Scilab não é executado
205                         em uma janela específica e não aceita interação do usuário
206                         (graphics, export, xcos, scinotes, help browser, Java module,...).
207                     </para>
208                 </listitem>
209             </varlistentry>
210             <varlistentry>
211                 <term>-scihome dir</term>
212                 <listitem>
213                     <para>Forces SCIHOME to the <literal>dir</literal> directory. If the path
214                       includes some white space, it must be specified between double-quotes (no
215                       single quotes!).
216                       if <literal>dir</literal> is a relative path, <literal>dir</literal> is add to parent standard SCIHOME folder.
217                       On Windows: %USERPROFILE%\AppData\Roaming\Scilab\<literal>dir</literal>
218                       On Linux/MacOS: ~/.Scilab/<literal>dir</literal>
219                     </para>
220                 </listitem>
221             </varlistentry>
222             <varlistentry>
223                 <term>--texmacs</term>
224                 <listitem>
225                     <para>Esta opção é reservada para TexMacs.</para>
226                 </listitem>
227             </varlistentry>
228             <varlistentry>
229                 <term>-version</term>
230                 <listitem>
231                     <para>Esta opção imprime a versão do Scilab.</para>
232                 </listitem>
233             </varlistentry>
234         </variablelist>
235     </refsection>
236     <refsection role="arguments">
237         <title>Additional options for Unix/Linux and Mac OS X</title>
238         <para>Advice: use theses options on a Scilab source tree.</para>
239         <variablelist>
240             <varlistentry>
241                 <term>-debug</term>
242                 <listitem>
243                     <para>Inicia o Scilab no debugger gdb.</para>
244                     <para>
245                         The variable <literal>SCILAB_GDB_OPT</literal> may be set to add custom options to gdb.
246                     </para>
247                 </listitem>
248             </varlistentry>
249             <varlistentry>
250                 <term>-debug-rr</term>
251                 <listitem>
252                     <para>Start Scilab under <ulink url="https://rr-project.org/">rr</ulink>.</para>
253                 </listitem>
254             </varlistentry>
255             <varlistentry>
256                 <term>-debug-kdbg</term>
257                 <listitem>
258                     <para>Start Scilab under kdbg.</para>
259                 </listitem>
260             </varlistentry>
261             <varlistentry>
262                 <term>-profiling</term>
263                 <listitem>
264                     <para>Start Scilab under valgrind.</para>
265                     <para>The variable SCILAB_VALGRIND_OPT may be set to add custom options
266                         to valgrind (and override the existing valgrind options).
267                     </para>
268                 </listitem>
269             </varlistentry>
270             <varlistentry>
271                 <term>-profiling-visu</term>
272                 <listitem>
273                     <para>Start Scilab under callgrind.</para>
274                     <para>The variable SCILAB_VALGRIND_OPT may be set to add custom options
275                         to callgrind (and override the existing callgrind options).
276                     </para>
277                 </listitem>
278             </varlistentry>
279             <varlistentry>
280                 <term>-electric-fence</term>
281                 <listitem>
282                     <para>Start Scilab with the Electric Fence.</para>
283                 </listitem>
284             </varlistentry>
285         </variablelist>
286     </refsection>
287     <refsection role="description">
288         <title>Environment variables</title>
289         <variablelist>
290             <varlistentry>
291                 <term>SCIVERBOSE</term>
292                 <listitem>
293                     <para>
294                         If this variable is present, Scilab startup script will show a startup debug information.
295                         Mainly used for bug report and debugging purposes.
296                     </para>
297                 </listitem>
298             </varlistentry>
299             <varlistentry>
300                 <term>JAVA_HOME</term>
301                 <listitem>
302                     <para>
303                         Specify which Java to use. For example,
304                         <literal>JAVA_HOME=/usr/lib/jvm/java-7-openjdk/ scilab</literal> will start Scilab with Java 7.
305                     </para>
306                 </listitem>
307             </varlistentry>
308             <varlistentry>
309                 <term>SCI_DISABLE_TK</term>
310                 <listitem>
311                     <para>Disable Tk (but not Tcl) features.</para>
312                 </listitem>
313             </varlistentry>
314             <varlistentry>
315                 <term>SCI_JAVA_ENABLE_HEADLESS</term>
316                 <listitem>
317                     <para>
318                         Enable Java Headless VM (i.e. without GUI features).
319                     </para>
320                 </listitem>
321             </varlistentry>
322         </variablelist>
323     </refsection>
324     <refsection role="description">
325         <title>Java Virtual Machine options</title>
326         <warning>
327             The options described here-below are useless and are cancelled if the option <literal>-nwni</literal> is used.
328         </warning>
329         <para>Starting from Scilab 5.0, the graphical user interface (GUI) and the
330             build documentation are based on Java features. In some cases, it can be
331             important to edit the JVM options (Java Virtual Machine).
332         </para>
333         <para>These options are available in the
334             <emphasis>jvm_options.xml</emphasis> file.
335         </para>
336         <para>In version 5.0.X and 5.1.X, this file is stored as
337             <emphasis>SCI/modules/jvm/etc/jvm_options.xml</emphasis>.
338         </para>
339         <para>In version &gt;= 5.2.0, the file is available in
340             <emphasis>etc/jvm_options.xml</emphasis>.
341         </para>
342         <para>
343             <emphasis>
344                 By default, the three following options are
345                 easily accessible in the configuration file:
346             </emphasis>
347         </para>
348         <variablelist>
349             <varlistentry>
350                 <term>-XmxXXXm</term>
351                 <listitem>
352                     <para>This option set the amount of memory available by the Java
353                         Virtual Machine. By default, 256M are allocated. If you change this
354                         value, check that the value does not exceed the memory available on
355                         the system.
356                     </para>
357                     <para>Since Scilab 5.4.0, this value can be changed in the preferences menu.</para>
358                 </listitem>
359             </varlistentry>
360             <varlistentry>
361                 <term>-Djava.compiler=JIT</term>
362                 <listitem>
363                     <para>
364                         This option with the argument <emphasis>JIT</emphasis> enables
365                         the Java Just In Time compiler. It is activated by default.
366                         <emphasis>NONE</emphasis> disables the JIT and decreases
367                         dramatically performances.
368                     </para>
369                 </listitem>
370             </varlistentry>
371             <varlistentry>
372                 <term>-verbose:jni / -Xcheck:jni</term>
373                 <listitem>
374                     <para>These options enable more checks and output from the JNI
375                         calls. These options are useful in case of debugging and are
376                         disabled by default since they decreases performances.
377                     </para>
378                 </listitem>
379             </varlistentry>
380         </variablelist>
381         <para>Many more options are available. They can improve the performances,
382             change look and feel, change memory managements... See: <ulink url="http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html">http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html</ulink>.
383         </para>
384     </refsection>
385     <refsection role="examples">
386         <title>Exemplos</title>
387         <screen><![CDATA[
388 # Let's start Scilab in profiling mode without attaching a gdb once a SIGSEGV is met.
389 # We are under Bash shell
390 export SCILAB_VALGRIND_OPT="--db-attach=no --log-file=myfile.txt"
391 scilab -profiling
392
393 # Let's start Scilab in debug mode without stopping after each SIGSEGV
394 # First, we write a small command file
395 echo "handle SIGSEGV nostop" &> debug.txt
396 # Now set the custom option
397 # We are under Bash shell
398 export SCILAB_GDB_OPT="--command=debug.txt"
399 # Start Scilab in debug mode
400 scilab -debug ]]></screen>
401         <para></para>
402         <screen><![CDATA[
403 # Under GNU/Linux, Mac OS X or Unix:
404 $ echo "disp(%pi)"|scilab-cli
405 or
406 $ echo "disp(%pi)"|scilab -nwni
407
408 # Only open the Scilab help window:
409 $ scilab-adv-cli -e "help()"
410 or
411 $ scilab -nw -e "help()"
412
413
414 # Scilab can be used for scripting aspects:
415 echo "if 1<>2 then exit(99) end"|scilab-cli
416 echo $? ]]></screen>
417     </refsection>
418     <refsection role="see also">
419         <title>Ver também</title>
420         <simplelist type="inline">
421             <member>
422                 <link linkend="startup">startup</link>
423             </member>
424             <member>
425                 <link linkend="sciargs">sciargs</link>
426             </member>
427             <member>
428                 <link linkend="getpid">getpid</link>
429             </member>
430             <member>
431                 <link linkend="getenv">getenv</link>
432             </member>
433             <member>
434                 <link linkend="getversion">getversion</link>
435             </member>
436             <member>
437                 <link linkend="consolebox">consolebox</link>
438             </member>
439             <member>
440                 <link linkend="exit">exit</link>
441             </member>
442         </simplelist>
443     </refsection>
444     <refsection role="history">
445         <title>Histórico</title>
446         <revhistory>
447             <revision>
448                 <revnumber>5.4.0</revnumber>
449                 <revremark>-noatomsautoload added.</revremark>
450             </revision>
451             <revision>
452                 <revnumber>5.4.1</revnumber>
453                 <revremark>scinotes and xcos individual scripts introduced. See SEP #87.</revremark>
454             </revision>
455             <revision>
456                 <revnumber>6.0.0</revnumber>
457                 <revremark>
458                     <literal>-quit</literal> option added. <literal>-mem</literal> option removed.
459                 </revremark>
460             </revision>
461             <revision>
462                 <revnumber>6.0.1</revnumber>
463                 <revremark>
464                     <literal>-scihome</literal> option added.
465                 </revremark>
466             </revision>
467         </revhistory>
468     </refsection>
469     <!--add some kewywords -->
470     <refnamediv xml:id="wscilex"></refnamediv>
471     <refnamediv xml:id="wscilex-cli"></refnamediv>
472     <refnamediv xml:id="scilex"></refnamediv>
473     <refnamediv xml:id="scilab-cli"></refnamediv>
474     <refnamediv xml:id="scilab-adv-cli"></refnamediv>
475 </refentry>