From 68a7e98bf9f4bd726af0c95feb2f269d4ee83af1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Mon, 3 Jun 2024 16:56:45 +0200
Subject: [PATCH] =?UTF-8?q?macOS:=20bump=20to=20GCC=2014=20for=20=E2=80=9C?=
 =?UTF-8?q?use=5Fdll=E2=80=9D=20option?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

By the way, fix the error message if a compiler cannot be found.

(cherry picked from commit e351c2d2b025fde1c2315e085f1c571a1a85db8e)
---
 src/ModelTree.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/ModelTree.cc b/src/ModelTree.cc
index 41bed024..c900811e 100644
--- a/src/ModelTree.cc
+++ b/src/ModelTree.cc
@@ -1637,7 +1637,7 @@ ModelTree::findCompilerOnMacos(const string& mexext)
      Apple’s clang is located both in /usr/bin/gcc and /usr/bin/clang, it
      automatically selects x86_64 or arm64 depending on the compile-time
      environment. */
-  const string macos_gcc_version {"13"};
+  const string macos_gcc_version {"14"};
 
   if (filesystem::path global_gcc_path {"/usr/local/bin/gcc-" + macos_gcc_version};
       exists(global_gcc_path) && mexext == "mexmaci64")
@@ -1649,14 +1649,14 @@ ModelTree::findCompilerOnMacos(const string& mexext)
     return {global_clang_path, true};
   else
     {
-      cerr << "ERROR: You must install gcc-" << macos_gcc_version
+      cerr << "ERROR: You must install gcc@" << macos_gcc_version
            << " on your system before using the `use_dll` option of Dynare. "
            << "You should install Homebrew";
       if (mexext == "mexmaca64")
         cerr << " for arm64";
       else if (mexext == "mexmaci64")
         cerr << " for x86_64";
-      cerr << " and run `brew install gcc-" << macos_gcc_version << "` in a terminal." << endl;
+      cerr << " and run `brew install gcc@" << macos_gcc_version << "` in a terminal." << endl;
       exit(EXIT_FAILURE);
     }
 }
-- 
GitLab