opengeos / whiteboxR

WhiteboxTools R Frontend
https://whiteboxR.gishub.org
Other
168 stars 30 forks source link

wbt_install/wbt_options: Add "linux_musl" download option #101

Closed brownag closed 1 year ago

brownag commented 1 year ago

For resolving issues where compatibility problems exist with versions of GLIBC earlier than that included with Ubuntu 22.x,

RE: https://github.com/giswqs/whitebox-python/issues/56, https://github.com/giswqs/whitebox-python/pull/57

brownag commented 1 year ago

So, exposing alternate download locations not only applies to open core but also to extensions. Also, not only "linux_musl" but macOS M1/ARM platform.

For ARM macOS: I noticed that the binary for the open core uses suffix "darwin_m_series" whereas general toolset extension use "MacOS_ARM", so at this point I will hold off on hard-coding rules about special suffixes and the user will have to sort this out.

It would be nice if a consistent scheme could be used across the core and extension downloads so that the filenames can be predictable. Probably we can detect if the user is using ARM infrastructure on Mac and not require them to specify platform?

giswqs commented 1 year ago

Good catch. I forgot to deal with the mac version issue in whitebox-python. We can detect the processor type and download the corresponding binary accordingly.

import platform
print(platform.system())  # return 'Darwin' for Mac
print(platform.processor()) # return 'arm' for M1/M2 chips, and 'i386' for Intel chips

The WBT install_wbt_extension does not seem to handle M1 and MUSL issues. https://github.com/jblindsay/whitebox-tools/blob/master/whitebox_tools.py#L550

brownag commented 1 year ago

Excellent, Sys.info()["machine"] == "arm64" should work for R, and I've update the R functions that handle install of extensions. The existing (pre-2.3.0) R extension function wbt_install_extension() now should work for Apple M series.

I need to investigate the (new in 2.3.0) wbt_install_wb_extension() function/plugin, I am not sure it is functional... at least not the way it is being called from R on my machine right now.