From 38fbcee7898d689051b84e21549091c7fc0408c2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Mon, 13 Mar 2023 16:55:49 +0100
Subject: [PATCH] CI: adapt for new macOS runner
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- enforce x86-64 architecture
- use “sysctl -n hw.ncpu” instead of “nproc” (which has not been installed in
  the new runner)
- use MATLAB R2022b for building with the latest ABI

(manually cherry picked from commit 7159a293d60d3d79136d4094143538a94156ca18)
---
 .gitlab-ci.yml | 2 +-
 macOS/build.sh | 4 ++--
 preprocessor   | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 606e9a18da..085881d666 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -99,7 +99,7 @@ pkg_macOS:
   stage: pkg
   script:
     - ln -s ~/tarballs macOS/deps/
-    - make -C macOS
+    - arch -x86_64 make -C macOS
   cache:
     key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
     paths:
diff --git a/macOS/build.sh b/macOS/build.sh
index 2f149c9684..9b283bf572 100755
--- a/macOS/build.sh
+++ b/macOS/build.sh
@@ -29,7 +29,7 @@ CC=gcc-$GCC_VERSION
 CXX=g++-$GCC_VERSION
 
 # Set the number of threads
-NTHREADS=$(nproc)
+NTHREADS=$(sysctl -n hw.ncpu)
 
 # Set dependency directory
 LIB64="$ROOTDIR"/macOS/deps/lib64
@@ -174,7 +174,7 @@ make clean
   --with-gsl="$LIB64"/gsl \
   --with-matio="$LIB64"/matio \
   --with-slicot="$LIB64"/Slicot/with-underscore \
-  --with-matlab=/Applications/MATLAB_R2019b.app
+  --with-matlab=/Applications/MATLAB_R2022b.app
 make -j"$NTHREADS"
 cp -L  "$ROOTDIR"/mex/matlab/*                                       "$PKGFILES"/mex/matlab/maci64-9.4-9.13
 
diff --git a/preprocessor b/preprocessor
index 99fe194f54..3f4aab4f08 160000
--- a/preprocessor
+++ b/preprocessor
@@ -1 +1 @@
-Subproject commit 99fe194f549e9ca8c500642c8d87fb1fde97c308
+Subproject commit 3f4aab4f08191a218ee35759c5dec32a0ada5192
-- 
GitLab