carlos-alberto-silva / rGEDI

rGEDI: An R Package for NASA's Global Ecosystem Dynamics Investigation (GEDI) Data Visualization and Processing.
164 stars 66 forks source link

Installation error: error: could not find szip #42

Closed emilyluisedoyle closed 1 year ago

emilyluisedoyle commented 2 years ago

Hi,

I have been running into a consistent error trying to download the rGEDI package using

devtools::install_git("https://github.com/carlos-alberto-silva/rGEDI", dependencies = TRUE)

A similar issue was raised last month (https://github.com/carlos-alberto-silva/rGEDI/issues/38) and I have followed the solutions but to no avail. The error message is as follows:

configure: error: could not find szip: Debian: sudo apt install libsz2 RPM-based: sudo dnf install szip MacOS: brew install szip ERROR: configuration failed for package ‘rGEDI’ removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/rGEDI’ Warning message: In i.p(...) : installation of package ‘/var/folders/yg/zvz4kc0x2mv6mm_vm5t_s7dr0000gp/T//Rtmpea8Weh/file23eb11acef3f/rGEDI_0.3.0.tar.gz’ had non-zero exit status

Also to note, szip is not available in the brew library so instead I tried:

brew install libzip

however this still does not work and the szip error remains. I used Macports to successfully install szip in the terminal but the error still remains.

I am using macOS Monterey 12.4 on an M1 (with arm64mac) and R version 4.2.1. Hopefully its an easy fix - look forward to hearing from you! Thank you

caiohamamura commented 2 years ago

Unfortunately I don't have a Mac machine to test, but the GitHub's Workflow using Mac is working fine. The system requirements are installed in a single line:

brew install libzip hdf5 gdal gsl automake
Xitermelon commented 2 years ago

Hello, I have exactly the same problem. I tried "brew install libzip hdf5 gdal gsl automake" but the error still remains.

caiohamamura commented 2 years ago

Sorry, but we do not have access to Mac machine, we are only using automated workflow to check MacOS installation, see https://github.com/carlos-alberto-silva/rGEDI/blob/master/.github/workflows/r.yml#L77, from line 77-80 the only custom command for compiling in MacOS is:

brew install libzip hdf5 gdal gsl automake
Xitermelon commented 2 years ago

Somehow it doesn't work for Mac, still "could not find szip", but the development version works on Windows now.

caiohamamura commented 1 year ago

As a workaround you could try to ignore the szip checking part. Open a terminal prompt and then:

  1. Clone the repository git clone https://github.com/carlos-alberto-silva/rGEDI
  2. Change to the rGEDI directory: cd rGEDI
  3. Initialize submodule git submodule init
  4. Update submodules git submodule update
  5. Edit the configure.ac file and remove lines 41-49 which are checking for szip.
  6. Install autoconf: brew install autoconf
  7. Run autoreconf: autoreconf
  8. Run R or RStudio in the rGEDI directory and then run: devtools::install()

If this works please let us know and we try some workaround for macOS szip checking.

You can try to run everything from this:

git clone https://github.com/carlos-alberto-silva/rGEDI
cd rGEDI
git submodule update --init
sed -i .bak -e '41,51d' configure.ac
sudo brew install autoconf
autoreconf
Rscript -e "devtools::install()"
ajs0428 commented 1 year ago

As a workaround you could try to ignore the szip checking part. Open a terminal prompt and then:

1. Clone the repository `git clone https://github.com/carlos-alberto-silva/rGEDI`

2. Change to the rGEDI directory: `cd rGEDI`

3. Initialize submodule `git submodule init`

4. Update submodules `git submodule update`

5. Edit the `configure.ac` file and remove lines 41-49 which are checking for szip.

6. Install autoconf: `brew install autoconf`

7. Run autoreconf: `autoreconf`

8. Run R or RStudio in the rGEDI directory and then run: `devtools::install()`

If this works please let us know and we try some workaround for macOS szip checking.

You can try to run everything from this:

git clone https://github.com/carlos-alberto-silva/rGEDI
cd rGEDI
git submodule update --init
sed -i .bak -e '41,51d' configure.ac
sudo brew install autoconf
autoreconf
Rscript -e "devtools::install()"

Apologies since this was marked closed but I just tried this on MacOS Ventura R version 4.3.0 and wasn't able to install still. Any additional help would be much appreciated

caiohamamura commented 1 year ago

And what was the error?

ajs0428 commented 1 year ago

I was able to replicate the error within just the terminal which is shown in the images below. But I just tried again this time using devtools::install and setting the path to the recently updated rGEDI package folder within RStudio and it worked. Not sure what the difference and any insight is appreciated

ErrorPart1 ErrorPart2 ErrorPart3 ErrorPart4

caiohamamura commented 1 year ago

Unfortunately this must be something to do with incompatible versions of libhdf5 installed in your system, as it is being reported with other different softwares such as https://github.com/ranganathanlab/bmDCA/issues/2. As I don't have a Mac machine for testing I cannot help you further. Maybe you could have better luck asking about it in some forum dedicated for superusers/MacOS experts, or the Apple support per se.

The github link I provided has some instructions you could try to see if they work.

The relevant error message is Library not loaded @rpath/libhdf5.200.dylib, as you can see this has nothing to do with rGEDI, as the package is only using libhdf5 as a dependency. It looks like the linker (which we do not have much control over) is trying to use a version that is different from the one found by /Users/Anthony/opt/miniconda3/bin/h5cc binary utility.

It looks like it is trying to use the libhdf5 from miniconda3 you installed previously. As a workaround you could try to use R from the miniconda's R package, or try to get rid of miniconda3 at all because it looks like it is conflicting with your R environment.

ajs0428 commented 1 year ago

Thanks! I'll look into some MacOS specific issues with the libhdf5. Also will probably just get rid of miniconda, odd that it's stuck using that version.