Commit 357a91c1 authored by Sébastien Villemot's avatar Sébastien Villemot

Merge branch 'master' into 'master'

macOS packaging: compile against the version of Octave distributed via...

See merge request Dynare/dynare!1679
parents 651b400f 0c77f7e9
......@@ -97,14 +97,8 @@ Note that several versions of Dynare can coexist (by default in
``/Applications/Dynare``), as long as you correctly adjust your path
settings (see :ref:`words-warning`).
To install Dynare for Octave, first install Homebrew following the
instructions on their site: `https://brew.sh/
<https://brew.sh/>`__. Then install Octave, issuing the command ``brew
install octave`` at the Terminal prompt. You can then install the
latest stable version of Dynare by typing ``brew install dynare`` at
the Terminal prompt. You can also pass options to the installation
command. These options can be viewed by typing ``brew info dynare`` at
the Terminal prompt.
Dynare for Octave works with Octave installed via the package located here:
`https://octave-app.org <https://octave-app.org>`__.
For other systems
......@@ -209,10 +203,10 @@ command; the packaging does it for you. Under Arch Linux, you need to do::
octave:1> addpath /usr/lib/dynare/matlab
Under macOS, assuming that you have installed Dynare and Octave via
Homebrew, type::
Under macOS, assuming you have installed Octave via `https://octave-app.org
<https://octave-app.org>`__, type::
octave:1> addpath /usr/local/opt/dynare/lib/dynare/matlab
octave:1> addpath /Applications/Dynare/4.x.y/matlab
If you don’t want to type this command every time you run Octave, you
can put it in a file called ``.octaverc`` in your home directory
......
......@@ -152,15 +152,18 @@ cp -L "$ROOTDIR"/mex/matlab/* "$PKGFILES"
## Create mex for Octave
##
cd "$ROOTDIR"/mex/build/octave
CC=$CC CXX=$CXX ./configure \
OCTAVE_VERSION=$(grep OCTAVE_VERSION "$ROOTDIR"/macOS/deps/versions.mk | cut -d'=' -f2 | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
OCTAVE_USR_DIR="/Applications/Octave-$OCTAVE_VERSION.app/Contents/Resources/usr"
OCTAVE_BIN_DIR="$OCTAVE_USR_DIR/Cellar/octave-octave-app@$OCTAVE_VERSION/$OCTAVE_VERSION/bin"
PATH="$OCTAVE_BIN_DIR:$PATH" CC=$CC CXX=$CXX ./configure \
PACKAGE_VERSION="$VERSION" \
PACKAGE_STRING="dynare $VERSION" \
CXXFLAGS=-I/usr/local/include \
LDFLAGS="-static-libgcc -L/usr/local/lib" \
LDFLAGS="-static-libgcc -L$OCTAVE_USR_DIR/lib " \
--with-gsl="$LIB64"/gsl \
--with-matio="$LIB64"/matio \
--with-slicot="$LIB64"/Slicot/with-underscore
make -j"$NTHREADS"
PATH="$OCTAVE_BIN_DIR:$PATH" make -j"$NTHREADS"
cp -L "$ROOTDIR"/mex/octave/* "$PKGFILES"/mex/octave
echo -e "function v = supported_octave_version\nv=\"$(octave --eval "disp(OCTAVE_VERSION)")\";\nend" > "$PKGFILES"/matlab/supported_octave_version.m
......
SLICOT_VERSION = 5.0+20101122
X13AS_VERSION = 1.1_B39
OCTAVE_VERSION = 4.4.1
......@@ -32,6 +32,14 @@ FFLAGS="$($MKOCTFILE -p FFLAGS) -Wall"
CXXFLAGS="$($MKOCTFILE -p CXXFLAGS) -Wall -Wno-parentheses -Wold-style-cast"
LDFLAGS="$($MKOCTFILE -p LFLAGS) $($MKOCTFILE -p LDFLAGS)"
AC_CANONICAL_HOST
case ${host_os} in
darwin*)
CXXFLAGS="$($MKOCTFILE -p ALL_CXXFLAGS) -Wall -Wno-parentheses -Wold-style-cast -O2"
LDFLAGS+="$($MKOCTFILE -p OCTAVE_LIBS)"
;;
esac
OCTAVE_VERSION=$($MKOCTFILE -v 2>&1 | sed 's/mkoctfile, version //')
AX_COMPARE_VERSION([$OCTAVE_VERSION], [lt], [4.2], [AC_MSG_ERROR([Your Octave is too old, please upgrade to version 4.2 at least (or disable Octave support with --disable-octave).])])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment