Skip to content

Commit

Permalink
Adding MacOS M1 support. (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
metasim authored Mar 14, 2024
1 parent d15bb37 commit fd27b0c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,23 @@ on:
push:
branches: ['main']
tags: [v*]
workflow_dispatch:

# release:
# types: [published]

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
java: [8]
# Specifying `macos-14` is the way to get aarch64
os: [ubuntu-latest, macos-12, macos-14]
include:
- os: macos-12
arch: x86_64
- os: macos-14
arch: arm64
java: [11]
distribution: [temurin]
pdal: [2.6.3]
runs-on: ${{ matrix.os }}
Expand All @@ -32,6 +40,9 @@ jobs:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}

- run: brew install sbt
if: ${{ matrix.os == 'macos-14' }}

- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: pdal-java
Expand Down Expand Up @@ -70,8 +81,8 @@ jobs:
- uses: actions/upload-artifact@v4
if: ${{ startsWith(matrix.os, 'macos') }}
with:
name: macos
path: native/target/native/x86_64-darwin/bin
name: ${{ matrix.os }}
path: native/target/native/${{ matrix.arch }}-darwin/bin

publish:
strategy:
Expand Down Expand Up @@ -131,8 +142,12 @@ jobs:

- uses: actions/download-artifact@v4
with:
name: macos
name: macos-12
path: native/target/native/x86_64-darwin/bin
- uses: actions/download-artifact@v4
with:
name: macos-14
path: native/target/native/arm64-darwin/bin

- name: Release
run: sbt ci-release
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## Added
- Added Apple Silicon (ARM 64) to native build [#89](https://github.com/PDAL/java/pull/89) (@metasim)

## [2.6.2] - 2024-03-02
## Changed
- Remove pipeline.validate() method [#86](https://github.com/pdal/java/pull/86) (@pomadchin)
Expand Down
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ It is released independently from PDAL itself as of PDAL 1.7.

## Usage
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.
Dependency contains bindings for `x86_64-darwin` and `x86_64-linux`, other versions are not supported yet.
Dependency contains bindings for `x86_64-darwin`, `arm64-darwin`, and `x86_64-linux`, other versions are not supported yet.

### Versioning scheme

Expand Down Expand Up @@ -240,9 +240,6 @@ sbt
# Java side development without binaries build
PDAL_DEPEND_ON_NATIVE=false sbt -Djava.library.path=<path>
```
#### Mac-OS ARM
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.

## Possible issues and solutions

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

0 comments on commit fd27b0c

Please sign in to comment.