r-lidar-lab / lidRviewer

An OpenGL point cloud viewer for R able to handle several millions of points
75 stars 16 forks source link

Added configure scripts for compilation in Unix #22

Closed caiohamamura closed 4 months ago

caiohamamura commented 4 months ago

Hi @Jean-Romain, as I mentioned before, I added the configure scripts for compiling in unix systems, so that it will test if the required libraries are available and it will cast appropriate messages and instructions for the user to install them.

I also added the rhub::rhub_setup() github actions, but I had to tweak them to install some packages that wouldn't install automatically based on the SystemRequirements field from DESCRIPTION. MacOS doesn't support it at all, so I added the action https://github.com/caiohamamura/lidRviewer/blob/712aeb584a490eea9da8d87710426bfe3abff2a7/.github/workflows/rhub.yaml#L88:

if (Sys.info()[["sysname"]] == "Linux") {
  system("sudo apt install -y libsdl2-dev")
} else if (Sys.info()[["sysname"]] == "Darwin") {
  system("brew install sdl2 mesa mesa-glu")
}

Which for linux it will install libsdl2-dev, but for macos it will install sdl2, mesa and mesa-glu.

Hope that works on most OS configurations other than github actions.

caiohamamura commented 4 months ago

It is working fine in github actions launched by rhub package:

rhub::rhub_check(platforms = c('macos', 'linux', 'windows'))

As you can see in my fork, it is passing the three OS it tests on: R-hub

Jean-Romain commented 4 months ago

Incredible you are awesome! I'll check that tomorrow. Thank you for resurrecting the project.

FYI I'm working on a redesign of the package. Now it can compile on all major platform seamlessly I started back an abandoned project. I added some frustum culling, spatial indexing, distance decimation in order to design a smooth viewer that density the rendering on zoom in and that display only the visible points.