Editing Building on Microsoft Windows

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 128: Line 128:
Windows doesn't have a shebang mechanism to execute scripts with an arbitrary interpreter. But the <code>makeinfo</code> program in MSYS2 is implemented as a perl script. As a work-around, tell Octave to interpret that file with the <code>perl</code> interpreter. You could do that, e.g., by running the following command to append to the global startup file:
Windows doesn't have a shebang mechanism to execute scripts with an arbitrary interpreter. But the <code>makeinfo</code> program in MSYS2 is implemented as a perl script. As a work-around, tell Octave to interpret that file with the <code>perl</code> interpreter. You could do that, e.g., by running the following command to append to the global startup file:
<syntaxhighlight lang="bash">echo 'makeinfo_program (sprintf ("%s && cd %s/../usr/bin && perl makeinfo", OCTAVE_HOME ()(1:2), OCTAVE_HOME ()));' >> "${MINGW_PREFIX}/share/octave/site/m/startup/octaverc"</syntaxhighlight>
<syntaxhighlight lang="bash">echo 'makeinfo_program (sprintf ("%s && cd %s/../usr/bin && perl makeinfo", OCTAVE_HOME ()(1:2), OCTAVE_HOME ()));' >> "${MINGW_PREFIX}/share/octave/site/m/startup/octaverc"</syntaxhighlight>
This has to be done only once.


A relocation issue with the graphicsmagick library in MSYS2 might cause Octave to crash on certain commands unless it is installed to the default location. To avoid these possible crashes, install Octave (from the MSYS2 shell in {{Path|.build}}) before using it:
A relocation issue with the graphicsmagick library in MSYS2 might cause Octave to crash on certain commands unless it is installed to the default location. To avoid these possible crashes, install Octave (from the MSYS2 shell in {{Path|.build}}) before using it:
<syntaxhighlight lang="bash">make install</syntaxhighlight>
<syntaxhighlight lang="bash">make install</syntaxhighlight>


Windows' library lookup mechanism requires that the following executables are installed in the same folder like the libraries they depend on. That can be achieved by creating symlinks to these executables in the "correct" location:
Windows' library lookup mechanism requires that the following executable are installed in the same folder like the libraries they depend on. That can be achieved by creating symlinks to these executable in the "correct" location:
<syntaxhighlight lang="bash">ln -sf /mingw64/libexec/octave/7.0.0/exec/x86_64-w64-mingw32/octave-gui.exe /mingw64/bin/octave-gui.exe
<syntaxhighlight lang="bash">ln -sf /mingw64/libexec/octave/7.0.0/exec/x86_64-w64-mingw32/octave-gui.exe /mingw64/bin/octave-gui.exe
ln -sf /mingw64/libexec/octave/7.0.0/exec/x86_64-w64-mingw32/octave-svgconvert.exe /mingw64/bin/octave-svgconvert.exe</syntaxhighlight>
ln -sf /mingw64/libexec/octave/7.0.0/exec/x86_64-w64-mingw32/octave-svgconvert.exe /mingw64/bin/octave-svgconvert.exe</syntaxhighlight>
These symlinks are only needed when building the GUI (i.e., Qt is not disabled). This step is no longer necessary with Octave 7 or newer.
These symlinks are only needed when building the GUI (i.e., Qt is not disabled). This step is no longer necessary with Octave 7 or newer.


At this point, Octave's GUI can be started with the command <code>octave --gui</code> at the MSYS2/MINGW64 shell.
At this point, Octave can be started with the command <code>octave</code> at the MSYS2/MINGW64 shell.


If you'd like to start Octave from a CMD shell (or with a batch script), the following commands could be used (assuming MSYS2 was installed in its default location):
If you'd like to start Octave from a CMD shell (or with a batch script), the following commands could be used (assuming MSYS2 was installed in its default location):
Please note that all contributions to Octave may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Octave:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Templates used on this page: