Skip to content

Commit fd27b0c

Browse files
authored
Adding MacOS M1 support. (#89)
1 parent d15bb37 commit fd27b0c

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,23 @@ on:
66
push:
77
branches: ['main']
88
tags: [v*]
9+
workflow_dispatch:
10+
911
# release:
1012
# types: [published]
1113

1214
jobs:
1315
build:
1416
strategy:
1517
matrix:
16-
os: [ubuntu-latest, macos-latest]
17-
java: [8]
18+
# Specifying `macos-14` is the way to get aarch64
19+
os: [ubuntu-latest, macos-12, macos-14]
20+
include:
21+
- os: macos-12
22+
arch: x86_64
23+
- os: macos-14
24+
arch: arm64
25+
java: [11]
1826
distribution: [temurin]
1927
pdal: [2.6.3]
2028
runs-on: ${{ matrix.os }}
@@ -32,6 +40,9 @@ jobs:
3240
distribution: ${{ matrix.distribution }}
3341
java-version: ${{ matrix.java }}
3442

43+
- run: brew install sbt
44+
if: ${{ matrix.os == 'macos-14' }}
45+
3546
- uses: conda-incubator/setup-miniconda@v3
3647
with:
3748
activate-environment: pdal-java
@@ -70,8 +81,8 @@ jobs:
7081
- uses: actions/upload-artifact@v4
7182
if: ${{ startsWith(matrix.os, 'macos') }}
7283
with:
73-
name: macos
74-
path: native/target/native/x86_64-darwin/bin
84+
name: ${{ matrix.os }}
85+
path: native/target/native/${{ matrix.arch }}-darwin/bin
7586

7687
publish:
7788
strategy:
@@ -131,8 +142,12 @@ jobs:
131142

132143
- uses: actions/download-artifact@v4
133144
with:
134-
name: macos
145+
name: macos-12
135146
path: native/target/native/x86_64-darwin/bin
147+
- uses: actions/download-artifact@v4
148+
with:
149+
name: macos-14
150+
path: native/target/native/arm64-darwin/bin
136151

137152
- name: Release
138153
run: sbt ci-release

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## Added
10+
- Added Apple Silicon (ARM 64) to native build [#89](https://github.com/PDAL/java/pull/89) (@metasim)
11+
912
## [2.6.2] - 2024-03-02
1013
## Changed
1114
- Remove pipeline.validate() method [#86](https://github.com/pdal/java/pull/86) (@pomadchin)

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ It is released independently from PDAL itself as of PDAL 1.7.
1919

2020
## Usage
2121
You can use `pdal-native` dep published into maven central in case you don't have installed JNI bindings and to avoid steps described below.
22-
Dependency contains bindings for `x86_64-darwin` and `x86_64-linux`, other versions are not supported yet.
22+
Dependency contains bindings for `x86_64-darwin`, `arm64-darwin`, and `x86_64-linux`, other versions are not supported yet.
2323

2424
### Versioning scheme
2525

@@ -240,9 +240,6 @@ sbt
240240
# Java side development without binaries build
241241
PDAL_DEPEND_ON_NATIVE=false sbt -Djava.library.path=<path>
242242
```
243-
#### Mac-OS ARM
244-
Natives for arm64 are still not pre-built. If you need to get them, follow the guide above for a self build and finally go to `../pdal-java/native/target/`, here you will find the built `pdal-native.jar`. If you want to use it in a Java project, for example, you can go to `./m2/repository/io/pdal/pdal-native/<your-version>/` and replace the one taken from Maven with the one you have just built.
245-
246243
## Possible issues and solutions
247244

248245
#### - In case of not installed as global PDAL change [this](./java/native/src/CMakeLists.txt#L25) line to:

0 commit comments

Comments
 (0)