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 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.1, http://www.gnu.org/software/texinfo/ -->
<head>
<title>GNU Octave: System Information</title>
<meta name="description" content="GNU Octave: System Information">
<meta name="keywords" content="GNU Octave: System Information">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="System-Utilities.html#System-Utilities" rel="up" title="System Utilities">
<link href="Hashing-Functions.html#Hashing-Functions" rel="next" title="Hashing Functions">
<link href="Group-Database-Functions.html#Group-Database-Functions" rel="prev" title="Group Database Functions">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en">
<a name="System-Information"></a>
<div class="header">
<p>
Next: <a href="Hashing-Functions.html#Hashing-Functions" accesskey="n" rel="next">Hashing Functions</a>, Previous: <a href="Group-Database-Functions.html#Group-Database-Functions" accesskey="p" rel="prev">Group Database Functions</a>, Up: <a href="System-Utilities.html#System-Utilities" accesskey="u" rel="up">System Utilities</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="System-Information-1"></a>
<h3 class="section">36.11 System Information</h3>
<a name="XREFcomputer"></a><dl>
<dt><a name="index-computer"></a>Function File: <em></em> <strong>computer</strong> <em>()</em></dt>
<dt><a name="index-computer-1"></a>Function File: <em><var>c</var> =</em> <strong>computer</strong> <em>()</em></dt>
<dt><a name="index-computer-2"></a>Function File: <em>[<var>c</var>, <var>maxsize</var>] =</em> <strong>computer</strong> <em>()</em></dt>
<dt><a name="index-computer-3"></a>Function File: <em>[<var>c</var>, <var>maxsize</var>, <var>endian</var>] =</em> <strong>computer</strong> <em>()</em></dt>
<dt><a name="index-computer-4"></a>Function File: <em><var>arch</var> =</em> <strong>computer</strong> <em>("arch")</em></dt>
<dd><p>Print or return a string of the form <var>cpu</var>-<var>vendor</var>-<var>os</var> that
identifies the type of computer that Octave is running on.
</p>
<p>If invoked with an output argument, the value is returned instead of
printed. For example:
</p>
<div class="example">
<pre class="example">computer ()
-| i586-pc-linux-gnu
mycomp = computer ()
⇒ mycomp = "i586-pc-linux-gnu"
</pre></div>
<p>If two output arguments are requested, also return the maximum number of
elements for an array. This will depend on whether Octave has been
compiled with 32-bit or 64-bit index vectors.
</p>
<p>If three output arguments are requested, also return the byte order of the
current system as a character (<code>"B"</code> for big-endian or <code>"L"</code>
for little-endian).
</p>
<p>If the argument <code>"arch"</code> is specified, return a string indicating the
architecture of the computer on which Octave is running.
</p>
<p><strong>See also:</strong> <a href="#XREFisunix">isunix</a>, <a href="#XREFismac">ismac</a>, <a href="#XREFispc">ispc</a>.
</p></dd></dl>
<a name="XREFuname"></a><dl>
<dt><a name="index-uname"></a>Built-in Function: <em>[<var>uts</var>, <var>err</var>, <var>msg</var>] =</em> <strong>uname</strong> <em>()</em></dt>
<dd><p>Return system information in the structure.
</p>
<p>For example:
</p>
<div class="example">
<pre class="example">uname ()
⇒ {
sysname = x86_64
nodename = segfault
release = 2.6.15-1-amd64-k8-smp
version = Linux
machine = #2 SMP Thu Feb 23 04:57:49 UTC 2006
}
</pre></div>
<p>If successful, <var>err</var> is 0 and <var>msg</var> is an empty string.
Otherwise, <var>err</var> is nonzero and <var>msg</var> contains a
system-dependent error message.
</p></dd></dl>
<a name="XREFnproc"></a><dl>
<dt><a name="index-nproc"></a>Built-in Function: <em></em> <strong>nproc</strong> <em>()</em></dt>
<dt><a name="index-nproc-1"></a>Built-in Function: <em></em> <strong>nproc</strong> <em>(<var>query</var>)</em></dt>
<dd><p>Return the current number of available processors.
</p>
<p>If called with the optional argument <var>query</var>, modify how processors
are counted as follows:
</p>
<dl compact="compact">
<dt><code>all</code></dt>
<dd><p>total number of processors.
</p>
</dd>
<dt><code>current</code></dt>
<dd><p>processors available to the current process.
</p>
</dd>
<dt><code>overridable</code></dt>
<dd><p>same as <code>current</code>, but overridable through the <code><span class="nolinebreak">OMP_NUM_THREADS</span></code><!-- /@w -->
environment variable.
</p></dd>
</dl>
</dd></dl>
<a name="XREFispc"></a><dl>
<dt><a name="index-ispc"></a>Function File: <em></em> <strong>ispc</strong> <em>()</em></dt>
<dd><p>Return true if Octave is running on a Windows system and false otherwise.
</p>
<p><strong>See also:</strong> <a href="#XREFisunix">isunix</a>, <a href="#XREFismac">ismac</a>.
</p></dd></dl>
<a name="XREFisunix"></a><dl>
<dt><a name="index-isunix"></a>Function File: <em></em> <strong>isunix</strong> <em>()</em></dt>
<dd><p>Return true if Octave is running on a Unix-like system and false otherwise.
</p>
<p><strong>See also:</strong> <a href="#XREFismac">ismac</a>, <a href="#XREFispc">ispc</a>.
</p></dd></dl>
<a name="XREFismac"></a><dl>
<dt><a name="index-ismac"></a>Function File: <em></em> <strong>ismac</strong> <em>()</em></dt>
<dd><p>Return true if Octave is running on a Mac OS X system and false otherwise.
</p>
<p><strong>See also:</strong> <a href="#XREFisunix">isunix</a>, <a href="#XREFispc">ispc</a>.
</p></dd></dl>
<a name="XREFisieee"></a><dl>
<dt><a name="index-isieee"></a>Built-in Function: <em></em> <strong>isieee</strong> <em>()</em></dt>
<dd><p>Return true if your computer <em>claims</em> to conform to the IEEE standard
for floating point calculations.
</p>
<p>No actual tests are performed.
</p></dd></dl>
<a name="XREFisdeployed"></a><dl>
<dt><a name="index-isdeployed"></a>Function File: <em></em> <strong>isdeployed</strong> <em>()</em></dt>
<dd><p>Return true if the current program has been compiled and is running
separately from the Octave interpreter and false if it is running in
the Octave interpreter.
</p>
<p>Currently, this function always returns false in Octave.
</p></dd></dl>
<a name="XREFisstudent"></a><dl>
<dt><a name="index-isstudent"></a>Built-in Function: <em></em> <strong>isstudent</strong> <em>()</em></dt>
<dd><p>Return true if running in the student edition of <small>MATLAB</small>.
</p>
<p><code>isstudent</code> always returns false in Octave.
</p>
<p><strong>See also:</strong> <a href="Logical-Values.html#XREFfalse">false</a>.
</p></dd></dl>
<a name="XREFOCTAVE_005fHOME"></a><dl>
<dt><a name="index-OCTAVE_005fHOME"></a>Built-in Function: <em></em> <strong>OCTAVE_HOME</strong> <em>()</em></dt>
<dd><p>Return the name of the top-level Octave installation directory.
</p>
<p><strong>See also:</strong> <a href="Controlling-Subprocesses.html#XREFEXEC_005fPATH">EXEC_PATH</a>, <a href="Loading-and-Saving-Images.html#XREFIMAGE_005fPATH">IMAGE_PATH</a>.
</p></dd></dl>
<a name="XREFmatlabroot"></a><dl>
<dt><a name="index-matlabroot"></a>Function File: <em></em> <strong>matlabroot</strong> <em>()</em></dt>
<dd><p>Return the name of the top-level Octave installation directory.
</p>
<p>This is an alias for the function <code><span class="nolinebreak">OCTAVE_HOME</span></code><!-- /@w --> provided for
compatibility.
</p>
<p><strong>See also:</strong> <a href="#XREFOCTAVE_005fHOME">OCTAVE_HOME</a>.
</p></dd></dl>
<a name="XREFOCTAVE_005fVERSION"></a><dl>
<dt><a name="index-OCTAVE_005fVERSION"></a>Built-in Function: <em></em> <strong>OCTAVE_VERSION</strong> <em>()</em></dt>
<dd><p>Return the version number of Octave as a string.
</p>
<p><strong>See also:</strong> <a href="#XREFver">ver</a>, <a href="#XREFversion">version</a>.
</p></dd></dl>
<a name="XREFversion"></a><dl>
<dt><a name="index-version"></a>Function File: <em></em> <strong>version</strong> <em>()</em></dt>
<dd><p>Return the version number of Octave as a string.
</p>
<p>This is an alias for the function <code><span class="nolinebreak">OCTAVE_VERSION</span></code><!-- /@w --> provided for
compatibility.
</p>
<p><strong>See also:</strong> <a href="#XREFOCTAVE_005fVERSION">OCTAVE_VERSION</a>, <a href="#XREFver">ver</a>.
</p></dd></dl>
<a name="XREFver"></a><dl>
<dt><a name="index-ver"></a>Function File: <em></em> <strong>ver</strong></dt>
<dt><a name="index-ver-1"></a>Function File: <em></em> <strong>ver</strong> <em>Octave</em></dt>
<dt><a name="index-ver-2"></a>Function File: <em></em> <strong>ver</strong> <em><var>package</var></em></dt>
<dt><a name="index-ver-3"></a>Function File: <em>v =</em> <strong>ver</strong> <em>(…)</em></dt>
<dd>
<p>Display a header containing the current Octave version number, license
string, and operating system. The header is followed by a list of installed
packages, versions, and installation directories.
</p>
<p>Use the package name <var>package</var> or Octave to limit the listing to a
desired component.
</p>
<p>When called with an output argument, return a vector of structures
describing Octave and each installed package. The structure includes the
following fields.
</p>
<dl compact="compact">
<dt><code>Name</code></dt>
<dd><p>Package name.
</p>
</dd>
<dt><code>Version</code></dt>
<dd><p>Version of the package.
</p>
</dd>
<dt><code>Revision</code></dt>
<dd><p>Revision of the package.
</p>
</dd>
<dt><code>Date</code></dt>
<dd><p>Date of the version/revision.
</p></dd>
</dl>
<p><strong>See also:</strong> <a href="#XREFversion">version</a>, <a href="#XREFoctave_005fconfig_005finfo">octave_config_info</a>, <a href="Java-Interface-Functions.html#XREFusejava">usejava</a>, <a href="Installing-and-Removing-Packages.html#XREFpkg">pkg</a>.
</p></dd></dl>
<a name="XREFcompare_005fversions"></a><dl>
<dt><a name="index-compare_005fversions"></a>Function File: <em></em> <strong>compare_versions</strong> <em>(<var>v1</var>, <var>v2</var>, <var>operator</var>)</em></dt>
<dd><p>Compare two version strings using the given <var>operator</var>.
</p>
<p>This function assumes that versions <var>v1</var> and <var>v2</var> are arbitrarily
long strings made of numeric and period characters possibly followed by an
arbitrary string (e.g., <code>"1.2.3"</code>, <code>"0.3"</code>, <code>"0.1.2+"</code>,
or <code>"1.2.3.4-test1"</code>).
</p>
<p>The version is first split into numeric and character portions and then
the parts are padded to be the same length (i.e., <code>"1.1"</code> would be
padded to be <code>"1.1.0"</code> when being compared with <code>"1.1.1"</code>, and
separately, the character parts of the strings are padded with nulls).
</p>
<p>The operator can be any logical operator from the set
</p>
<ul>
<li> <code>"=="</code>
equal
</li><li> <code>"<"</code>
less than
</li><li> <code>"<="</code>
less than or equal to
</li><li> <code>">"</code>
greater than
</li><li> <code>">="</code>
greater than or equal to
</li><li> <code>"!="</code>
not equal
</li><li> <code>"~="</code>
not equal
</li></ul>
<p>Note that version <code>"1.1-test2"</code> will compare as greater than
<code>"1.1-test10"</code>. Also, since the numeric part is compared first,
<code>"a"</code> compares less than <code>"1a"</code> because the second string
starts with a numeric part even though <code>double ("a")</code> is greater than
<code>double ("1").</code>
</p></dd></dl>
<a name="XREFlicense"></a><dl>
<dt><a name="index-license"></a>Command: <em></em> <strong>license</strong></dt>
<dt><a name="index-license-1"></a>Command: <em></em> <strong>license</strong> <em>inuse</em></dt>
<dt><a name="index-license-2"></a>Command: <em></em> <strong>license</strong> <em>inuse <var>feature</var></em></dt>
<dt><a name="index-license-3"></a>Function File: <em></em> <strong>license</strong> <em>("inuse")</em></dt>
<dt><a name="index-license-4"></a>Function File: <em><var>retval</var> =</em> <strong>license</strong> <em>("inuse")</em></dt>
<dt><a name="index-license-5"></a>Function File: <em><var>retval</var> =</em> <strong>license</strong> <em>("test", <var>feature</var>)</em></dt>
<dt><a name="index-license-6"></a>Function File: <em><var>retval</var> =</em> <strong>license</strong> <em>("checkout", <var>feature</var>)</em></dt>
<dt><a name="index-license-7"></a>Function File: <em>[<var>retval</var>, <var>errmsg</var>] =</em> <strong>license</strong> <em>("checkout", <var>feature</var>)</em></dt>
<dd><p>Get license information for Octave and Octave packages.
</p>
<p>GNU Octave is free software distributed under the GNU General Public
License (GPL), and a license manager makes no sense. This function is
provided only for <small>MATLAB</small> compatibility.
</p>
<p>When called with no extra input arguments, it returns the Octave license,
otherwise the first input defines the operation mode and must be one of
the following strings: <code>inuse</code>, <code>test</code>, and <code>checkout</code>.
The optional <var>feature</var> argument can either be <code>"octave"</code> (core),
or an Octave package.
</p>
<dl compact="compact">
<dt><code>"inuse"</code></dt>
<dd><p>Returns a list of loaded features, i.e., octave and the list of loaded
packages. If an output is requested, it returns a struct array with
the fields <code>"feature"</code>, and <code>"user"</code>.
</p>
</dd>
<dt><code>"test"</code></dt>
<dd><p>Return true if the specified <var>feature</var> is installed, false otherwise.
</p>
<p>An optional third argument <code>"enable"</code> or <code>"disable"</code> is
accepted but ignored.
</p>
</dd>
<dt><code>"checkout"</code></dt>
<dd><p>Return true if the specified <var>feature</var> is installed, false otherwise.
An optional second output will have an error message if a package is not
installed.
</p>
</dd>
</dl>
<p><strong>See also:</strong> <a href="Installing-and-Removing-Packages.html#XREFpkg">pkg</a>, <a href="#XREFver">ver</a>, <a href="#XREFversion">version</a>.
</p></dd></dl>
<a name="XREFoctave_005fconfig_005finfo"></a><dl>
<dt><a name="index-octave_005fconfig_005finfo"></a>Built-in Function: <em></em> <strong>octave_config_info</strong> <em>()</em></dt>
<dt><a name="index-octave_005fconfig_005finfo-1"></a>Built-in Function: <em></em> <strong>octave_config_info</strong> <em>(<var>option</var>)</em></dt>
<dd><p>Return a structure containing configuration and installation information for
Octave.
</p>
<p>If <var>option</var> is a string, return the configuration information for the
specified option.
</p>
<p><strong>See also:</strong> <a href="#XREFcomputer">computer</a>.
</p></dd></dl>
<a name="XREFgetrusage"></a><dl>
<dt><a name="index-getrusage"></a>Built-in Function: <em></em> <strong>getrusage</strong> <em>()</em></dt>
<dd><p>Return a structure containing a number of statistics about the current
Octave process.
</p>
<p>Not all fields are available on all systems. If it is not possible to get
CPU time statistics, the CPU time slots are set to zero. Other missing data
are replaced by NaN. The list of possible fields is:
</p>
<dl compact="compact">
<dt><code>idrss</code></dt>
<dd><p>Unshared data size.
</p>
</dd>
<dt><code>inblock</code></dt>
<dd><p>Number of block input operations.
</p>
</dd>
<dt><code>isrss</code></dt>
<dd><p>Unshared stack size.
</p>
</dd>
<dt><code>ixrss</code></dt>
<dd><p>Shared memory size.
</p>
</dd>
<dt><code>majflt</code></dt>
<dd><p>Number of major page faults.
</p>
</dd>
<dt><code>maxrss</code></dt>
<dd><p>Maximum data size.
</p>
</dd>
<dt><code>minflt</code></dt>
<dd><p>Number of minor page faults.
</p>
</dd>
<dt><code>msgrcv</code></dt>
<dd><p>Number of messages received.
</p>
</dd>
<dt><code>msgsnd</code></dt>
<dd><p>Number of messages sent.
</p>
</dd>
<dt><code>nivcsw</code></dt>
<dd><p>Number of involuntary context switches.
</p>
</dd>
<dt><code>nsignals</code></dt>
<dd><p>Number of signals received.
</p>
</dd>
<dt><code>nswap</code></dt>
<dd><p>Number of swaps.
</p>
</dd>
<dt><code>nvcsw</code></dt>
<dd><p>Number of voluntary context switches.
</p>
</dd>
<dt><code>oublock</code></dt>
<dd><p>Number of block output operations.
</p>
</dd>
<dt><code>stime</code></dt>
<dd><p>A structure containing the system CPU time used. The structure has the
elements <code>sec</code> (seconds) <code>usec</code> (microseconds).
</p>
</dd>
<dt><code>utime</code></dt>
<dd><p>A structure containing the user CPU time used. The structure has the
elements <code>sec</code> (seconds) <code>usec</code> (microseconds).
</p></dd>
</dl>
</dd></dl>
<hr>
<div class="header">
<p>
Next: <a href="Hashing-Functions.html#Hashing-Functions" accesskey="n" rel="next">Hashing Functions</a>, Previous: <a href="Group-Database-Functions.html#Group-Database-Functions" accesskey="p" rel="prev">Group Database Functions</a>, Up: <a href="System-Utilities.html#System-Utilities" accesskey="u" rel="up">System Utilities</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|