From 1c3e6f89af54ad20f94ab7d01db7465e715d2f29 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Thu, 24 Jun 2021 12:18:07 +0200
Subject: [PATCH] macOS: bump to GCC 11 (for compilation and for use_dll)

---
 .gitlab-ci.yml   | 2 +-
 src/ModelTree.cc | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7fd39e40..fccd96eb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -83,7 +83,7 @@ build_macos_x86_64:
     - macOS
   script:
     - autoreconf -si
-    - './configure CC=gcc-10 CXX=g++-10 LDFLAGS="-static-libgcc -s" LEX=/usr/local/opt/flex/bin/flex YACC=/usr/local/opt/bison/bin/bison'
+    - './configure CC=gcc-11 CXX=g++-11 LDFLAGS="-static-libgcc -s" LEX=/usr/local/opt/flex/bin/flex YACC=/usr/local/opt/bison/bin/bison'
     - make -j$(nproc)
     - mkdir -p $CI_COMMIT_SHA/macos-x86_64
     - tar -caf $CI_COMMIT_SHA/macos-x86_64/dynare-preprocessor.tar.gz -C src dynare-preprocessor
diff --git a/src/ModelTree.cc b/src/ModelTree.cc
index bcfc7754..a20f3d7f 100644
--- a/src/ModelTree.cc
+++ b/src/ModelTree.cc
@@ -1957,16 +1957,16 @@ ModelTree::compileMEX(const string &basename, const string &funcname, const stri
           if (_NSGetExecutablePath(dynare_m_path, &size) == 0)
             {
               string str = dynare_m_path;
-              gcc_relative_path = str.substr(0, str.find_last_of("/")) + "/../../.brew/bin/gcc-10";
+              gcc_relative_path = str.substr(0, str.find_last_of("/")) + "/../../.brew/bin/gcc-11";
             }
 
           if (filesystem::exists(gcc_relative_path))
             compiler = gcc_relative_path;
-          else if (filesystem::exists("/usr/local/bin/gcc-10"))
-            compiler = "/usr/local/bin/gcc-10";
+          else if (filesystem::exists("/usr/local/bin/gcc-11"))
+            compiler = "/usr/local/bin/gcc-11";
           else
             {
-              cerr << "ERROR: You must install gcc-10 on your system before using the `use_dll` option of Dynare. "
+              cerr << "ERROR: You must install gcc-11 on your system before using the `use_dll` option of Dynare. "
                    << "You can do this via the Dynare installation package." << endl;
               exit(EXIT_FAILURE);
             }
-- 
GitLab