rspatial / terra

R package for spatial data handling https://rspatial.github.io/terra/reference/terra-package.html
GNU General Public License v3.0
533 stars 86 forks source link

Issue in installation with "__Z6Rlog1pd" #1375

Closed jemorlanes closed 4 months ago

jemorlanes commented 9 months ago

Hey guys!

I am currently having an issue with the installation of your package. I have an M1 Mac, and the issue might come from some of the dependencies (like Rcpp), but I am not sure. Just in case I tried reinstalling those but nothing has changed. I am going to put here part of the output of my installation attempts:

`> remotes::install_github("rspatial/terra", configure.args = "--with-proj-lib=$(brew --prefix)/lib/") Downloading GitHub repo rspatial/terra@HEAD ── R CMD build ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ✔ checking for file ‘/private/var/folders/z8/nrcst881607gn95xh3_4qvb00000gp/T/RtmpZqAcQV/remotes7ec3b0f943f/rspatial-terra-e536db7/DESCRIPTION’ (392ms) ─ preparing ‘terra’: ✔ checking DESCRIPTION meta-information ... ─ cleaning src ─ running ‘cleanup’ ─ checking for LF line-endings in source and make files and shell scripts (435ms) ─ checking for empty or unneeded directories ─ building ‘terra_1.7-65.tar.gz’

Thank you for your time!! :))

rhijmans commented 9 months ago

I think the compiler cannot find the log1p function. That function is defined in <cmath> and I have now added that header to arith.cpp, where log1p is referenced. Maybe that fixes the problem you are having.

jemorlanes commented 9 months ago

Thanks for the swift reply! :)

I have tried reinstalling again with remotes::install_github("rspatial/terra", configure.args = "--with-proj-lib=$(brew --prefix)/lib/") and I still get an error:

`Creating a generic function for ‘ncol’ from package ‘base’ in package ‘terra’ in method for ‘distance’ with signature ‘x="SpatRaster",y="sf"’: no definition for class “sf” in method for ‘ext’ with signature ‘x="sf"’: no definition for class “sf” in method for ‘ext’ with signature ‘x="bbox"’: no definition for class “bbox” in method for ‘ext’ with signature ‘x="Extent"’: no definition for class “Extent” in method for ‘ext’ with signature ‘x="Raster"’: no definition for class “Raster” in method for ‘ext’ with signature ‘x="Spatial"’: no definition for class “Spatial” in method for ‘extract’ with signature ‘x="SpatRaster",y="sf"’: no definition for class “sf” in method for ‘mask’ with signature ‘x="SpatRaster",mask="sf"’: no definition for class “sf” in method for ‘points’ with signature ‘x="sf"’: no definition for class “sf” in method for ‘lines’ with signature ‘x="sf"’: no definition for class “sf” in method for ‘polys’ with signature ‘x="sf"’: no definition for class “sf” in method for ‘lines’ with signature ‘x="leaflet"’: no definition for class “leaflet” in method for ‘points’ with signature ‘x="leaflet"’: no definition for class “leaflet” in method for ‘rast’ with signature ‘x="stars"’: no definition for class “stars” in method for ‘rast’ with signature ‘x="stars_proxy"’: no definition for class “stars_proxy” in method for ‘rasterize’ with signature ‘x="sf",y="SpatRaster"’: no definition for class “sf” in method for ‘show’ with signature ‘"Rcpp_SpatDataFrame"’: no definition for class “Rcpp_SpatDataFrame” in method for ‘show’ with signature ‘"Rcpp_SpatCategories"’: no definition for class “Rcpp_SpatCategories” in method for ‘geomtype’ with signature ‘x="Spatial"’: no definition for class “Spatial” in method for ‘vect’ with signature ‘x="Spatial"’: no definition for class “Spatial” in method for ‘vect’ with signature ‘x="sf"’: no definition for class “sf” in method for ‘vect’ with signature ‘x="sfc"’: no definition for class “sfc” in method for ‘vect’ with signature ‘x="XY"’: no definition for class “XY” Creating a generic function for ‘unserialize’ from package ‘base’ in package ‘terra’ Creating a generic function for ‘readRDS’ from package ‘base’ in package ‘terra’ help ** installing help indices copying figures building package indices testing if installed package can be loaded from temporary location Error: package or namespace load failed for ‘terra’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/Users/javierescudero/miniconda3/envs/R423/lib/R/library/00LOCK-terra/00new/terra/libs/terra.dylib': dlopen(/Users/javierescudero/miniconda3/envs/R423/lib/R/library/00LOCK-terra/00new/terra/libs/terra.dylib, 0x0006): symbol not found in flat namespace '__Z6Rlog1pd' Error: loading failed Execution halted ERROR: loading failed

ccnawrocki commented 4 months ago

Was this ever solved? I have the same problem when installing an old version of Seurat in a conda environment. People over in a thread in the seurat repo were mentioning that the issue might stem from Rcpp. I was curious if this error was figured out eventually?

wajra commented 4 months ago

I would also like to know whether this issue was resolved. Here's the output when I try to install terra using remotes System information

`> remotes::install_github("rspatial/terra", configure.args = "--with-proj-lib=$(brew --prefix)/lib/") Using GitHub PAT from the git credential store. Downloading GitHub repo rspatial/terra@HEAD ── R CMD build ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ✔ checking for file ‘/private/var/folders/bk/gbxh7f8j26s5zx0j36wx67y80000gn/T/RtmpBTFuGB/remotes1740917f2d6bd/rspatial-terra-f332a70/DESCRIPTION’ (377ms) ─ preparing ‘terra’: ✔ checking DESCRIPTION meta-information ... ─ cleaning src ─ running ‘cleanup’ ─ checking for LF line-endings in source and make files and shell scripts (403ms) ─ checking for empty or unneeded directories ─ building ‘terra_1.7-76.tar.gz’

Installing package into ‘/Users/jeewanthabandara/Library/R/arm64/4.1/library’ (as ‘lib’ is unspecified)

Thank you very much!

rhijmans commented 4 months ago

The first thing to do is to see if you can install "sf" (to see whether this is specific to something in "terra", or more general). But whichever the case may be, these issues all appear to be related to, and specific to, installing "terra" in a conda environment. I have no experience with that, and it seems that nobody out here can provide help. So the best I can do is suggest asking the conda people for help.