Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI MacOS Arm64 support #356

Merged
merged 4 commits into from
Aug 29, 2024
Merged

Conversation

toor1245
Copy link
Contributor

@toor1245 toor1245 commented Aug 25, 2024

@toor1245 toor1245 force-pushed the arm64-macos-github branch 2 times, most recently from a9834ac to 2f11344 Compare August 26, 2024 00:29
- name: Check cmake
run: cmake --version
- name: Configure
run: cmake -S. -Bbuild -G "Xcode" -DCMAKE_CONFIGURATION_TYPES=Release -DCMAKE_INSTALL_PREFIX:PATH=destination
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added -DCMAKE_INSTALL_PREFIX:PATH=destination to fix the following error for the latest macos version:

make[1]: Nothing to be done for `preinstall'.
Install the project...
/opt/homebrew/Cellar/cmake/3.30.2/bin/cmake -P cmake_install.cmake
CMake Error at cmake_install.cmake:41 (file):
-- Install configuration: "Release"
  file cannot create directory: /usr/local/lib.  Maybe need administrative
  privileges.

ref: https://github.com/toor1245/cpu_features/actions/runs/10551135880/job/29228120369#step:7:167

@toor1245
Copy link
Contributor Author

@gchatelet, @Mizux, this PR is ready to review please take a look.

@@ -0,0 +1,35 @@
name: AArch64 MacOS Bazel
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add this line on top ?

# ref: https://github.com/actions/runner-images

e.g. https://github.com/google/or-tools/blob/main/.github/workflows/amd64_linux_cmake_cpp.yml#L1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -0,0 +1,43 @@
name: AArch64 MacOS CMake
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

# ref: https://github.com/actions/runner-images

@Mizux Mizux self-assigned this Aug 27, 2024
@Mizux Mizux added enhancement New feature or request cmake CMake related issue Apple M1 Apple M1 related issues labels Aug 27, 2024
@Mizux
Copy link
Collaborator

Mizux commented Aug 27, 2024

Requested change: aarch64 -> arm64

Context
for ARCH naming I usually use what Docker use:
see: https://github.com/docker-library/official-images
Which is based on the "indexes" in the OCI image specification
Which is based on Golang GOARCH naming: https://go.dev/doc/install/source#environment
i.e. arm64

For OS we prefer to use macos (as now) following the github runner convention
ref: https://github.com/actions/runner-images
note: github also tend to use arm for M1 based runners...

So could you rename file as arm64_macos_[bazel/cmake].yml and use Arm64 MacOS ... in name: (first line) ?

@toor1245
Copy link
Contributor Author

toor1245 commented Aug 27, 2024

Requested change: aarch64 -> arm64

Context for ARCH naming I usually use what Docker use: see: https://github.com/docker-library/official-images Which is based on the "indexes" in the OCI image specification Which is based on Golang GOARCH naming: https://go.dev/doc/install/source#environment i.e. arm64

For OS we prefer to use macos (as now) following the github runner convention ref: https://github.com/actions/runner-images note: github also tend to use arm for M1 based runners...

So could you rename file as arm64_macos_[bazel/cmake].yml and use Arm64 MacOS ... in name: (first line) ?

Updated, should we rename aarch64_linux_[bazel/cmake].yml to arm64_linux_[bazel/cmake].yml for consistency?

jobs:
# Building using the github runner environement directly.
bazel:
runs-on: macos-latest
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add # Using M1 processors, ref: https://github.com/actions/runner-images

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

jobs:
# Building using the github runner environement directly.
xcode:
runs-on: macos-latest
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@Mizux
Copy link
Collaborator

Mizux commented Aug 28, 2024

Updated, should we rename aarch64_linux_[bazel/cmake].yml to arm64_linux_[bazel/cmake].yml for consistency?

TLDR: Not yet.

Context:
Currently our top README.md table mix native runner build (windows-latest, macos-13, ubuntu-latest...) and cross compilation using a CMake toolchain (aarch64, mips, powerpc) (+ QEMU for testing when possible).

I think we should split our CI matrix result in two tables:

  • native runner build and
  • cross-compilation build
    note: currently most of our cells doesn't make any sense e.g Riscv-Windows, mips-macos etc...

Also to ease the work of @gchatelet to adapt his script to generate the badges, we are thinking to add a prefix cross_ or xxx_toolchain (idea welcome) to be able to automatically split .yml files in two categories then generate both tables (native build and cross compile ones) automatically with few lines change in the script....
ref: https://github.com/google/cpu_features/blob/main/scripts/generate_badges.d

@gchatelet gchatelet merged commit c5fc491 into google:main Aug 29, 2024
31 checks passed
@toor1245 toor1245 deleted the arm64-macos-github branch August 29, 2024 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Apple M1 Apple M1 related issues cmake CMake related issue enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants