From e705df6e737210acbb2ad7842c9de4e3026dcabd Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Fri, 14 Oct 2016 17:35:10 +0200
Subject: [PATCH] =?UTF-8?q?preprocessor:=20don=E2=80=99t=20need=20compiler?=
 =?UTF-8?q?=20argument=20to=20dynare=20when=20using=20octave.=20closes=20#?=
 =?UTF-8?q?1314?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 preprocessor/ModFile.cc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/preprocessor/ModFile.cc b/preprocessor/ModFile.cc
index 173f9b669c..d2847cd4b1 100644
--- a/preprocessor/ModFile.cc
+++ b/preprocessor/ModFile.cc
@@ -756,7 +756,11 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
         // MATLAB/Windows + MinGW g++
         mOutputFile << "dyn_mex('mingw', '" << basename << "', " << !check_model_changes << ")" << endl;
       else
-        mOutputFile << "    error('When using the USE_DLL option, you must give the ''cygwin'', ''msvc'', or ''mingw'' option to the ''dynare'' command')" << endl;
+        mOutputFile << "if isoctave" << endl
+                    << "    dyn_mex('', '" << basename << "', " << !check_model_changes << ")" << endl
+                    << "else" << endl
+                    << "    error('When using the USE_DLL option on Matlab, you must give the ''cygwin'', ''msvc'', or ''mingw'' option to the ''dynare'' command')" << endl
+                    << "end" << endl;
 #else
       // other configurations
       mOutputFile << "dyn_mex('', '" << basename << "', " << !check_model_changes << ")" << endl;
-- 
GitLab