Editing Building on Microsoft Windows
Jump to navigation
Jump to search
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 18: | Line 18: | ||
If you want to contribute changes to C++ files or are interested in testing the latest development or (unreleased) stable release, you can build Octave from source. | If you want to contribute changes to C++ files or are interested in testing the latest development or (unreleased) stable release, you can build Octave from source. | ||
It seems to be possible to build Octave natively on Windows with the MSYS2 shell. (Be aware that this might take some time.) It is also possible to build Octave on Windows machines using virtual machines or Microsoft's Windows Subsystem for Linux. | It seems to be possible to build Octave natively on Windows with the MSYS2 shell. (Be aware that this might take some time.) It is also possible to build Octave on Windows machines using virtual machines or Microsoft's Windows Subsystem for Linux. The latter is the preferred way to build Octave. | ||
Building Octave natively on Windows is experimental! The only supported way of creating Windows binaries of Octave is cross-building with MXE Octave ([[Windows Installer]]). | Building Octave natively on Windows is experimental! The only supported way of creating Windows binaries of Octave is cross-building with MXE Octave ([[Windows Installer]]). | ||
Line 96: | Line 96: | ||
The following command can be used to install the necessary and optional build and run-time dependencies in MSYS2: | The following command can be used to install the necessary and optional build and run-time dependencies in MSYS2: | ||
<syntaxhighlight lang="bash">pacman -S base-devel mingw-w64-x86_64- | <syntaxhighlight lang="bash">pacman -S base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-lapack mingw-w64-x86_64-openblas mingw-w64-x86_64-pcre \ | ||
mingw-w64-x86_64-arpack mingw-w64-x86_64-curl mingw-w64-x86_64-fftw mingw-w64-x86_64-fltk mingw-w64-x86_64-gl2ps mingw-w64-x86_64-glpk mingw-w64-x86_64-ghostscript mingw-w64-x86_64-gnuplot mingw-w64-x86_64-graphicsmagick mingw-w64-x86_64-hdf5 mingw-w64-x86_64-libsndfile mingw-w64-x86_64-portaudio mingw-w64-x86_64-qhull mingw-w64-x86_64-qrupdate mingw-w64-x86_64-qscintilla mingw-w64-x86_64-qt5 | mingw-w64-x86_64-arpack mingw-w64-x86_64-curl mingw-w64-x86_64-fftw mingw-w64-x86_64-fltk mingw-w64-x86_64-gl2ps mingw-w64-x86_64-glpk mingw-w64-x86_64-ghostscript mingw-w64-x86_64-gnuplot mingw-w64-x86_64-graphicsmagick mingw-w64-x86_64-hdf5 mingw-w64-x86_64-libsndfile mingw-w64-x86_64-portaudio mingw-w64-x86_64-qhull mingw-w64-x86_64-qrupdate mingw-w64-x86_64-qscintilla mingw-w64-x86_64-qt5 mingw-w64-x86_64-rapidjson mingw-w64-x86_64-suitesparse mingw-w64-x86_64-sundials \ | ||
git mercurial mingw-w64-x86_64-ccache mingw-w64-x86_64-icoutils mingw-w64-x86_64-librsvg texinfo \ | git mercurial mingw-w64-x86_64-ccache mingw-w64-x86_64-icoutils mingw-w64-x86_64-librsvg texinfo \ | ||
unzip zip</syntaxhighlight> | unzip zip</syntaxhighlight> | ||
Line 121: | Line 121: | ||
<syntaxhighlight lang="bash">../configure \ | <syntaxhighlight lang="bash">../configure \ | ||
--disable-docs \ | --disable-docs \ | ||
ac_cv_search_tputs=-ltermcap</syntaxhighlight> | |||
And build with the following command: | And build with the following command: | ||
<syntaxhighlight lang="bash">make all -j8</syntaxhighlight> | <syntaxhighlight lang="bash">make all -j8</syntaxhighlight> | ||
Octave doesn't run correctly from the MSYS2 shell due to issues with readline and backslash as a file separator. To be able to work with it anyway, install it with the following commands (from the MSYS2 shell in {{Path|.build}}): | |||
<syntaxhighlight lang="bash">make install | |||
ln -sf /mingw64/libexec/octave/7.0.0/exec/x86_64-w64-mingw32/octave-gui.exe /mingw64/bin/octave-gui.exe | |||
<syntaxhighlight lang="bash">make install | |||
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> | ||
The latter two symlinks are only needed when building the GUI (i.e., Qt is not disabled). | |||
Start Octave from a CMD shell (or with a batch script) with the following commands (assuming MSYS2 was installed in its default location): | |||
<syntaxhighlight lang="batch">set PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH% | <syntaxhighlight lang="batch">set PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH% | ||
set MSYSTEM=MINGW64 | set MSYSTEM=MINGW64 |