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

PDAL 2.4.3 #62

Merged
merged 6 commits into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 29 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,43 @@ on:

jobs:
linux:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
image: ['daunnc/pdal-ubuntu:2.4.3']
runs-on: ${{ matrix.os }}
container:
image: daunnc/pdal-ubuntu:2.3.0
image: ${{ matrix.image }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: coursier/cache-action@v6
- uses: olafurpg/setup-scala@v13
with:
java-version: [email protected]

- name: Check formatting
run: sbt scalafmtCheckAll
run: ./sbt scalafmtCheckAll

- name: Build project
run: sbt +test
run: ./sbt +test

macos:
runs-on: macos-latest
strategy:
matrix:
os: [macos-latest]
java: [8]
distribution: [temurin]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: coursier/cache-action@v6
- uses: olafurpg/setup-scala@v13
- uses: actions/setup-java@v3
with:
java-version: [email protected]
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}

- name: Cache Homebrew
uses: actions/cache@v2
Expand All @@ -59,37 +66,38 @@ jobs:
- name: Build project
run: sbt +test

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: macos
path: native/target/native/x86_64-darwin/bin

publish:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
image: ['daunnc/pdal-ubuntu:2.4.3']
runs-on: ${{ matrix.os }}
needs: [linux, macos]
container:
image: daunnc/pdal-ubuntu:2.3.0
image: ${{ matrix.image }}
if: github.event_name != 'pull_request'
env:
PDAL_DEPEND_ON_NATIVE: "false"
CI_CLEAN: ""

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: coursier/cache-action@v6
- uses: olafurpg/setup-scala@v13
with:
java-version: [email protected]

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: macos
path: native/target/native/x86_64-darwin/bin

- name: Release
run: sbt ci-release
run: ./sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
Expand Down
12 changes: 8 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name := "pdal-jni"

val scalaVersions = Seq("3.0.1", "2.13.6", "2.12.14")
val scala212 = "2.12.17"
val scala213 = "2.13.10"
val scala3 = "3.2.1"
val scalaVersions = Seq(scala3, scala213, scala212)

lazy val commonSettings = Seq(
scalaVersion := scalaVersions.head,
Expand Down Expand Up @@ -47,7 +50,7 @@ lazy val `core-scala` = project
.settings(commonSettings: _*)
.settings(Dependencies.macroSettings)
.settings(Dependencies.licenseSettings)
.settings(scalaVersion := "2.13.6", crossScalaVersions := Seq("2.13.6", "2.12.14"))
.settings(scalaVersion := scala213, crossScalaVersions := Seq(scala213, scala212))
.settings(name := "pdal-scala")
.settings(javah / target := (native / nativeCompile / sourceDirectory).value / "include")
.settings(
Expand Down Expand Up @@ -78,8 +81,9 @@ lazy val native = project
.settings(nativeCompile / sourceDirectory := sourceDirectory.value)
.settings(
Compile / unmanagedPlatformDependentNativeDirectories := Seq(
"x86_64-linux" -> target.value / "native/x86_64-linux/bin/",
"x86_64-darwin" -> target.value / "native/x86_64-darwin/bin/"
"x86_64-linux" -> target.value / "native/x86_64-linux/bin/",
"x86_64-darwin" -> target.value / "native/x86_64-darwin/bin/",
"arm64-darwin" -> target.value / "native/arm64-darwin/bin/"
)
)
.settings(artifactName := { (sv: ScalaVersion, module: ModuleID, artifact: Artifact) =>
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/io/pdal/Pipeline.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ class Pipeline(val json: String) extends Native {
@native def getLog(): String
}

object Pipeline extends NativeLoader("pdaljni.2.3") {
object Pipeline extends NativeLoader("pdaljni.2.4") {
def apply(json: String): Pipeline = { val p = new Pipeline(json); p.initialize(); p }
}
4 changes: 2 additions & 2 deletions native/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set(MAKE_COLOR_MAKEFILE ON)

project (pdaljni)
set(PROJECT_VERSION_MAJOR 2)
set(PROJECT_VERSION_MINOR 3)
set(PROJECT_VERSION_MINOR 4)
set(PROJECT_VERSION_PATCH 0)

set(PDAL_LIB_NAME pdalcpp)
Expand All @@ -22,7 +22,7 @@ if (APPLE)
endif ()

if (NOT PDAL_BUILD)
set(CMAKE_CXX_FLAGS "-std=c++11")
set(CMAKE_CXX_FLAGS "-std=c++14")
endif()

# Setup JNI
Expand Down
6 changes: 3 additions & 3 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import de.heikoseeberger.sbtheader.{CommentCreator, CommentStyle, FileType}
import de.heikoseeberger.sbtheader.HeaderPlugin.autoImport.{headerLicense, headerMappings, HeaderLicense}

object Version {
val jts = "1.16.1"
val scalaTest = "3.2.9"
val circe = "0.14.1"
val jts = "1.19.0"
val scalaTest = "3.2.14"
val circe = "0.14.3"
}

object Dependencies {
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.5.5
sbt.version=1.8.0
24 changes: 9 additions & 15 deletions sbt
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@

set -o pipefail

declare -r sbt_release_version="1.5.5"
declare -r sbt_unreleased_version="1.5.5"
declare -r sbt_release_version="1.8.0"
declare -r sbt_unreleased_version="1.8.0"

declare -r latest_213="2.13.6"
declare -r latest_212="2.12.14"
declare -r latest_213="2.13.10"
declare -r latest_212="2.12.17"
declare -r latest_211="2.11.12"
declare -r latest_210="2.10.7"
declare -r latest_29="2.9.3"
Expand Down Expand Up @@ -216,7 +216,8 @@ getJavaVersion() {
# but on 9 and 10 it's 9.x.y and 10.x.y.
if [[ "$str" =~ ^1\.([0-9]+)(\..*)?$ ]]; then
echo "${BASH_REMATCH[1]}"
elif [[ "$str" =~ ^([0-9]+)(\..*)?$ ]]; then
# Fixes https://github.com/dwijnand/sbt-extras/issues/326
elif [[ "$str" =~ ^([0-9]+)(\..*)?(-ea)?$ ]]; then
echo "${BASH_REMATCH[1]}"
elif [[ -n "$str" ]]; then
echoerr "Can't parse java version from: $str"
Expand Down Expand Up @@ -252,7 +253,9 @@ is_apple_silicon() { [[ "$(uname -s)" == "Darwin" && "$(uname -m)" == "arm64" ]]
# MaxPermSize critical on pre-8 JVMs but incurs noisy warning on 8+
default_jvm_opts() {
local -r v="$(java_version)"
if [[ $v -ge 10 ]]; then
if [[ $v -ge 17 ]]; then
echo "$default_jvm_opts_common"
elif [[ $v -ge 10 ]]; then
if is_apple_silicon; then
# As of Dec 2020, JVM for Apple Silicon (M1) doesn't support JVMCI
echo "$default_jvm_opts_common"
Expand Down Expand Up @@ -385,12 +388,10 @@ usage() {
set_sbt_version
cat <<EOM
Usage: $script_name [options]

Note that options which are passed along to sbt begin with -- whereas
options to this runner use a single dash. Any sbt command can be scheduled
to run first by prefixing the command with --, so --warn, --error and so on
are not special.

-h | -help print this message
-v verbose operation (this runner is chattier)
-d, -w, -q aliases for --debug, --warn, --error (q means quiet)
Expand All @@ -408,15 +409,13 @@ are not special.
-batch Disable interactive mode
-prompt <expr> Set the sbt prompt; in expr, 's' is the State and 'e' is Extracted
-script <file> Run the specified file as a scala script

# sbt version (default: sbt.version from $buildProps if present, otherwise $sbt_release_version)
-sbt-version <version> use the specified version of sbt (default: $sbt_release_version)
-sbt-force-latest force the use of the latest release of sbt: $sbt_release_version
-sbt-dev use the latest pre-release version of sbt: $sbt_unreleased_version
-sbt-jar <path> use the specified jar as the sbt launcher
-sbt-launch-dir <path> directory to hold sbt launchers (default: $sbt_launch_dir)
-sbt-launch-repo <url> repo url for downloading sbt launcher jar (default: $(url_base "$sbt_version"))

# scala version (default: as chosen by sbt)
-28 use $latest_28
-29 use $latest_29
Expand All @@ -427,10 +426,8 @@ are not special.
-scala-home <path> use the scala build at the specified directory
-scala-version <version> use the specified version of scala
-binary-version <version> use the specified scala version when searching for dependencies

# java version (default: java from PATH, currently $(java -version 2>&1 | grep version))
-java-home <path> alternate JAVA_HOME

# passing options to the jvm - note it does NOT use JAVA_OPTS due to pollution
# The default set is used if JVM_OPTS is unset and no -jvm-opts file is found
<default> $(default_jvm_opts)
Expand All @@ -440,14 +437,12 @@ are not special.
-jvm-opts <path> file containing jvm args (if not given, .jvmopts in project root is used if present)
-Dkey=val pass -Dkey=val directly to the jvm
-J-X pass option -X directly to the jvm (-J is stripped)

# passing options to sbt, OR to this runner
SBT_OPTS environment variable holding either the sbt args directly, or
the reference to a file containing sbt args if given path is prepended by '@' (e.g. '@/etc/sbtopts')
Note: "@"-file is overridden by local '.sbtopts' or '-sbt-opts' argument.
-sbt-opts <path> file containing sbt args (if not given, .sbtopts in project root is used if present)
-S-X add -X to sbt's scalacOptions (-S is stripped)

# passing options exclusively to this runner
SBTX_OPTS environment variable holding either the sbt-extras args directly, or
the reference to a file containing sbt-extras args if given path is prepended by '@' (e.g. '@/etc/sbtxopts')
Expand Down Expand Up @@ -600,7 +595,6 @@ fi
$(pwd) doesn't appear to be an sbt project.
If you want to start sbt anyway, run:
$0 -sbt-create

EOM
exit 1
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/crosscompile-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ docker run -it --rm \
-v $HOME/.ivy2:/root/.ivy2 \
-v $HOME/.sbt:/root/.sbt \
-v $HOME/.coursier/cache:/root/.cache/coursier \
daunnc/pdal-ubuntu:2.3.0 bash -c "cd ./pdal-java; ./sbt native/compile"
daunnc/pdal-ubuntu:2.4.3 bash -c "cd ./pdal-java; ./sbt native/compile"
24 changes: 24 additions & 0 deletions scripts/docker/2.4.3/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM pdal/pdal:2.4.3
LABEL Grigory Pomadchin <[email protected]>

ENV DEBIAN_FRONTEND noninteractive

RUN set -ex && \
apt update -y && \
apt install --no-install-recommends -y openjdk-8-jdk

ENV JAVA_HOME /usr/lib/jvm/java-1.8.0-openjdk-amd6
RUN update-alternatives --set java `update-alternatives --list java | grep java-8`

RUN apt-get -y install bash gcc g++ cmake wget unzip gpg software-properties-common

RUN ln -s /opt/conda/envs/pdal/include/pdal /usr/include/pdal && \
ln -s /usr/include /usr/lib/include && \
ln -s /opt/conda/envs/pdal/lib /usr/lib/lib && \
ln -s /opt/conda/envs/pdal/share/* /usr/share/* || true && \
ln -s /opt/conda/envs/pdal/lib/* /usr/lib/* || true

# upd g++
RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test
# strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX
RUN apt update -y && apt install -y g++-11