obrl-soil / h3jsr

Access Uber's h3-js library via R and V8 - https://uber.github.io/h3/#/documentation/overview/use-cases
https://obrl-soil.github.io/h3jsr/
Other
67 stars 5 forks source link

cant install obrl-soil/h3jsr #8

Closed twiebke closed 2 years ago

twiebke commented 3 years ago

I get "free(): invalid pointer Aborted (core dumped) ERROR: lazy loading failed for package ‘h3jsr’" remotes::install_github("obrl-soil/h3jsr") Downloading GitHub repo obrl-soil/h3jsr@HEAD heavy_check_mark checking for file ‘/tmp/RtmpfcxHni/remotes2c1f20bdc16c/obrl-soil-h3jsr-3d2b654/DESCRIPTION’ ... ─ preparing ‘h3jsr’: heavy_check_mark checking DESCRIPTION meta-information ... ─ checking for LF line-endings in source and make files and shell scripts ─ checking for empty or unneeded directories ─ building ‘h3jsr_1.2.0.tar.gz’

Installing package into ‘/home/R/x86_64-pc-linux-gnu-library/4.0’ (as ‘lib’ is unspecified)

installing source package ‘h3jsr’ ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
free(): invalid pointer
Aborted (core dumped)
ERROR: lazy loading failed for package ‘h3jsr’
removing ‘/home/R/x86_64-pc-linux-gnu-library/4.0/h3jsr’
Fehler: Failed to install 'h3jsr' from GitHub:
(konvertiert von Warnung) installation of package ‘/tmp/RtmpfcxHni/file2c1f47b0862a/h3jsr_1.2.0.tar.gz’ had non-zero exit status
obrl-soil commented 3 years ago

Ok. What's your OS + version, and which versions of PROJ, GDAL and V8 are installed?

twiebke commented 3 years ago

Hey, thanks for the mail and thanks for your work. Am Donnerstag, 4. März 2021, 22:35:16 CET schrieb obrl_soil:

Ok. What's your OS + version, and which versions of PROJ, GDAL and V8 are installed?

R version 4.0.4 (2021-02-15) x86_64-pc-linux-gnu (64-bit) packageVersion("PROJ") [1] ‘0.4.0’ packageVersion("V8") [1] ‘3.4.0’ aptitude show gdal-bin Paket: gdal-bin
Version: 3.2.1+dfsg-1~focal0 Zustand: Installiert Automatisch installiert: nein Priorität: optional Bereich: science Verwalter: Debian GIS Project pkg-grass-devel@lists.alioth.debian.org Architektur: amd64 Unkomprimierte Größe: 1.324 k Hängt ab von: python3-gdal (= 3.2.1+dfsg-1~focal0), python3-numpy (>= 1:1.16.0~rc1), python3-numpy-abi9, python3:any, libc6 (>= 2.14), libgcc-s1 (>= 3.0), libgdal28 (>= 3.1.0), libstdc++6 (>= 5.2) Schlägt vor: libgdal-grass Beschädigt: gdal-bin (< 1.10.0-0~), python-gdal (< 2.4.3~) Ersetzt: python-gdal (< 2.4.3~) Beschreibung: Geospatial Data Abstraction Library - Utility programs GDAL is a translator library for raster geospatial data formats. As a library, it presents a single abstract data model to the calling application for all supported formats. The related OGR library (which lives within the GDAL source tree) provides a similar capability for simple features vector data.

GDAL supports 40+ popular data formats, including commonly used ones (GeoTIFF, JPEG, PNG and more) as well as the ones used in GIS and remote sensing software packages (ERDAS Imagine, ESRI Arc/Info, ENVI, PCI Geomatics). Also supported many remote sensing and scientific data distribution formats such as HDF, EOS FAST, NOAA L1B, NetCDF, FITS.

OGR library supports popular vector formats like ESRI Shapefile, TIGER data, S57, MapInfo File, DGN, GML and more.

This package contains utility programs, based on GDAL/OGR library, namely gdal_translate, gdalinfo, gdaladdo, gdalwarp, ogr2ogr, ogrinfo, ogrtindex.

obrl-soil commented 3 years ago

Yeah you definitely to update V8 past 6.0.

That PROJ version makes no sense to me (it was v4 for like 20 years and then jumped through versions 5-8 in the last couple. I'd try updating it - sf, which h3jsr uses, needs proj 4.8.0 or greater. Using the ubuntugis ppa might help?

twiebke commented 3 years ago

Thanks for your Mail. Am Freitag, 5. März 2021, 06:09:16 CET schrieb obrl_soil:

Yeah you definitely to update V8 past 6.0.

That PROJ version makes no sense to me (it was v4 for like 20 years and then jumped through versions 5-8 in the last couple. I'd try updating it - sf, which h3jsr uses, needs proj 4.8.0 or greater. Using the ubuntugis ppa might help?

I removed c-cran-proj. There is c-cran-proj4 packageVersion("proj4") [1] ‘1.0.10.1’

I removed V8 and than

remotes::install_github("obrl-soil/h3jsr") Downloading GitHub repo obrl-soil/h3jsr@HEAD Installing 1 packages: V8 Installing package into ‘/home/R/x86_64-pc-linux-gnu-library/4.0’ (as ‘lib’ is unspecified) versuche URL 'https://cloud.r-project.org/src/contrib/V8_3.4.0.tar.gz' Content type 'application/x-gzip' length 682079 bytes (666 KB)

downloaded 666 KB

The downloaded source packages are in ‘/tmp/RtmpAu1RTQ/downloaded_packages’ ✔ checking for file ‘/tmp/RtmpAu1RTQ/remotes1b77634c5499/obrl-soil- h3jsr-3d2b654/DESCRIPTION’ ... ─ preparing ‘h3jsr’: ✔ checking DESCRIPTION meta-information ─ checking for LF line-endings in source and make files and shell scripts ─ checking for empty or unneeded directories ─ building ‘h3jsr_1.2.0.tar.gz’

Installing package into ‘/home/R/x86_64-pc-linux-gnu-library/4.0’ (as ‘lib’ is unspecified)

Another try?

obrl-soil commented 3 years ago

Ah no, I mean the libraries V8 and PROJ on your Linux system, not within R. They're two different things: the R packages mostly just wrap the underlying libraries and make them accessible within R.

twiebke commented 3 years ago

Hey, Am Freitag, 5. März 2021, 22:26:34 CET schrieb obrl_soil:

Ah no, I mean the libraries V8 and PROJ on your Linux system, not within R. They're two different things: the R packages mostly just wrap the underlying libraries and make them accessible within R. because of V8 in linux: sudo apt-get install -y libv8-dev inweis: »libnode-dev« wird an Stelle von »libv8-dev« gewählt. libnode-dev ist schon die neueste Version (10.19.0~dfsg-3ubuntu1).

and for proj: aptitude show proj-bin Paket: proj-bin
Version: 7.2.1-1~focal0 Zustand: Installiert Automatisch installiert: ja Priorität: optional Bereich: science Verwalter: Debian GIS Project pkg-grass-devel@lists.alioth.debian.org Architektur: amd64 Unkomprimierte Größe: 485 k Hängt ab von: libc6 (>= 2.29), libgcc-s1 (>= 3.0), libproj19 (>= 7.2.0), libstdc++6 (>= 5.2) Beschreibung: Cartographic projection library (tools) Proj and invproj perform respective forward and inverse transformation of cartographic data to or from Cartesian data with a wide range of selectable projection functions (over 100 projections).

Geod and invgeod perform geodesic (Great Circle) computations for determining latitude, longitude and back azimuth of a terminus point given a initial point latitude, longitude, azimuth and distance (direct) or the forward and back azimuths and distance between an initial and terminus point latitudes and longitudes (inverse).

This package provides the PROJ binary tools.

Geschwindigkeitsbegrenzung commented 2 years ago

I'm afraid that I'm experiencing a similar issue. Probably making a silly mistake somewhere.

Running Windows 10 Enterprise, R-3.6.2

install.packages('h3jsr') WARNING: Rtools is required to build R packages but no version of Rtools compatible with the currently running version of R was found. Note that the following incompatible version(s) of Rtools were found:

Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/ Installing package into ‘C:/Users/m-martin/Documents/R/win-library/3.6’ (as ‘lib’ is unspecified) also installing the dependency ‘V8’

There is a binary version available but the source version is later: binary source needs_compilation V8 3.4.2 4.1.0 TRUE

Binaries will be installed trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/V8_3.4.2.zip' Content type 'application/zip' length 9300569 bytes (8.9 MB) downloaded 8.9 MB

package ‘V8’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in C:\Users\m-martin\AppData\Local\Temp\RtmpK2O8IK\downloaded_packages installing the source package ‘h3jsr’

trying URL 'https://cran.rstudio.com/src/contrib/h3jsr_1.2.3.tar.gz' Content type 'application/x-gzip' length 648898 bytes (633 KB) downloaded 633 KB

The downloaded source packages are in ‘C:\Users\m-martin\AppData\Local\Temp\RtmpK2O8IK\downloaded_packages’

library(h3jsr) Error in library(h3jsr) : there is no package called ‘h3jsr’

obrl-soil commented 2 years ago

These problems all appear to be a matter of getting the right version of V8 (both the library itself and the R wrapper package of the same name) installed. They are not really a h3jsr issue and you may get better help at the V8 issues page. As such I'm going to offer what advice I can below and then close this issue.

@twiebke you should try to install the R package V8 with the static library environment variable set as recommended at https://github.com/jeroen/V8 :

Sys.setenv(DOWNLOAD_STATIC_LIBV8 = 1)
install.packages("V8")

In your case @Geschwindigkeitsbegrenzung, your first option is to upgrade your rtools installation to 3.5 and attempt to build V8 from source again. You can also try just letting your system install the older v 3.4.2 binary it found instead of building from source, as I'm reasonably sure it bundles a new enough version of V8 to keep h3jsr happy. If that doesn't work you may also need to upgrade R to 4+ to access newer versions of V8.