Skip to content

Commit bbdff64

Browse files
authored
Merge pull request #647 from iory/apple-silicon
Support apple silicon arm architecture
2 parents c633d33 + 95ee85f commit bbdff64

File tree

3 files changed

+33
-7
lines changed

3 files changed

+33
-7
lines changed

.github/workflows/config.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ jobs:
112112
apt-get install -qq -y dpkg # necessary for catkin-pkg to be installable
113113
echo "Testing branch $GITHUB_REF of $GITHUB_REPOSITORY"
114114
sh -c 'echo "deb http://packages.ros.org/ros-shadow-fixed/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'
115-
wget http://packages.ros.org/ros.key -O - | apt-key add -
115+
# Replace the old apt-key add with the new method for adding the key
116+
# https://github.com/ros/rosdistro/pull/46048
117+
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
116118
apt-get update -qq
117119
apt-get install -qq -y python-catkin-tools python-rosdep
118120
apt-get install -qq -y build-essential git ros-melodic-rosbash ros-melodic-rospack
@@ -186,7 +188,18 @@ jobs:
186188
187189
188190
osx:
189-
runs-on: macos-13 # https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
191+
strategy:
192+
matrix:
193+
include:
194+
# https://github.com/actions/runner-images/tree/main/images/macos
195+
# Note: To test macOS-x with Intel architecture,
196+
# you need to use the paid macOS-x-large runner, as macOS-x is grouped with ARM-based runners.
197+
# https://docs.github.com/en/actions/concepts/runners/about-larger-runners
198+
- runs-on: macos-13 # Intel (x64)
199+
- runs-on: macos-14 # ARM64 (Apple Silicon)
200+
- runs-on: macos-15 # ARM64 (Apple Silicon)
201+
fail-fast: false
202+
runs-on: ${{ matrix.runs-on }}
190203
timeout-minutes: 60
191204
steps:
192205
- name: Checkout
@@ -195,7 +208,7 @@ jobs:
195208
id: brew-cache
196209
run: echo "::set-output name=dir::$(brew --cache)/downloads"
197210
- name: Brew cache
198-
uses: actions/cache@v2
211+
uses: actions/cache@v4
199212
with:
200213
path: ${{ steps.brew-cache.outputs.dir }}
201214
key: ${{ runner.os }}-${{ hashFiles('.github/workflows/Brewfile') }}
@@ -217,6 +230,10 @@ jobs:
217230
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
218231
# since macos-11, we need to install GL/gl.h
219232
HOMEBREW_NO_AUTO_UPDATE=1 brew install mesa-glu
233+
# since macos-14, we need to install GL/gl.h for mesalib-glw and X11 for xquartz
234+
HOMEBREW_NO_AUTO_UPDATE=1 brew install mesalib-glw xquartz
235+
# since macos-13, we need to install jpeg
236+
HOMEBREW_NO_AUTO_UPDATE=1 brew install jpeg
220237
./.travis-osx.sh
221238
- name: Cleanup some brew downloads
222239
run: cd ${{ steps.brew-cache.outputs.dir }} && ls -lsS | head -n 10 | awk '{ print $10 }' | xargs rm -rf

irteus/Makefile.Darwin

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ ESFX=
5353
SOFLAGS=-g -falign-functions=8
5454
IMPLIB=-L$(EUSDIR)/$(ARCHDIR)/lib -leusgeo -L$(INSTALLLIBDIR) -lnr
5555
IMPLIBGL=-L$(EUSDIR)/$(ARCHDIR)/lib -leusgl -L/usr/X11R6/lib -lGLU -lGL -lXext
56-
IMPLIBIMG=-L/opt/local/lib/jpeg6b/lib -ljpeg -L/opt/local/lib -lpng
56+
IMPLIBIMG=-L/opt/local/lib/jpeg6b/lib -ljpeg -L/opt/local/lib -lpng -L/opt/homebrew/lib -L/usr/local/lib
5757
EXPLIB=
5858
RAPID=-LRAPID/$(ARCHDIR) -lRAPID-static
5959
RAPIDLIB=RAPID/$(ARCHDIR)/$(LPFX)RAPID-static.a
@@ -64,14 +64,23 @@ SVNVERSION=\"$(shell git rev-parse --short HEAD)\"
6464
ARCH=Darwin
6565
# copy from eus/lisp/Makefile.Darwin
6666
OS_VERSION=$(shell sw_vers -productVersion | sed s/\.[^.]*$$//)
67+
ARCH_TYPE=$(shell uname -m)
6768
ifeq ($(OS_VERSION), 10.5)
6869
MACHINE=i386
6970
else
70-
MACHINE=x86_64
71+
ifeq ($(ARCH_TYPE), arm64)
72+
MACHINE=arm64
73+
else
74+
MACHINE=x86_64
75+
endif
7176
endif
7277
THREAD= -DTHREADED -DPTHREAD
7378

74-
CFLAGS=-O2 -D$(MACHINE) -D$(ARCH) -DLinux -D_REENTRANT -DGCC -I/opt/local/include -I$(EUSDIR)/include $(THREAD) -DSVNVERSION=$(SVNVERSION)
79+
ifeq ($(MACHINE), arm64)
80+
CFLAGS=-O2 -D$(MACHINE) -Daarch64 -D$(ARCH) -DLinux -D_REENTRANT -DGCC -I/opt/local/include -I/opt/homebrew/include -I/usr/local/include -I$(EUSDIR)/include $(THREAD) -DSVNVERSION=$(SVNVERSION)
81+
else
82+
CFLAGS=-O2 -D$(MACHINE) -D$(ARCH) -DLinux -D_REENTRANT -DGCC -I/opt/local/include -I/opt/homebrew/include -I/usr/local/include -I$(EUSDIR)/include $(THREAD) -DSVNVERSION=$(SVNVERSION)
83+
endif
7584
CXXFLAGS=$(CFLAGS)
7685

7786
CFLAGS+= -g -falign-functions=8 -fPIC

irteus/test/geo.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
(normal (float-vector 0 0 0))
1212
eps)
1313
;; somehow arm architecture needs to return #f(0 0 0) for small normalized vectors
14-
(if (member :arm *features*)
14+
(if (or (member :arm *features*) (member :aarch64 *features*))
1515
(setq eps 1.0e-10)
1616
(setq eps 1.0e-20))
1717
(while vlist

0 commit comments

Comments
 (0)