Commit 66d48f59 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Compatibility fixes for Octave 3.8.

- no longer use OCTAVE_QUIT in MEX files; this seems now only possible in
  oct-files. (Ref #304)
- do not build linsolve.oct on Octave >= 3.8, it is available natively.
- do not add strjoin.m to the patch on Octave >= 3.8, it is available natively.
- default_save_options has been renamed save_default_options.
parent 7c6d5b3e
...@@ -64,7 +64,11 @@ more off ...@@ -64,7 +64,11 @@ more off
% sets default format for save() command % sets default format for save() command
if isoctave if isoctave
default_save_options('-mat') if octave_ver_less_than('3.8')
default_save_options('-mat')
else
save_default_options('-mat')
end
end end
if nargin < 1 if nargin < 1
......
...@@ -94,8 +94,9 @@ if isoctave || matlab_ver_less_than('7.4') ...@@ -94,8 +94,9 @@ if isoctave || matlab_ver_less_than('7.4')
addpath([dynareroot '/missing/ilu']) addpath([dynareroot '/missing/ilu'])
end end
% strjoin is missing in older versions of MATLAB and in Octave % strjoin is missing in older versions of MATLAB and in Octave < 3.8
if isoctave || matlab_ver_less_than('8.1') if (isoctave && octave_ver_less_than('3.8')) || ...
(~isoctave && matlab_ver_less_than('8.1'))
addpath([dynareroot '/missing/strjoin']) addpath([dynareroot '/missing/strjoin'])
end end
......
...@@ -2,7 +2,11 @@ ACLOCAL_AMFLAGS = -I ../../../m4 ...@@ -2,7 +2,11 @@ ACLOCAL_AMFLAGS = -I ../../../m4
# libdynare++ must come before gensylv, k_order_perturbation, dynare_simul_ # libdynare++ must come before gensylv, k_order_perturbation, dynare_simul_
if DO_SOMETHING if DO_SOMETHING
SUBDIRS = mjdgges kronecker bytecode libdynare++ gensylv qzcomplex ordschur block_kalman_filter sobol local_state_space_iterations linsolve SUBDIRS = mjdgges kronecker bytecode libdynare++ gensylv qzcomplex ordschur block_kalman_filter sobol local_state_space_iterations
if COMPILE_LINSOLVE
SUBDIRS += linsolve
endif
if HAVE_MATIO if HAVE_MATIO
SUBDIRS += k_order_perturbation dynare_simul_ SUBDIRS += k_order_perturbation dynare_simul_
......
...@@ -31,8 +31,13 @@ if test "x$MKOCTFILE" != "x"; then ...@@ -31,8 +31,13 @@ if test "x$MKOCTFILE" != "x"; then
FFLAGS=`$MKOCTFILE -p FFLAGS` FFLAGS=`$MKOCTFILE -p FFLAGS`
CXXFLAGS=`$MKOCTFILE -p CXXFLAGS` CXXFLAGS=`$MKOCTFILE -p CXXFLAGS`
LDFLAGS="`$MKOCTFILE -p LFLAGS` `$MKOCTFILE -p LDFLAGS`" LDFLAGS="`$MKOCTFILE -p LFLAGS` `$MKOCTFILE -p LDFLAGS`"
OCTAVE_VERSION=`$MKOCTFILE -v 2>&1 | sed 's/mkoctfile, version //'`
AX_COMPARE_VERSION([$OCTAVE_VERSION], [lt], [3.6], [AC_MSG_ERROR([Your Octave is too old, please upgrade to version 3.6 at least.])])
AX_COMPARE_VERSION([$OCTAVE_VERSION], [ge], [3.8], [OCTAVE38=yes])
fi fi
AM_CONDITIONAL([COMPILE_LINSOLVE], [test "$OCTAVE38" != "yes"])
CFLAGS="$CFLAGS -Wall -Wno-parentheses" CFLAGS="$CFLAGS -Wall -Wno-parentheses"
FFLAGS="$FFLAGS -Wall" FFLAGS="$FFLAGS -Wall"
CXXFLAGS="$CXXFLAGS -Wall -Wno-parentheses" CXXFLAGS="$CXXFLAGS -Wall -Wno-parentheses"
...@@ -110,6 +115,12 @@ else ...@@ -110,6 +115,12 @@ else
BUILD_MS_SBVAR_MEX_OCTAVE="no (missing GSL or MatIO library)" BUILD_MS_SBVAR_MEX_OCTAVE="no (missing GSL or MatIO library)"
fi fi
if test -n "$MKOCTFILE" -a "$OCTAVE38" != "yes"; then
BUILD_LINSOLVE_OCTAVE="yes"
else
BUILD_LINSOLVE_OCTAVE="no (Octave >= 3.8)"
fi
AC_ARG_ENABLE([openmp], AS_HELP_STRING([--enable-openmp], [use OpenMP for parallelization of some MEX files]), [ AC_ARG_ENABLE([openmp], AS_HELP_STRING([--enable-openmp], [use OpenMP for parallelization of some MEX files]), [
if test "x$enable_openmp" = "xyes"; then if test "x$enable_openmp" = "xyes"; then
CPPFLAGS="$CPPFLAGS -DUSE_OMP" CPPFLAGS="$CPPFLAGS -DUSE_OMP"
...@@ -127,6 +138,7 @@ Binaries (with "make"): ...@@ -127,6 +138,7 @@ Binaries (with "make"):
MS-SBVAR MEX files for Octave: $BUILD_MS_SBVAR_MEX_OCTAVE MS-SBVAR MEX files for Octave: $BUILD_MS_SBVAR_MEX_OCTAVE
Kalman Steady State MEX file for Octave: $BUILD_KALMAN_STEADY_STATE_OCTAVE Kalman Steady State MEX file for Octave: $BUILD_KALMAN_STEADY_STATE_OCTAVE
Estimation, k-order and dynare_simul MEX for Octave: $BUILD_ESTIMATION_KORDER_DYNSIMUL_MEX_OCTAVE Estimation, k-order and dynare_simul MEX for Octave: $BUILD_ESTIMATION_KORDER_DYNSIMUL_MEX_OCTAVE
Linsolve for Octave: $BUILD_LINSOLVE_OCTAVE
]) ])
......
...@@ -267,9 +267,6 @@ struct s_plan ...@@ -267,9 +267,6 @@ struct s_plan
#ifdef MATLAB_MEX_FILE #ifdef MATLAB_MEX_FILE
extern "C" bool utIsInterruptPending(); extern "C" bool utIsInterruptPending();
#else
#include <octave/oct.h>
#include <octave/unwind-prot.h>
#endif #endif
#ifdef _MSC_VER #ifdef _MSC_VER
...@@ -575,9 +572,7 @@ public: ...@@ -575,9 +572,7 @@ public:
while (go_on) while (go_on)
{ {
#ifdef OCTAVE_MEX_FILE #ifdef MATLAB_MEX_FILE
OCTAVE_QUIT;
#else
if ( utIsInterruptPending() ) if ( utIsInterruptPending() )
throw UserExceptionHandling(); throw UserExceptionHandling();
#endif #endif
......
...@@ -24,9 +24,6 @@ ...@@ -24,9 +24,6 @@
#ifdef MATLAB_MEX_FILE #ifdef MATLAB_MEX_FILE
extern "C" bool utIsInterruptPending(); extern "C" bool utIsInterruptPending();
#else
#include <octave/oct.h>
#include <octave/unwind-prot.h>
#endif #endif
Evaluate::Evaluate() Evaluate::Evaluate()
...@@ -139,9 +136,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int ...@@ -139,9 +136,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
jacob_exo_det = mxGetPr(jacobian_det_exo_block[block_num]); jacob_exo_det = mxGetPr(jacobian_det_exo_block[block_num]);
} }
} }
#ifdef OCTAVE_MEX_FILE #ifdef MATLAB_MEX_FILE
OCTAVE_QUIT;
#else
if ( utIsInterruptPending() ) if ( utIsInterruptPending() )
throw UserExceptionHandling(); throw UserExceptionHandling();
#endif #endif
......
...@@ -5139,9 +5139,7 @@ dynSparseMatrix::Solve_ByteCode_Symbolic_Sparse_GaussianElimination(int Size, bo ...@@ -5139,9 +5139,7 @@ dynSparseMatrix::Solve_ByteCode_Symbolic_Sparse_GaussianElimination(int Size, bo
{ {
/*clock_t time11 = clock(); /*clock_t time11 = clock();
mexPrintf("t=%d, record = %d\n",t, record);*/ mexPrintf("t=%d, record = %d\n",t, record);*/
#ifdef OCTAVE_MEX_FILE #ifdef MATLAB_MEX_FILE
OCTAVE_QUIT;
#else
if ( utIsInterruptPending() ) if ( utIsInterruptPending() )
throw UserExceptionHandling(); throw UserExceptionHandling();
#endif #endif
......
Supports Markdown
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