Building on Microsoft Windows: Difference between revisions

Jump to navigation Jump to search
→‎Building natively (MSYS2): Use different ccache
(→‎Building natively (MSYS2): Add command for symlinking octave-svgconvert.exe)
(→‎Building natively (MSYS2): Use different ccache)
Line 97: Line 97:
   mingw-w64-x86_64-arpack mingw-w64-x86_64-curl mingw-w64-x86_64-cvode 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-arpack mingw-w64-x86_64-curl mingw-w64-x86_64-cvode 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 \
   libutil-linux-devel \
   libutil-linux-devel \
   ccache git mercurial mingw-w64-x86_64-icoutils mingw-w64-x86_64-librsvg texinfo</pre>
   git mercurial mingw-w64-x86_64-ccache mingw-w64-x86_64-icoutils mingw-w64-x86_64-librsvg texinfo</pre>


To create scripts that allow it to use ccache easily (for most of the compilers in MSYS2), one can use the following commands:
Using ccache is optional. It speeds up compilation time but needs several GiB free disc space for its cache. If disc space is an issue, this step can be skipped. To prepend the path to the ccache helper scripts to the front of the PATH variable, add the following line near the end of the {{Path|.bash_profile}} file in your MSYS2 {{Path|$HOME}} directory:
<pre>cd /usr/lib/ccache/bin
<pre>export PATH="/mingw64/lib/ccache/bin:$PATH"</pre>
scripts=(c++ cc cpp gcc g++ gfortran x86_64-w64-mingw32-g++ x86_64-w64-mingw32-c++ x86_64-w64-mingw32-gcc x86_64-w64-mingw32-gfortran)
for fn in ${scripts[*]}; do
  echo -e '#!/bin/bash\n\nccache /mingw64/bin/'$fn' "$@"' > $fn
done</pre>
Additionally, add the path to these helper scripts to the front of the PATH variable by adding the following line near the end of the {{Path|.bashrc}} file in your MSYS2 {{Path|$HOME}} directory:
<pre>export PATH="/usr/lib/ccache/bin:$PATH"</pre>


Like installing the build dependencies, this has to be done only once.
Like installing the build dependencies, this has to be done only once.


To build from the development sources, check out the Mercurial repository and run the {{Path|bootstrap}} script:
To build from the development sources, check out the Mercurial repository and run the {{Path|bootstrap}} script:
<pre> hg clone https://www.octave.org/hg/octave && \
<pre> hg clone https://www.octave.org/hg/octave
cd octave && \
cd octave
./bootstrap</pre>
./bootstrap</pre>
 
Create a sub-directory to avoid building in the source tree:
<pre>mkdir .build
cd .build</pre>


Configure with the following flags:
Configure with the following flags:
216

edits

Navigation menu