Octave for Microsoft Windows: Difference between revisions

Jump to navigation Jump to search
(→‎Packages: update info for new v6.1 package behavior on windows)
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
:''This article is about using pre-built installers of Octave for Windows; for instructions about building it, see [[Windows Installer]].''
:''This article is about using pre-built installers of Octave for Windows; for instructions about building it, see [[Windows Installer]].''


{{Note|Windows installers are available for the latest version of '''Octave ({{Release}}, released on {{Release Date}})''' from https://ftp.gnu.org/gnu/octave/windows/.}}
{{Note|Windows installers are available for the latest version of '''Octave ({{Release}}, released on {{Release Date}})''' from https://ftpmirror.gnu.org/gnu/octave/windows/.}}


Users are encouraged to use the latest version unless a specific feature or requirement warrants using an older version of the software. Version specific instructions and installation notes are provided below.
Users are encouraged to use the latest version unless a specific feature or requirement warrants using an older version of the software. Version specific instructions and installation notes are provided below.
Line 22: Line 22:


==Octave Packages==
==Octave Packages==
Like many software programs, Octave uses ''packages'' to optionally extend and modify its capability without changing core Octave behavior. These packages can be installed and loaded using the built in package management program 'pkg'.  (Note that Octave does not automatically load installed packages, they must be manually loaded from within Octave by the user.)  
Like many software programs, Octave uses ''packages'' to optionally extend and modify its capability. These packages can be installed and loaded using the built in package management program 'pkg'.  (Note that Octave does not automatically load installed packages, they must be manually loaded from within Octave by the user.)  


Octave maintains a system-wide (or ''global'') package list, and a user-specific (or ''local'') package list. By default in Windows 10, local packages are located at {{Path|C:\Users\%USERNAME%\octave\}}.  (The \octave folder will be created during the first package install if it is not already present.)  The global packages are stored in {{Path|%OCTAVE_HOME%\mingw64\share\octave\packages\}}. Specific locations on your system can be found by typing the following commands at the Octave command line:
Octave maintains a system-wide (or ''global'') package list, and a user-specific (or ''local'') package list. By default in Windows 10, local packages are located at {{Path|C:\Users\%USERNAME%\octave\}}.  (The \octave folder will be created during the first package install\update if it is not already present.)  The global packages are stored in {{Path|%OCTAVE_HOME%\mingw64\share\octave\packages\}}, and are available to all users on the machine. Specific locations on your system can be found by typing the following commands at the Octave command line:


     >> pkg local_list
     >> pkg local_list
     >> pkg global_list
     >> pkg global_list


Octave versions for Windows prior to 6.1.0 defaulted to always using and making changes to global packages.  The default is now to follow the same behavior on all platforms, and for all package updates and installations to apply to the user's local package list in the user's home folder unless otherwise specified.
Octave versions for Windows prior to 6.1.0 defaulted to always making changes to global packages unless the user specified otherwise.  The default is now to follow the same behavior on all platforms, and for all package updates and installations to apply to local or global package locations according to whether or not the user is running with Administrative privileges (on Windows, this is usually accomplished by running as an Administrator privileged account, or starting Octave with the "Run as Administrator" option).  Alternatively, some pkg command options can force octave to try to use either the local or global packages.


===Pre-installed Packages===
===Pre-installed Packages===
Line 37: Line 37:
   >> pkg list
   >> pkg list


The output for preinstalled global packages included with version 6.1.0 installed into {{Path|C:\Octave}} is:
The output for preinstalled global packages included with version 6.4.0 when installed into {{Path|C:\Octave}} is:
                                                                                           
 
     Package Name        | Version | Installation directory
     Package Name        | Version | Installation directory
     ---------------------+---------+-----------------------
     ---------------------+---------+-----------------------
                   audio  |  2.0.2 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\audio-2.0.2
                   audio  |  2.0.3 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\audio-2.0.3
         communications  |  1.2.2 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\communications-1.2.2
         communications  |  1.2.3 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\communications-1.2.3
                 control  |  3.2.0 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\control-3.2.0
                 control  |  3.3.1 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\control-3.3.1
         data-smoothing  |  1.3.0 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\data-smoothing-1.3.0
         data-smoothing  |  1.3.0 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\data-smoothing-1.3.0
               database  |  2.4.4 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\database-2.4.4
               database  |  2.4.4 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\database-2.4.4
               dataframe  |  1.2.0 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\dataframe-1.2.0
               dataframe  |  1.2.0 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\dataframe-1.2.0
                   dicom  |  0.4.0 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\dicom-0.4.0
                   dicom  |  0.4.0 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\dicom-0.4.0
               financial  |  0.5.3 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\financial-0.5.3
               financial  |  0.5.3 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\financial-0.5.3
                   fits  |  1.0.7 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\fits-1.0.7
                   fits  |  1.0.7 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\fits-1.0.7
     fuzzy-logic-toolkit  |  0.4.5 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\fuzzy-logic-toolkit-0.4.5
     fuzzy-logic-toolkit  |  0.4.6 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\fuzzy-logic-toolkit-0.4.6
                     ga  |  0.10.1 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\ga-0.10.1
                     ga  |  0.10.2 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\ga-0.10.2
                 general  |  2.1.1 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\general-2.1.1
                 general  |  2.1.1 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\general-2.1.1
           generate_html  |  0.3.2 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\generate_html-0.3.2
           generate_html  |  0.3.2 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\generate_html-0.3.2
               geometry  |  4.0.0 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\geometry-4.0.0
               geometry  |  4.0.0 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\geometry-4.0.0
                     gsl  |  2.1.1 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\gsl-2.1.1
                     gsl  |  2.1.1 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\gsl-2.1.1
                   image  |  2.12.0 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\image-2.12.0
                   image  |  2.12.0 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\image-2.12.0
     instrument-control  |  0.6.0 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\instrument-control-0.6.0
     instrument-control  |  0.7.0 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\instrument-control-0.7.0
               interval  |  3.2.0 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\interval-3.2.0
               interval  |  3.2.0 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\interval-3.2.0
                     io  |  2.6.3 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\io-2.6.3
                     io  |  2.6.3 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\io-2.6.3
         linear-algebra  |  2.2.3 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\linear-algebra-2.2.3
         linear-algebra  |  2.2.3 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\linear-algebra-2.2.3
                   lssa  |  0.1.4 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\lssa-0.1.4
                   lssa  |  0.1.4 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\lssa-0.1.4
                   ltfat  |  2.3.1 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\ltfat-2.3.1
                   ltfat  |  2.3.1 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\ltfat-2.3.1
                 mapping  |  1.4.1 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\mapping-1.4.1
                 mapping  |  1.4.1 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\mapping-1.4.1
                 matgeom  |  1.2.2 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\matgeom-1.2.2
                 matgeom  |  1.2.3 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\matgeom-1.2.3
           miscellaneous  |  1.3.0 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\miscellaneous-1.3.0
           miscellaneous  |  1.3.0 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\miscellaneous-1.3.0
                     nan  |  3.5.0 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\nan-3.5.0
                     nan  |  3.6.0 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\nan-3.6.0
                 netcdf  |  1.0.14 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\netcdf-1.0.14
                 netcdf  |  1.0.14 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\netcdf-1.0.14
                   nurbs  | 1.3.13 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\nurbs-1.3.13
                   nurbs  |   1.4.3 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\nurbs-1.4.3
                     ocs  |  0.1.5 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\ocs-0.1.5
                     ocs  |  0.1.5 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\ocs-0.1.5
                  optim 1.6.0 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\optim-1.6.0
                octproj 2.0.1 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\octproj-2.0.1
            optiminterp 0.3.6 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\optiminterp-0.3.6
                  optim 1.6.1 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\optim-1.6.1
            quaternion 2.4.0 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\quaternion-2.4.0
            optiminterp 0.3.6 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\optiminterp-0.3.6
              queueing 1.2.7 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\queueing-1.2.7
            quaternion 2.4.0 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\quaternion-2.4.0
                signal |  1.4.1 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\signal-1.4.1
              queueing |  1.2.7 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\queueing-1.2.7
                sockets |  1.2.1 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\sockets-1.2.1
                signal |  1.4.1 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\signal-1.4.1
              sparsersb |  1.0.8 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\sparsersb-1.0.8
                sockets |  1.2.1 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\sockets-1.2.1
                splines |  1.3.3 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\splines-1.3.3
              sparsersb |  1.0.9 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\sparsersb-1.0.9
            statistics |  1.4.2 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\statistics-1.4.2
                splines |  1.3.4 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\splines-1.3.4
                    stk 2.6.1 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\stk-2.6.1
            statistics 1.4.2 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\statistics-1.4.2
                strings 1.2.0 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\strings-1.2.0
                    stk 2.6.1 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\stk-2.6.1
                struct | 1.0.16 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\struct-1.0.16
                strings |   1.2.0 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\strings-1.2.0
              symbolic |   2.9.0 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\symbolic-2.9.0
                struct | 1.0.17 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\struct-1.0.17
                tisean 0.2.3 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\tisean-0.2.3
              symbolic 2.9.0 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\symbolic-2.9.0
                    tsa 4.6.2 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\tsa-4.6.2
                tisean 0.2.3 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\tisean-0.2.3
                  video 2.0.0 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\video-2.0.0
                    tsa 4.6.3 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\tsa-4.6.3
                windows 1.5.0 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\windows-1.5.0
                  video 2.0.0 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\video-2.0.0
                zeromq |  1.5.2 | C:\Octave\octave-6.1.0-w64\mingw64\share\octave\packages\zeromq-1.5.2
                windows |  1.6.1 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\windows-1.6.1
 
                zeromq  |  1.5.3 | C:\Octave\octave-6.4.0-w64\mingw64\share\octave\packages\zeromq-1.5.3
Note that the included packages shown above are stored in the default ''global package location''.   
                                                                                         
   
Note that the included packages shown above are stored in the default ''global package location'' within the Octave installation folder.  If any 'local' packages were previously installed with another version of windows, they might also appear in the list at the local location.  It is recommended that any such packages be uninstalled and reinstalled to guarantee compatibility with the current version of octave.


If Octave was installed from a zip or 7z archive and you did not run the {{Path|post-install.bat}} file, you may not see any packages listed.  In that case you need to run:
If Octave was installed from a zip or 7z archive and you did not run the {{Path|post-install.bat}} file, you may not see any packages listed.  In that case you need to run:
Line 95: Line 97:
   >> pkg rebuild
   >> pkg rebuild


That will force octave to look for both ''local'' and ''global'' packages in the set locations to repopulate list of available packages.  Note that  'local' packages take precedence if present in both locations.  
That will force octave to look for both ''local'' and ''global'' packages in the set locations to repopulate the list of available packages.  Note that  'local' packages always take precedence if the same package is present in both locations.
 
'''Note''': The Windows bundle includes a minimal version of Python for the symbolic package. That version of Python is not intended to be used for anything else. If you like to use Python for something different in Octave (e.g., for the pythonic package), install a full Python distribution and set the necessary environment variables (PYTHON, ...?).


===Package Installation and Update===
===Package Installation and Update===
Line 111: Line 115:
   >> pkg install package_file_name.tar.gz
   >> pkg install package_file_name.tar.gz


Note that all of the commands above will perform ''local'' package installs.  E.g., if an update is found for a global package, the updated version will be installed to the ''local'' package location, leaving the old version intact in the ''global'' package location.  This behavior can be changed by calling the install command with the {{Path|-global}} option. For example:
Note that all of the commands above will perform ''local'' or ''global'' package installs according to the user's Administrator access level.  E.g., if an update is found for a global package with a non-elevated user account, the updated version will be installed to the ''local'' package location, leaving the old version intact in the ''global'' package location.  This behavior can be changed by calling the install command with the {{Path|-global}} option. For example:
 
To install a global package to the latest version (requires write-access to the global-list location) you can use:
 
  >> pkg install -forge -global <package_name>
 
Note also that the update command does not take -local or -global options, and always performs an update according to the user's Administrator access level. As such if Octave was installed from a zip or 7z archive in a non-privileged account, 'pkg update' cannot be used to update global packages, they must be updated manually using 'pkg install'
 
Detailed instructions for installing individual Octave Forge packages are given at https://octave.sourceforge.io/packages.php.
 
==Calling Octave executables==
 
Some environment variables have to be set to correctly run Octave executables.  So, a user should not call any of the executables directly unless the necessary environment variables have been set up manually.
 
Instead, the {{Path|octave.vbs}} script in Octave's root installation folder or the {{Path|octave.bat}} script in the bin directory should be used.  Both scripts support starting the GUI (command line argument {{Path|--gui}}) or running Octave in CLI mode (command line argument {{Path|--no-gui}}).  The .vbs script opens the GUI by default.  The .bat script starts Octave in CLI mode by default.
 
The .vbs script returns immediately when Octave has started.  The .bat script returns when Octave finishes execution.
 
Alternatively, Octave can be started using the msys2 shell that can be started with {{Path|cmdshell.bat}} in Octave's root installation folder.
 
=GNU Octave in MSYS2=


To update all global packages to the latest version, use:
[https://www.msys2.org/ MSYS2] is a collection of tools and libraries providing an easy-to-use environment for building, installing and running native Windows software. GNU Octave is available as a [https://packages.msys2.org/base/mingw-w64-octave package] in MSYS2.


  >> pkg update -global
The best (and recommended) way to use Octave on Windows is to use the provided installers (see above). But for some special requirements, the version of Octave packaged by MSYS2 might be the better solution. Those special requirements might include:
* Users might want to use e.g. Octave packages that depend on third party packages not included in MXE Octave.
* Users might need features of newer versions of packages that are included in an older version in MXE Octave.
* ...


or for one specific package:
MSYS2 follows a rolling release cycle. So, its packages are most likely more up-to-date than the packages included in Octave's installer for Windows.
It includes a (working) package manager (<code>pacman</code>) that provides the option to install a much wider range of packages than what can possibly be included in Octave's installer for Windows.


  >> pkg install -forge -global <package_name>
To use Octave in MSYS2, install the MSYS2 environment following [https://www.msys2.org/#installation their instructions]. At the <code>bash</code> shell (use e.g. "MSYS2 MinGW 64-bit" from the start menu), update the installation by <code>pacman -Syu</code>. After that, install a version of Octave that matches your environment (and the shell you are using), e.g. <code>pacman -S mingw-w64-x86_64-octave</code>.


Detailed instructions for installing individual Octave Forge packages are given at https://octave.sourceforge.io/packages.php.
This will install (among others), the main executables of Octave <code>octave-gui</code> (linked with Qt, i.e., including the "qt" graphics toolkit and the GUI), <code>octave-cli</code> (linked without Qt, i.e., only "fltk" and "gnuplot" graphics toolkits and no GUI), and the wrapper executable <code>octave</code> that dispatches to one of the former executables depending on the used command line switches. The Octave GUI can be started with <code>octave --gui</code> from MSYS2's <code>bash</code> shell, the command line interface (CLI) with <code>octave</code>.


=GNU Octave on [https://cygwin.com/ cygwin]=
=GNU Octave on [https://cygwin.com/ cygwin]=


*'''Maintainer:''' Marco Atzeri  
*'''Maintainer:''' Marco Atzeri  
*'''Latest release:''' 2020-02-26
*'''Latest release:''' 2021-01-06


*Latest packages:
*Latest packages:


:octave-5.2.0-1
:octave-6.4.0-1
:Its announce on cygwin mailing list [https://cygwin.com/ml/cygwin-announce/2020-02/msg00028.html]
:Its announce on cygwin mailing list [https://sourceware.org/pipermail/cygwin-announce/2022-January/010389.html]


:Octave Forge packages have each a cygwin package.
:Octave Forge packages have each a cygwin package.
:Its announce on cygwin mailing list [https://cygwin.com/ml/cygwin-announce/2017-01/msg00078.html]
:Its announce on cygwin mailing list [https://sourceware.org/legacy-ml/cygwin-announce/2017-01/msg00078.html]
: Full cygwin package list is available here [https://cygwin.com/packages/]
: Full cygwin package list is available here [https://cygwin.com/packages/]
: At 2017-04-06, 64 forge packages were available.  
: At 2017-04-06, 64 forge packages were available.  
Line 147: Line 175:


==Notes for cygwin==
==Notes for cygwin==
*When building from development source (default branch)
:    "make check"
:passes almost all the tests. Only, and not substantial, failures are:
:<syntaxhighlight lang="bash">
/pub/hg/octave/src/data.cc : 8 failures due to different handling of complex Inf on sort
/pub/hg/octave/src/syscalls.cc: 1 failure on fork. This disappears when octave is installed
/pub/hg/octave/scripts/sparse/svds.m: 1 failure due to test sensitivity on starting point. See
https://mailman.cae.wisc.edu/pipermail/octave-maintainers/2011-September/024715.html
</syntaxhighlight>


* To build GNU Octave from cygwin source package, you need to install "cygport" and the relevant development libraries
* To build GNU Octave from cygwin source package, you need to install "cygport" and the relevant development libraries
:<syntaxhighlight lang="bash">
:<syntaxhighlight lang="bash">
tar -xf octave-5.1.0-1-src.tar.xz  
tar -xf octave-6.4.0-1-src.tar.xz  
cygport octave.cygport almostall
cygport octave.cygport almostall
</syntaxhighlight>
</syntaxhighlight>
:see [https://cygwinports.github.io/cygport/ cygport documentation] for further info.
:see cygport documentation at /usr/share/doc/cygport/html/manual/toc_index.html for further info.


=General info=
=General info=
22

edits

Navigation menu