Windows Installer: Difference between revisions

Jump to navigation Jump to search
1,390 bytes removed ,  14 October 2019
Some reorganization.
(Remove redundant information. Use https.)
(Some reorganization.)
Line 9: Line 9:


# [http://wiki.octave.org/Windows_Installer#Installing_requirements_of_MXE_Octave Install all requirements of MXE Octave].
# [http://wiki.octave.org/Windows_Installer#Installing_requirements_of_MXE_Octave Install all requirements of MXE Octave].
# <code>hg clone https://hg.octave.org/mxe-octave</code>
# <code>hg clone https://hg.octave.org/mxe-octave</code><ref>Use <code>hg clone https://hg.octave.org/mxe-octave <name of mxe-octave build dir></code> to choose another directory.</ref>
# <code>cd mxe-octave</code>
# <code>cd mxe-octave</code>
# <code>./bootstrap</code>
# <code>./bootstrap</code>
Line 15: Line 15:
# <code>make all nsis-installer</code>
# <code>make all nsis-installer</code>


===Tweaks===
===Step details===


* Use <code>make all 7z-dist</code>, <code>make all tar-dist</code> or <code>make all zip-dist</code> instead of <code>make all nsis-installer</code> if you want to build just an archive of the files to install on Windows instead of an installer wizard.
====<code>./configure</code>====
* By default, packages will be built one at a time, but you may use <code>make JOBS=4</code> (choose a number other than 4 that is appropriate for your system) to build each package in parallel.  You may also combine this with the <code>-j</code> option for Make to build more than one package at a time, but be careful as using <code>make -j4 JOBS=4</code> can result in as many as 16 jobs running at once.
* Use <code>./configure --disable-strip-dist-files</code> if you want to keep debug symbols in the installed binaries for debugging on Windows. Beware as the total Octave distribution will be > 2 GB, the max. size for an NSIS installer. Your only options are to make 7z-dist, zip-dist or tar-dist installers.
* Include gdb in the installer by running <code>make gdb</code> before making the <code>nsis-installer</code> target.
 
===Creating Octave development versions for Windows with mxe-octave===
To roll your own octave for windows version with your favorite mods and patches, you can do as follows:


# Make the cross-build environment for Octave (=mxe-octave; see above)
The current Windows installers are build in three "flavors": for common 64- and 32-bit systems ('''"w64"''' and '''"w32"''') and for 64-bit systems exceeding 32 GB of main memory to store large data structures ('''"w64-64"''').
# Build an Octave dist archive in Linux
# Move that into mxe-octave and cross-build Octave + windows installer.
For ensuing builds after a first build, you'll only need to follow steps 2 + a little amended step 3 (see below)
 
====Step 1: Prepare mxe-octave====
 
Clone the mxe-octave repository to some directory of your choice:
 
hg clone https://hg.octave.org/mxe-octave <name of mxe-octave build dir>
 
where <code><name of mxe-octave build dir></code> is some other name than just the default "mxe-octave".  
Once downloaded, go into the <code><name of mxe-octave build dir></code> subdirectory and do:
 
./bootstrap


{| class="wikitable"
{| class="wikitable"
Line 78: Line 58:


* <code>--enable-devel-tools</code>: Include gdb and an MSYS shell in the binary.
* <code>--enable-devel-tools</code>: Include gdb and an MSYS shell in the binary.
** If you seriously want to work with gdb, you need <code>--disable-strip-dist-files</code> as configure option, as well. This may result in problems, see the [[#Tweaks|Tweaks]] section.
** If you seriously want to work with gdb, you need <code>--disable-strip-dist-files</code> as configure option to keep debug symbols in the installed binaries for debugging on Windows. Beware as the total Octave distribution will be > 2 GB, the max. size for an NSIS installer. Your only options are to make 7z-dist, zip-dist or tar-dist installers.
* <code>--enable-binary-packages</code>: Cross-compile binary modules in [[Octave Forge]] packages. This saves time when installing them once the installation runs on Microsoft Windows.
* <code>--enable-binary-packages</code>: Cross-compile binary modules in [[Octave Forge]] packages. This saves time when installing them once the installation runs on Microsoft Windows.
* <code>--with-ccache</code>: The usage of [https://ccache.dev/ ccache] may speed up repetitive compilation drastically.
* <code>--with-ccache</code>: The usage of [https://ccache.dev/ ccache] may speed up repetitive compilation drastically.
Line 89: Line 69:
* <code>--enable-fortran-int64</code>: Use 64-bit integers in Fortran code and especially in numerical library code.
* <code>--enable-fortran-int64</code>: Use 64-bit integers in Fortran code and especially in numerical library code.


make all nsis-installer JOBS=<some number>
====<code>make</code>====


Your author usually uses <code>JOBS=7</code>.
* Use <code>make all 7z-dist</code>, <code>make all tar-dist</code> or <code>make all zip-dist</code> instead of <code>make all nsis-installer</code> if you want to build just an archive of the files to install on Windows instead of an installer wizard.
* By default, packages will be built one at a time, but you may use <code>make JOBS=4</code> (choose a number other than 4 that is appropriate for your system) to build each package in parallel.  You may also combine this with the <code>-j</code> option for Make to build more than one package at a time, but be careful as using <code>make -j4 JOBS=4</code> can result in as many as 16 jobs running at once.
* Include gdb in the installer by running <code>make gdb</code> before making the <code>nsis-installer</code> target.


It can happen that you meet problems with Java. To build Octave with Java support built-in, mxe-octave needs:
* A Java JDK (Java Development Kit) on the '''host''' system. IOW, the javac (Java compiler) and jar (Java archiver) executables should be in the PATH.
* Java include files for windows (win32, even for w64 builds). They should reside in "<mxe-octave build dir>/usr/x86_64-w64-mingw32/include/java/win32". If not present, mxe-octave downloads them but this can occasionally go wrong. On a multi-boot system a solution (note: dirty hack warning!) is symlinking to the Windows include files on the Windows partition from the mxe-octave location.


====Step 2: To build your first Octave-for Windows development version:====
===Build Octave-for Windows development versions===
* build Octave on Linux (in separate source and build trees) including your favorite mods and patches.
* build Octave on Linux (in separate source and build trees) including your favorite mods and patches.
* once Octave runs fine in Linux (using make check and trying your mods using ./run-octave --gui & from the build dir, all of this still on the Linux side), do:
* once Octave runs fine in Linux (using make check and trying your mods using ./run-octave --gui & from the build dir, all of this still on the Linux side), do:
Line 108: Line 87:
This archive is always slightly behind the latest development branch of the source repository and is missing the metadata that indicates which Mercurial revision it was built from.}}
This archive is always slightly behind the latest development branch of the source repository and is missing the metadata that indicates which Mercurial revision it was built from.}}


==== Step 3: Building the Octave installer====
* be sure to adapt <mxe-octave build>/src/default-octave.mk to read "## No Checksum" at the $(PKG)_CHECKSUM line and check octave version and archive type (tar.lz rather than tar.bz2). The checksum is only needed when you download a dist archive from the Internet, not so much when you copy it within your own home network, let alone your own computer.
* check if in the top of the main Makefile "default-octave" is mentioned for OCTAVE_TARGET rather than "stable-octave" of just "octave" (that name refers to the .mk filename in the src folder).
* ... and then run (in the <mxe-octave build> folder)
make all nsis-installer <options>
-or-
make all 7z-dist <options>
====Step 3A (second and later builds)====
====Step 3A (second and later builds)====
For next builds, mxe-octave is already configured and all dependencies have been built so the only thing to do is having a new Octave version + installer built:
For next builds, mxe-octave is already configured and all dependencies have been built so the only thing to do is having a new Octave version + installer built:
Line 138: Line 110:
* However, do not keep mxe-octave build dirs for too long. I'd suggest to wipe a build dir after at most two or three months and start over with a fresh clone a la Step 1.
* However, do not keep mxe-octave build dirs for too long. I'd suggest to wipe a build dir after at most two or three months and start over with a fresh clone a la Step 1.
* In the mean time, regularly clean up <mxe-octave build>/log to save disk space. After a first successful build there's no more use for the log subdirs for each package, so you can wipe them all.
* In the mean time, regularly clean up <mxe-octave build>/log to save disk space. After a first successful build there's no more use for the log subdirs for each package, so you can wipe them all.
It can happen that you meet problems with Java. To build Octave with Java support built-in, mxe-octave needs:
* A Java JDK (Java Development Kit) on the '''host''' system. IOW, the javac (Java compiler) and jar (Java archiver) executables should be in the PATH.
* Java include files for windows (win32, even for w64 builds). They should reside in "<mxe-octave build dir>/usr/x86_64-w64-mingw32/include/java/win32". If not present, mxe-octave downloads them but this can occasionally go wrong. On a multi-boot system a solution (note: dirty hack warning!) is symlinking to the Windows include files on the Windows partition from the mxe-octave location.


====If things go wrong====
====If things go wrong====
Line 274: Line 250:
* The image expires after 90 days. But if you make a VirtualBox snapshot it will last longer, and you don't need to uninstall Octave each time before installing a new build.
* The image expires after 90 days. But if you make a VirtualBox snapshot it will last longer, and you don't need to uninstall Octave each time before installing a new build.


==Footnotes==
<references/>


[[Category:Packaging]]
[[Category:Packaging]]

Navigation menu