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

Installation of lasR R package #1136

Open
samuelgrubinger opened this issue Nov 5, 2024 · 7 comments
Open

Installation of lasR R package #1136

samuelgrubinger opened this issue Nov 5, 2024 · 7 comments
Assignees

Comments

@samuelgrubinger
Copy link

This package, https://github.com/r-lidar/lasR, is a new open-source development from the author of lidR that is programmed for efficient pipeline processing of point clouds. It will likely be essential for GEO-TREES data processing. Currently, it is not on conda-forge and cannot be installed in R on MAAP. Any solutions?

@wildintellect
Copy link
Collaborator

The easiest path might be to build a conda-forge feedstock, at a minimum we can learn a lot from the lidR feedstock https://github.com/conda-forge/r-lidr-feedstock/blob/main/recipe/meta.yaml

@wildintellect
Copy link
Collaborator

I just tested on https://hub.openveda.cloud which uses Rocker images (includes GDAL), and this build fine with

install.packages('lasR', repos = 'https://r-lidar.r-universe.dev')

Which is not surprising since the core is Ubuntu, build tools are included, and conda is note involved. Just noting here as a temporary option, if it's needed soon.

Also noted on Slack that PDAL pipelines might be capable of similar workflows. One concern with lidR and lasR is the custom read/write modules and the lack of full COPC support. Not blockers just things to be aware of.

@samuelgrubinger
Copy link
Author

samuelgrubinger commented Nov 6, 2024 via email

@wildintellect
Copy link
Collaborator

wildintellect commented Nov 7, 2024

Following next line of thought:
I hacked grayskull and generated a meta.yaml for building a conda package (still testing if it works)
r-lasr/meta.yaml

{% set name = "lasr" %}
{% set version = "0.10.3" %}
{% set posix = "m2-" if win else "" %}
{% set native = "m2w64-" if win else "" %}

package:
  name: r-{{ name }}
  version: '{{ version }}'

source:
  url: https://r-lidar.r-universe.dev/src/contrib/lasR_{{ version }}.tar.gz
  sha256: 147f2c50e30c2d5d9f7386be4fb12c12c9cf401bcb288f1e541faf9701db4499

build:
  number: 0
  merge_build_host: true
  script: R CMD INSTALL --build .
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - cross-r-base {{ r_base }}  # [build_platform != target_platform]
    - autoconf  # [unix]
    - "{{ compiler('c') }}"  # [unix]
    - "{{ compiler('m2w64_c') }}"  # [win]
    - "{{ compiler('cxx') }}"  # [unix]
    - "{{ compiler('m2w64_cxx') }}"  # [win]
    - posix  # [win]
  host:
    - r-base
    # - r-methods
    # - r-stats
    - r-r.utils
  run:
    - r-base
    # - r-methods
    # - r-stats
    - r-r.utils

test:
  commands:
    - $R -e "library('lasR')"  # [not win]
    - "\"%R%\" -e \"library('lasR')\""  # [win]

about:
  home: https://github.com/r-lidar/lasR
  summary: Fast and pipeable airborne lidar processing tools. Read/write 'las' and 'laz' files, computation of metrics in area based approach, point filtering, normalization, individual tree segmentation and other manipulations in a powerful and versatile processing chain.
  license: NGPL

extra:
  recipe-maintainers:
    - AddYourGitHubIdHere

conda build needed version, hard coded for now

conda install -c conda-forge conda-libmamba-solver
conda build -c conda-forge r-lasr

Had to comment out r-methods and r-stats, core packages? then rename r-r.utils
stuck now on

ValueError: Incompatible component merge:
  - 'h193b22a_2'
  - 'h4bf12b8_2'

@samuelgrubinger
Copy link
Author

Hi Alex. Any update on this as a solution?

@wildintellect
Copy link
Collaborator

I got the build to work with this meta.yaml https://gist.github.com/wildintellect/874cd8e8b4054430948e01d938e22819
But a little stumped on the install conda install -c local r-lasr fails to find the build files in /opt/conda/envs/r/conda-bld/

@wildintellect
Copy link
Collaborator

Resource usage statistics from building r-lasr:
   Process count: 10
   CPU time: Sys=0:00:08.5, User=0:01:37.6
   Memory: 630.2M
   Disk usage: 84.4K
   Time elapsed: 0:03:09.0


STOPPING BUILD BEFORE POST: r-lasr-0.10.3-r42_0
Renaming work directory '/opt/conda/envs/r/conda-bld/r-lasr_1731101455092/work' to '/opt/conda/envs/r/conda-bld/r-lasr_1731101455092/work_moved_r-lasr-0.10.3-r42h3fd9d12_0_linux-64_main_build_loop'
shutil.move(work)=/opt/conda/envs/r/conda-bld/r-lasr_1731101455092/work, dest=/opt/conda/envs/r/conda-bld/r-lasr_1731101455092/work_moved_r-lasr-0.10.3-r42h3fd9d12_0_linux-64_main_build_loop)

INFO :: The inputs making up the hashes for the built packages are as follows:
{}


####################################################################################
Resource usage summary:

Total time: 0:14:02.4
CPU usage: sys=0:00:08.5, user=0:01:37.6
Maximum memory usage observed: 630.2M
Total disk usage observed (not including envs): 84.4K

I'm just puzzled as conda install --use-local r-lasr can't seem to find the locally built package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants