Windows Installer: Difference between revisions

Jump to navigation Jump to search
3,311 bytes added ,  11 September 2018
no edit summary
No edit summary
(12 intermediate revisions by 8 users not shown)
Line 17: Line 17:
* Use <code>make tar-dist</code> or <code>make zip-dist</code> instead of <code>nsis-installer</code> if you want to build just an archive of the files to install on Windows instead of an installer wizard.
* Use <code>make tar-dist</code> or <code>make zip-dist</code> instead of <code>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.
* 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.
* 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 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.
* 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===
===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 what Philip Nienhuis does:
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)
# Make the cross-build environment for Octave (=mxe-octave; see above)
Line 30: Line 30:
====Step 1: Prepare mxe-octave====
====Step 1: Prepare mxe-octave====
Clone the mxe-octave reop to some directory of your choice:
Clone the mxe-octave reop to some directory of your choice:
  http://hg/octave.org/mxe-octave <name of mxe-octave build dir>
  http://hg.octave.org/mxe-octave <name of mxe-octave build dir>
where <name of mxe-octave build dir> is some other name than just the default "mxe-octave".  
where <name of mxe-octave build dir> is some other name than just the default "mxe-octave".  
Once downloaded, go into the <name of mxe-octave build dir> subdir and do:
Once downloaded, go into the <name of mxe-octave build dir> subdir and do:
Line 36: Line 36:
  ./configure <options you want>
  ./configure <options you want>
  make nsis-installer JOBS=<some number>
  make nsis-installer JOBS=<some number>
I usually have "--enable-devel-tools --enable-windows-64 --enable-octave=default --enable-binary-packages" as configure options and use JOBS=7 on my core i5 system.
Your author usually has "--enable-devel-tools --enable-octave=default --enable-binary-packages" as configure options and use JOBS=7 on my core i5 system.
For stable branch it is "--enable-devel-tools --enable-octave=stable --enable-binary-packages --enable-64 --enable-fortran-int64" or "--enable-devel-tools --enable-octave=stable --enable-binary-packages --enable-windows64"
* the first configure option also includes gdb and an MSYS shell in the binary
* the first configure option also includes gdb and an MSYS shell in the binary
* the second avoids the ~700 MB max. array size limit for 32-bit executables but Octave will only run on 64-bit Windows (most Windows systems are 64 bit anyway these days). Note: this option does NOT imply 64-bit indexing
* the second avoids the ~700 MB max. array size limit for 32-bit executables but Octave will only run on 64-bit Windows (most Windows systems are 64 bit anyway these days). Note: this option does NOT imply 64-bit indexing
Line 43: Line 44:
If you seriously want to work with gdb, also have --disable-strip-dist-files as configure option. However, in that case chances are that you cannot build an .exe installer anymore as it becomes too big for NSIS (that has a 2 GB installer file size limit) so instead of "make nsis-installer" you'll need to invoke  
If you seriously want to work with gdb, also have --disable-strip-dist-files as configure option. However, in that case chances are that you cannot build an .exe installer anymore as it becomes too big for NSIS (that has a 2 GB installer file size limit) so instead of "make nsis-installer" you'll need to invoke  
  make zip-dist <options>
  make zip-dist <options>
....and this results in all Octave dependencies being built in mxe-octave, plus some initial version of Octave itself.
....and this results in all Octave dependencies being built in mxe-octave, plus (stable) Octave, plus an initial version of a binary Octave-Windows installer in the <mxe-octave build>/dist/ subdirectoy.


It can happen that you meet problems with Java. To build Octave with Java support built-in, mxe-octave needs:
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.
* 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. What I often did on my multi-boot system (Note: dirty hack warning!) is symlinking to the Windows include files on the Windows partition from the mxe-octave location.
* 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:====
====Step 2: To build your first Octave-for Windows development version:====
Line 56: Line 57:


Note that this step requires the Octave be configured with Java (i.e., you need javac and jar on your system).
Note that this step requires the Octave be configured with Java (i.e., you need javac and jar on your system).
{{Note|If you skip this step, mxe-octave will build using the source available from from the [http://hydra.nixos.org/job/gnu/octave-default/tarball/latest/download hydra site].
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====
==== 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.gz 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.
* 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.gz 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.
Line 79: Line 84:


====Remarks====
====Remarks====
* If you have several mxe-octavebuild dirs (for e.g., stable and several development versions) it is handy to have a separate pkg subdir symlinked to from all mxe-octave build dirs. That will save a lot of downloading bandwidth.
* If you have several mxe-octave build dirs (for e.g., stable and several development versions) it is handy to have a separate pkg subdir symlinked to from all mxe-octave build dirs. That will save a lot of downloading bandwidth.
* As of late Dec 2015, mxe-octave allows out-of-tree builds, which makes it a lot easier to build separate Octave versions with the same mxe-octave tree. (See http://hg.octave.org/mxe-octave/rev/0962acdde3be)
* To keep mxe-octave up-to-date, from time to time do:
* To keep mxe-octave up-to-date, from time to time do:
  hg -v pull
  hg -v pull
  hg -v update
  hg -v update
* 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.
* Sometimes, when using the "--enable-binary-packages" flag, it happens that Octave-Forge packages with binary modules don't work well on the Windows side. Usually the cause is that the Octave dev version has changed too much since the last cross-build of the OF packages. Solution: just do in <mxe-octave>/:
touch src/of*.mk
make <OPTIONS>
mxe-octave will rebuild all OF packages then incl. the offending binary modules.
* 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.


Line 93: Line 103:
* The configuration will be for the target system, not your own.  In particular, if you have not installed all of the packages that MXE-octave installs, then your configuration will be different.  However, some configuration variables will differ even if you have the same packages, and some compiler features may be available on the host system that are not available in cross-compile mode.
* The configuration will be for the target system, not your own.  In particular, if you have not installed all of the packages that MXE-octave installs, then your configuration will be different.  However, some configuration variables will differ even if you have the same packages, and some compiler features may be available on the host system that are not available in cross-compile mode.
* A possible causes for build failure is having files in your local source or build directory that are not listed in the module.mk files; these are not copied into the dist archive.
* A possible causes for build failure is having files in your local source or build directory that are not listed in the module.mk files; these are not copied into the dist archive.
* (philip) On my core i5 desktop system with a fast SSD, mxe-octave usually fails when building libmng, suspectedly because of a race condition related to disk I/O. I found that I can get past this by specifying "make nsis-installer JOBS=1", if required repeatedly (sometimes 5 or 6 times), interrupting the build in the next step/dependency once libmng has been built fine, and restaring with "make nsis-installer JOBS=<higher number>". AFAICS it is only libmng that suffers from this issue.
* (philip, confirmed by oheim) On my core i5 desktop system with a fast SSD, mxe-octave builds usually fails at libmng, suspectedly because of a race condition related to disk I/O. A way to get past this is by specifying "make nsis-installer JOBS=1", if required repeatedly (sometimes 5 or 6 times), interrupting the build in the next step/dependency once libmng has been built fine, and restarting with "make nsis-installer JOBS=<higher number>". As of Dec. 2015 it is only libmng that has this issue.


==Installing requirements of MXE Octave==
==Installing requirements of MXE Octave==
Line 113: Line 123:
If you are using Ubuntu, then you can do <code>apt-get install foo</code> instead of <code>aptitude install -R foo</code>.
If you are using Ubuntu, then you can do <code>apt-get install foo</code> instead of <code>aptitude install -R foo</code>.


On a fesh Linux Mint 16 x86_64, in addition to the above also install:
On a fresh Linux Mint 16 x86_64, in addition to the above also install:


  sudo apt-get install libc6-dev-i386 gcc-multilib libgmp3-dev libmpfr4 libmpfr-dev
  sudo apt-get install libc6-dev-i386 gcc-multilib libgmp3-dev libmpfr4 libmpfr-dev
Line 198: Line 208:
==Creating an NSIS based installer==
==Creating an NSIS based installer==
The <code>make nsis-installer</code> command produces a NSIS installer that is ready to be distributed.  
The <code>make nsis-installer</code> command produces a NSIS installer that is ready to be distributed.  
==Trying out cross-built Octave on Linux through VirtualBox==
Micosoft makes pre-built Windows 10 virtual disk images available for testing. While primarily meant for testing the MS-Edge browser, the license for these images does not limit the use of these images to just MS-Edge. So it is perfectly possible to also test Octave.
There are several advantages:
* Rebooting from Linux to Windows isn't needed;
* The latest Windows 10 version is always available;
* Building the installer or zip/7z/<whatever> archives itself isn't needed. One can interrupt the build process after the entire installation of Octave has been made in the dist/octave subdirectory of mxe-octave, i.e., when the message "generating installer" (or "zip...") is shown, saving ~10-15 minutes.
Of course one an also install (or unpack) octave into the virtualized Windows 10.
Steps:
* Install Virtualbox
* Grab a copy of the Windows 10 image here:  https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/
* Unpack and import the disk image into VirtualBox.
* In VirtualBox, select Settings | Shared folders and setup access from Windows 10 to the Linux subdir where you but mxe-octave. It is advised to make it read-only.
Then:
* Either install (or unpack) Octave into Windows 10, or
* Create a shortcut to octave.vbs in the dist/octave subdir on Linux.
Hints:
* I adapted mxe-octave/binary-dist-rules.mk to have a consistent name for the dist/octave subdir (i.e., without time/date/bitwidth suffixes) so that in Windows the shortcut doesn't need adaptation after each cross-build action. Maybe it is better if binary-dist-rules.mk has a rule to create a symlink "dist/octave/" pointing to the latest cross-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.


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

edits

Navigation menu