### 36.11 System Information

— Function File: [c, maxsize, endian] = computer ()
— Function File: arch = computer ("arch")

> Print or return a string of the form cpu-vendor-os that identifies the kind of computer Octave is running on. If invoked with an output argument, the value is returned instead of printed. For example:

>               computer ()
>                    -| i586-pc-linux-gnu

>               x = computer ()
>                    ⇒ x = "i586-pc-linux-gnu"

> If two output arguments are requested, also return the maximum number of elements for an array.

> If three output arguments are requested, also return the byte order of the current system as a character (`"B"` for big-endian or `"L"` for little-endian).

> If the argument `"arch"` is specified, return a string indicating the architecture of the computer on which Octave is running.

— Built-in Function: [uts, err, msg] = uname ()

> Return system information in the structure. For 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
>                        }

> If successful, err is 0 and msg is an empty string. Otherwise, err is nonzero and msg contains a system-dependent error message.

— Loadable Function: nproc ()
— Loadable Function: nproc (query)

> Return the current number of available processors.

> If called with the optional argument query, modify how processors are counted as follows:

> `all`
>   total number of processors.
> `current`
>   processors available to the current process.
> `overridable`
>   likewise, but overridable through the `OMP_NUM_THREADS` environment variable.

— Function File: ispc ()

> Return true if Octave is running on a Windows system and false otherwise.

> See also: isunix, ismac.

— Function File: isunix ()

> Return true if Octave is running on a Unix-like system and false otherwise.

> See also: ismac, ispc.

— Function File: ismac ()

> Return true if Octave is running on a Mac OS X system and false otherwise.

> See also: isunix, ispc.

— Built-in Function: isieee ()

> Return true if your computer claims to conform to the IEEE standard for floating point calculations. No actual tests are performed.

— Function File: isdeployed ()

> 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. Currently, this function always returns false in Octave.

— Built-in Function: OCTAVE_HOME ()

> Return the name of the top-level Octave installation directory.

— Function File: matlabroot ()

> Return the name of the top-level Octave installation directory.

> This is an alias for the function `OCTAVE_HOME` provided for compatibility.

> See also: OCTAVE_HOME.

— Built-in Function: OCTAVE_VERSION ()

> Return the version number of Octave, as a string.

— Function File: version ()

> Return the version number of Octave, as a string.

> This is an alias for the function `OCTAVE_VERSION` provided for compatibility

> See also: OCTAVE_VERSION..

— Function File: ver ()

> Display a header containing the current Octave version number, license string and operating system, followed by the installed package names, versions, and installation directories. — Function File: v = ver ()

> > Return a vector of structures, respecting Octave and each installed package. The structure includes the following fields.

> > `Name`
> >   Package name.
> > `Version`
> >   Version of the package.
> > `Revision`
> >   Revision of the package.
> > `Date`
> >   Date respecting the version/revision.
> > — Function File: v = ver ("Octave")

> > > Return version information for Octave only. — Function File: v = ver (package)

> > > > Return version information for package.

> > > > See also: version, octave_config_info.

— Function File: compare_versions (v1, v2, operator)

> Compare two version strings using the given operator.

> This function assumes that versions v1 and v2 are arbitrarily long strings made of numeric and period characters possibly followed by an arbitrary string (e.g., "1.2.3", "0.3", "0.1.2+", or "1.2.3.4-test1").

> The version is first split into numeric and character portions and then the parts are padded to be the same length (i.e., "1.1" would be padded to be "1.1.0" when being compared with "1.1.1", and separately, the character parts of the strings are padded with nulls).

> The operator can be any logical operator from the set

> - "==" equal
> - "<" less than
> - "<=" less than or equal to
> - ">" greater than
> - ">=" greater than or equal to
> - "!=" not equal
> - "~=" not equal

> Note that version "1.1-test2" will compare as greater than "1.1-test10". Also, since the numeric part is compared first, "a" compares less than "1a" because the second string starts with a numeric part even though `double("a")` is greater than `double("1").`

— Function File: license

> Display the license of Octave. — Function File: license ("inuse")

> > Display a list of packages currently being used. — Function File: retval = license ("inuse")

> > > Return a structure containing the fields `feature` and `user`. — Function File: retval = license ("test", feature)

> > > > Return 1 if a license exists for the product identified by the string feature and 0 otherwise. The argument feature is case insensitive and only the first 27 characters are checked. — Function File: license ("test", feature, toggle)

> > > > > Enable or disable license testing for feature, depending on toggle, which may be one of:

> > > > > "enable"
> > > > >   Future tests for the specified license of feature are conducted as usual.
> > > > > "disable"
> > > > >   Future tests for the specified license of feature return 0.
> > > > > — Function File: retval = license ("checkout", feature)

> > > > > > Check out a license for feature, returning 1 on success and 0 on failure.

> > > > > > This function is provided for compatibility with matlab.

> > > > > > See also: ver, version.

— Built-in Function: octave_config_info ()
— Built-in Function: octave_config_info (option)

> Return a structure containing configuration and installation information for Octave.

> If option is a string, return the configuration information for the specified option.

— Function File: usejava (feature)

> Return true if the specific Sun Java element feature is available.

> Possible features are:

> "awt"
>   Abstract Window Toolkit for GUIs.
> "desktop"
>   Interactive desktop is running.
> "jvm"
>   Java Virtual Machine.
> "swing"
>   Swing components for lightweight GUIs.

> This function is provided for compatibility with matlab scripts which may alter their behavior based on the availability of Java. Octave does not implement an interface to Java and this function always returns `false`.

— Loadable Function: getrusage ()

> Return a structure containing a number of statistics about the current Octave process. 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:

> `idrss`
>   Unshared data size.
> `inblock`
>   Number of block input operations.
> `isrss`
>   Unshared stack size.
> `ixrss`
>   Shared memory size.
> `majflt`
>   Number of major page faults.
> `maxrss`
>   Maximum data size.
> `minflt`
>   Number of minor page faults.
> `msgrcv`
>   Number of messages received.
> `msgsnd`
>   Number of messages sent.
> `nivcsw`
>   Number of involuntary context switches.
> `nsignals`
>   Number of signals received.
> `nswap`
>   Number of swaps.
> `nvcsw`
>   Number of voluntary context switches.
> `oublock`
>   Number of block output operations.
> `stime`
>   A structure containing the system CPU time used. The structure has the elements `sec` (seconds) `usec` (microseconds).
> `utime`
>   A structure containing the user CPU time used. The structure has the elements `sec` (seconds) `usec` (microseconds).