Since Octave 7, LDFLAGS as returned by mkoctfile include -shared, which is
undesirable for generic LDFLAGS. Pass the --link-stand-alone option to strip
this flag.
By the way, drop the -static-* flags from LDFLAGS in Windows mkoctfile stub. It
is no more needed and creates duplicates in the link command line (since those
flags are already in DL_LDFLAGS).
The Octave package for Windows ships with libgfortran from gfortran 9. This
version of libgfortran does not include symbol _gfortran_os_error_at, which is
needed by binaries created with gfortran 10 (used on our runners). The solution
is to statically link against libgfortran (as we already do for libgcc and
libstdc++).
Add -std=legacy to FFLAGS.
Do the same for the Windows package, even though we don’t yet use version 10 of
gfortran (but that will of course happen at some point).
The detection of the slicot library failed because xerbla has been moved out of
the BLAS implementation shipped with Octave (probably since 5.1.0). This commit
fixes our fake implementation of mkoctfile so that it returns -lxerbla after
-lblas (as is done in the official Windows package for Octave).
Those archives contain 3 hidden files, which always have the same name. This
can make the parallel build fail when several packages are unpacked at the same
time. Hence, we just skip these files when unpacking.
– before executing the rule for unpacking the source, delete previously
unpacked sources to avoid file overwrite (delete all versions so that the
Gitlab cache does not grow too big)
— ensure that those rules are executed when a patch is modified
The scripts are based the former “dynare-build” project. They have been
overhauled and simplified.
Building a Windows package (both installer and zip archive) is as easy as
running “make -C windows” (provided the right Debian packages are installed,
use the “windows/install-packages.sh” script for that purpose).
The layout of MEX files for Octave in the package has been
changed (mex/octave/win32/ and mex/octave/win64/ instead of mex/octave32/ and
mex/octave/), for consistency with MATLAB MEX.