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:ns4="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="en">
7 <refname>scilab</refname>
8 <refpurpose>runs Scilab in interactive or batch mode with command line options
14 scilab <Options>
17 <refsection role="arguments">
18 <title>Options</title>
21 <term>-args arg#1 arg#2 ..</term>
24 This option allows to send some data to the Scilab session:
26 <listitem>Consecutive data are separated by one or several spaces.
28 <listitem>An expression between double-quotes is a single data.
30 <listitem>To include a double-quote in a data, write <literal>\"</literal> instead of <literal>"</literal>.
32 <listitem>The single quote <literal>'</literal> is a regular character. It has no special meaning.
37 Inside the opened session, these data can be retrieved as separated strings with <link linkend="sciargs">sciargs()</link>.
41 <screen><![CDATA[C:\Users\Me> scilex -nb -noatomsautoload -args "Hello \"%USERNAME%\"" 1.2345 \"%cd%\"]]></screen>
42 <programlisting><![CDATA[
43 // Inside the opened session:
48 "This session has been launched from " + a(i+3)
52 --> // Inside the opened session:
55 !c:\SCIdir\bin\scilex -nw -nb -noatomsautoload -args Hello "John" 1.2345 "C:\Users\Me" !
57 --> i = find(a=="-args")
69 --> "This session has been launched from " + a(i+3)
71 This session has been launched from "C:\Users\Me"
75 <note>Using <literal>-args</literal> as the <emphasis role="italic">last</emphasis> command line option is safer.
81 <term>-display Display</term>
84 For use under Xwindow systems only to set a specific X server
85 display. Default display is unix:0.0.
88 <literal>-display</literal> can be abbreviated by
89 <literal>-d</literal>.
94 <term>-e Instructions</term>
97 At the end of the whole session startup, this option
100 <para>sets the current working directory to the shell directory from which Scilab has been launched. Please see the example given here-below for the <literal>-f</literal> option. Then,
104 <para>executes Scilab <literal>Instructions</literal> provided in a string. Example:
105 <screen><![CDATA[ scilab-cli -e "disp(\"Hello\"); a=%pi+%i; disp(exp(a)); exit;" -nb]]></screen>
111 <literal>-e</literal> and <literal>-f</literal> options can't be used together.
119 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 --,
123 the current Scilab working directory is set to the shell directory from which Scilab has been launched. For instance,
124 <screen><![CDATA[ D:\users\me\scilab\dev> C:\scilab-5.5.2\bin\scilex -f ..\test.sce]]></screen>
125 will do a <literal>cd("D:\users\me\scilab\dev")</literal>.
130 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.
136 A file with .xcos extension will be opened by Xcos.
144 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.
154 <para>If this option is present it fixes the user language.
155 <emphasis>lang</emphasis> can be: <emphasis>ca_ES de_DE en_US es_ES
156 fr_FR ja_JP pt_BR ru_RU zh_CN zh_TW
157 </emphasis> (from Scilab 5.2).
160 Other possible <literal>lang</literal> values are
161 <literal>'fr'</literal> for french and <literal>'en'</literal> for
162 English for compatibility reasons. The default language is English.
163 This default value is fixed the <literal>scilab.start</literal> file.
165 <para>On some systems, locales must be compiled to render correctly
168 <para>Scilab can be also called the following way:</para>
169 <screen><![CDATA[ LANG=ja_JP scilab
178 <para>"no banner": Cancels the display of the Scilab's loading message.
185 <para>"No Startup files": Cancels the execution of the main startup file
186 <literal>SCI/etc/scilab.start</literal> and of the user startup files
187 <literal>SCIHOME/.scilab</literal>,
188 <literal>SCIHOME/scilab.ini</literal>.
190 <para>This option will disable many features in Scilab (Only use if
191 you know what you are doing).
196 <term>-nouserstartup</term>
198 <para>Cancels the execution of the user startup files
199 <literal>SCIHOME/.scilab</literal> and
200 <literal>SCIHOME/scilab.ini</literal>.
205 <term>-noatomsautoload</term>
207 <para>Cancels the autoloading of installed ATOMS modules at startup.</para>
213 <para>If this option is present, Scilab is started as command line
214 with advanced features still available (graphics, export, xcos, scinotes, help browser, ...).
220 <para>pipes are enabled for all operating systems (see the
221 examples for further details).
225 <para>Scilab distribution also provides a dedicated binary which
226 is doing the same as <literal>-nw</literal>:
229 Windows: <literal>WScilex-cli.exe</literal>.
232 <literal>scilab-adv-cli</literal> (Scilab Advanced Command Line Interpreter).
242 <term>-nwni / -nogui</term>
245 This mode prevents loading the Java Virtual Machine.
246 It starts faster and uses less memory. But then...
249 Scilab is started as command line interpreter without any advanced features
250 requiring the JVM: graphics, export, xcos, scinotes, help browser, other
251 java interfaces, the Java module,... are not available.
257 <para>pipes are enabled for all operating systems (see the
258 examples for further details).
264 <para>Scilab distribution also provides a dedicated binary which
265 is doing the same as <literal>-nwni</literal>:
268 Windows: <literal>Scilex.exe</literal>.
271 Others: <literal>scilab-cli</literal> (Scilab Command Line Interpreter).
281 <term>-scihome dir</term>
283 <para>Forces SCIHOME to the <literal>dir</literal> directory. If the path
284 includes some white space, it must be specified between double-quotes (no
286 if <literal>dir</literal> is a relative path, <literal>dir</literal> is add to parent standard SCIHOME folder.
287 On Windows: %USERPROFILE%\AppData\Roaming\Scilab\<literal>dir</literal>
288 On Linux/MacOS: ~/.Scilab/<literal>dir</literal>
293 <term>--texmacs</term>
295 <para>This option is reserved for the external TeXMacs module.
296 This one can be priorly installed with <code>atomsInstall('texmacs')</code>.
301 <term>-version</term>
303 <para>displays the Scilab's version (before the main Scilab's startup).</para>
308 <refsection role="arguments">
309 <title>Additional options for Unix/Linux and Mac OS X</title>
310 <para>Advice: use theses options on a Scilab source tree.</para>
315 <para>Start Scilab under the debugger gdb.</para>
317 The variable <literal>SCILAB_GDB_OPT</literal> may be set to add custom options to gdb.
322 <term>-debug-rr</term>
324 <para>Start Scilab under <ulink url="https://rr-project.org/">rr</ulink>.</para>
328 <term>-debug-kdbg</term>
330 <para>Start Scilab under kdbg.</para>
334 <term>-profiling</term>
336 <para>Start Scilab under valgrind.</para>
337 <para>The variable SCILAB_VALGRIND_OPT may be set to add custom options
338 to valgrind (and override the existing valgrind options).
343 <term>-profiling-visu</term>
345 <para>Start Scilab under callgrind.</para>
346 <para>The variable SCILAB_VALGRIND_OPT may be set to add custom options
347 to callgrind (and override the existing callgrind options).
352 <term>-electric-fence</term>
354 <para>Start Scilab with the Electric Fence.</para>
359 <refsection role="description">
360 <title>Environment variables</title>
363 <term>SCIVERBOSE</term>
366 If this variable is present, Scilab startup script will show a startup debug information.
367 Mainly used for bug report and debugging purposes.
372 <term>JAVA_HOME</term>
375 Specify which Java to use. For example,
376 <literal>JAVA_HOME=/usr/lib/jvm/java-7-openjdk/ scilab</literal> will start Scilab with Java 7.
381 <term>SCI_DISABLE_TK</term>
383 <para>Disable Tk (but not Tcl) features.</para>
387 <term>SCI_JAVA_ENABLE_HEADLESS</term>
390 Enable Java Headless VM (i.e. without GUI features).
396 <refsection role="description">
397 <title>Java Virtual Machine options</title>
399 The options described here-below are useless and are cancelled if the option <literal>-nwni</literal> is used.
401 <para>Starting from Scilab 5.0, the graphical user interface (GUI) and the
402 build documentation are based on Java features. In some cases, it can be
403 important to edit the JVM options (Java Virtual Machine).
405 <para>These options are available in the
406 <emphasis>jvm_options.xml</emphasis> file.
408 <para>In version 5.0.X and 5.1.X, this file is stored as
409 <emphasis>SCI/modules/jvm/etc/jvm_options.xml</emphasis>.
411 <para>In version >= 5.2.0, the file is available in
412 <emphasis>etc/jvm_options.xml</emphasis>.
416 By default, the three following options are
417 easily accessible in the configuration file:
422 <term>-XmxXXXm</term>
424 <para>This option set the amount of memory available by the Java
425 Virtual Machine. By default, 256M are allocated. If you change this
426 value, check that the value does not exceed the memory available on
429 <para>Since Scilab 5.4.0, this value can be changed in the preferences menu.</para>
433 <term>-Djava.compiler=JIT</term>
436 This option with the argument <emphasis>JIT</emphasis> enables
437 the Java Just In Time compiler. It is activated by default.
438 <emphasis>NONE</emphasis> disables the JIT and decreases
439 dramatically performances.
444 <term>-verbose:jni / -Xcheck:jni</term>
446 <para>These options enable more checks and output from the JNI
447 calls. These options are useful in case of debugging and are
448 disabled by default since they decreases performances.
453 <para>Many more options are available. They can improve the performances,
454 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>.
457 <refsection role="examples">
458 <title>Examples</title>
460 # Let's start Scilab in profiling mode without attaching a gdb once a SIGSEGV is met.
461 # We are under Bash shell
462 export SCILAB_VALGRIND_OPT="--db-attach=no --log-file=myfile.txt"
465 # Let's start Scilab in debug mode without stopping after each SIGSEGV
466 # First, we write a small command file
467 echo "handle SIGSEGV nostop" > debug.txt
468 # Now set the custom option
469 # We are under Bash shell
470 export SCILAB_GDB_OPT="--command=debug.txt"
471 # Start Scilab in debug mode
472 scilab -debug ]]></screen>
475 # Under GNU/Linux, Mac OS X or Unix:
476 $ echo "disp(%pi)"|scilab-cli
478 $ echo "disp(%pi)"|scilab -nwni
480 # Only open the Scilab help window:
481 $ scilab-adv-cli -e "help()"
483 $ scilab -nw -e "help()"
486 # Scilab can be used for scripting aspects:
487 echo "if 1<>2 then exit(99) end"|scilab-cli
490 <refsection role="see also">
491 <title>See also</title>
492 <simplelist type="inline">
494 <link linkend="startup">startup</link>
497 <link linkend="sciargs">sciargs</link>
500 <link linkend="getpid">getpid</link>
503 <link linkend="getenv">getenv</link>
506 <link linkend="getversion">getversion</link>
509 <link linkend="consolebox">consolebox</link>
512 <link linkend="exit">exit</link>
516 <refsection role="history">
517 <title>History</title>
520 <revnumber>5.4.0</revnumber>
521 <revremark>-noatomsautoload added.</revremark>
524 <revnumber>5.4.1</revnumber>
525 <revremark>scinotes and xcos individual scripts introduced. See SEP #87.</revremark>
528 <revnumber>6.0.0</revnumber>
530 <literal>-quit</literal> option added. <literal>-mem</literal> option removed.
534 <revnumber>6.0.1</revnumber>
536 <para><literal>-scihome</literal> option added.</para>
537 <para>On Windows, a new <literal>scilab.bat</literal> file becomes the main
538 executable script managing all launching options. There are now 3 binaries
539 Wscilex.exe, Wscilex-cli.exe, and Scilex.exe corresponding to each Scilab
540 running mode (STD, NW, NWNI).
546 <!--add some kewywords -->
547 <refnamediv xml:id="wscilex"></refnamediv>
548 <refnamediv xml:id="wscilex-cli"></refnamediv>
549 <refnamediv xml:id="scilex"></refnamediv>
550 <refnamediv xml:id="scilab-cli"></refnamediv>
551 <refnamediv xml:id="scilab-adv-cli"></refnamediv>