Merge ~jeonghanlee/epics-base:darwin-aarch64 into ~epics-core/epics-base/+git/epics-base:7.0

Proposed by Andrew Johnson
Status: Merged
Approved by: Andrew Johnson
Approved revision: d3e96c4c2b02606d952739db17e7e3d0811efc80
Merged at revision: 1755a46bfe877b986f4c1899af70c528d4a54d2d
Proposed branch: ~jeonghanlee/epics-base:darwin-aarch64
Merge into: ~epics-core/epics-base/+git/epics-base:7.0
Diff against target: 65 lines (+34/-2)
4 files modified
configure/os/CONFIG.Common.darwin-aarch64 (+14/-0)
configure/os/CONFIG.darwin-aarch64.Common (+8/-0)
configure/os/CONFIG_SITE.Common.darwin-aarch64 (+9/-0)
src/tools/EpicsHostArch.pl (+3/-2)
Reviewer Review Type Date Requested Status
Andrew Johnson Approve
Review via email: mp+397526@code.launchpad.net

Description of the change

Han's branch adds configuration files for a new target darwin-aarch64 to support Apple's new M1 CPUs.

To post a comment you must log in.
Revision history for this message
Andrew Johnson (anj) wrote :

There are a couple of typo's in here that I would clean up when merging; ppc is mentioned in a comment.

One thing I'd like to to discuss is whether we want to add another target for building universal binaries containing both x86 and arm code. The build system supported that for ppc+x86 (see configure/os/CONFIG_SITE.Common.darwin-ppcx86) so the same approach should still work for x86+arm, but we should probably use a more generic target name though, darwin-any, darwin-multi, darwin-all, ...?

Revision history for this message
Han (jeonghanlee) wrote :

There are two outputs of `uname -ar` on the Apple M1. I can compile the EPICS base according to my shell environment, for example, Iterm2 and a terminal within the VS Code. The first one is the output of Iterm2 and the second is the output of the VS Code terminal.

1) Darwin JeongLee-M70.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101 arm64

2) Darwin JeongLee-M70.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101 x86_64

Hope this help to your decision just in case.

Revision history for this message
Han (jeonghanlee) wrote :

> There are two outputs of `uname -ar` on the Apple M1. I can compile the EPICS
> base according to my shell environment, for example, Iterm2 and a terminal
> within the VS Code. The first one is the output of Iterm2 and the second is
> the output of the VS Code terminal.
>
> 1) Darwin JeongLee-M70.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21
> 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101 arm64
>
> 2) Darwin JeongLee-M70.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21
> 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101 x86_64
>
> Hope this help to your decision just in case.

Case 2) works with the current EPICS building system without any modification. And this branch is for Case 1).

Revision history for this message
Han (jeonghanlee) wrote :

> There are a couple of typo's in here that I would clean up when merging; ppc
> is mentioned in a comment.

I only found one typo, if you let me know others, I can update the repo again.

> One thing I'd like to to discuss is whether we want to add another target for
> building universal binaries containing both x86 and arm code. The build system
> supported that for ppc+x86 (see configure/os/CONFIG_SITE.Common.darwin-ppcx86)
> so the same approach should still work for x86+arm, but we should probably use
> a more generic target name though, darwin-any, darwin-multi, darwin-all, ...?

Revision history for this message
Andrew Johnson (anj) wrote :

Found it, the other typo was in your commit log-message (dawrin) which I don't expect you to fix.

This looks good enough for now, thanks Han! I will merge it before the next release.

I wonder when GitHub will make builders available for this architecture?

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/configure/os/CONFIG.Common.darwin-aarch64 b/configure/os/CONFIG.Common.darwin-aarch64
2new file mode 100644
3index 0000000..eaba1ef
4--- /dev/null
5+++ b/configure/os/CONFIG.Common.darwin-aarch64
6@@ -0,0 +1,14 @@
7+# CONFIG.Common.darwin-aarch64
8+#
9+# This file is maintained by the build community.
10+#
11+# Definitions for darwin-aarch64 target builds
12+# Sites may override these definitions in CONFIG_SITE.Common.darwin-aarch64
13+#-------------------------------------------------------
14+
15+#
16+# To build universal binaries, configure ARCH_CLASS
17+# in the file CONFIG_SITE.Common.darwin-aarch64
18+
19+# Include definitions common to all Darwin targets
20+include $(CONFIG)/os/CONFIG.darwinCommon.darwinCommon
21diff --git a/configure/os/CONFIG.darwin-aarch64.Common b/configure/os/CONFIG.darwin-aarch64.Common
22new file mode 100644
23index 0000000..0be8d68
24--- /dev/null
25+++ b/configure/os/CONFIG.darwin-aarch64.Common
26@@ -0,0 +1,8 @@
27+# CONFIG.darwin-aarch64.Common
28+#
29+# Definitions for darwin-aarch64 host builds
30+# Sites may override these definitions in CONFIG_SITE.darwin-aarch64.Common
31+#-------------------------------------------------------
32+
33+#Include definitions common to unix hosts
34+include $(CONFIG)/os/CONFIG.UnixCommon.Common
35diff --git a/configure/os/CONFIG_SITE.Common.darwin-aarch64 b/configure/os/CONFIG_SITE.Common.darwin-aarch64
36new file mode 100644
37index 0000000..8d79eb1
38--- /dev/null
39+++ b/configure/os/CONFIG_SITE.Common.darwin-aarch64
40@@ -0,0 +1,9 @@
41+# CONFIG_SITE.Common.darwin-aarch64
42+#
43+# Site override definitions for darwin-aarch64 target builds
44+#-------------------------------------------------------
45+
46+#
47+# arm64 devices: Apple Silicon M1
48+
49+ARCH_CLASS = arm64
50diff --git a/src/tools/EpicsHostArch.pl b/src/tools/EpicsHostArch.pl
51index d1508bf..52c4272 100644
52--- a/src/tools/EpicsHostArch.pl
53+++ b/src/tools/EpicsHostArch.pl
54@@ -46,8 +46,9 @@ sub HostArch {
55 my ($kernel, $hostname, $release, $version, $cpu) = uname;
56 if (m/^darwin/) {
57 for ($cpu) {
58- return 'darwin-x86' if m/^(i386|x86_64)/;
59- return 'darwin-ppc' if m/Power Macintosh/;
60+ return 'darwin-x86' if m/^(i386|x86_64)/;
61+ return 'darwin-ppc' if m/Power Macintosh/;
62+ return 'darwin-aarch64' if m/arm64/;
63 }
64 die "$0: macOS CPU type '$cpu' not recognized\n";
65 }

Subscribers

People subscribed via source and target branches