carlos-alberto-silva / rGEDI

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

Problem installing rGEDI using devtools::install_git(...) #45

Closed mickeycampbell closed 1 year ago

mickeycampbell commented 1 year ago

Hello,

I am trying to install rGEDI on my Windows machine with R version 4.2.0 using the following command:

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

When I do so, I receive the following error:

** libs gcc -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG -I./tools -I./cmpfit-1.2 -I./libclidar -I. -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include" -DDLLEXPORT -D_USE_MATH_DEFINES -D_WIN32 -DWIN32 -DH5_BUILT_AS_DYNAMIC_LIB -DDLL_EXPORTS -DUSEPHOTON -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c gediMetrics.c -o gediMetrics.o In file included from gedisimulator/gediIO.h:38, from gediMetrics.c:4: ./libclidar/libLidarHDF.h:35:10: fatal error: hdf5.h: No such file or directory 35 | #include | ^~~~ compilation terminated. make: *** [C:/PROGRA~1/R/R-42~1.0/etc/x64/Makeconf:252: gediMetrics.o] Error 1 ERROR: compilation failed for package 'rGEDI'

It's not entirely clear to me what this error means or how I might go about resolving it. Any help is appreciated!

Thank you Mickey

Rapsodia86 commented 1 year ago

Did you try to install CRAN version: install.packages("rGEDI")?

mickeycampbell commented 1 year ago

I did, and it said that rGEDI was not available for this version of R (4.2.0). For what it's worth, I also tried on another machine with v4.0.5 to no avail.

Rapsodia86 commented 1 year ago

Now, I am getting a different error:

C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: cannot find -lsz
collect2.exe: error: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'rGEDI'
* removing 'C:/Users/monikat/AppData/Local/R/win-library/4.2/rGEDI'

My R is R 4.2.2

caiohamamura commented 1 year ago

Do you have rtools42 installed at C:\rtools42?

Rapsodia86 commented 1 year ago

Do you have rtools42 installed at C:\rtools42?

Me? Yes. But first here was @mickeycampbell ;) Should I open a new issue with my error? Because it is different. His error is about hdf5, my error is about -lsz

caiohamamura commented 1 year ago

Yes, it would be better for organization and for other people trying to solve their issues too.

Rapsodia86 commented 1 year ago

After your question, I just uninstalled Rtools42 (Had it previously installed 09/2022) and installed again. Now installation from github works! But just in case I will open an issue with "-lsz" and suggest reinstalling Rtools42.

mickeycampbell commented 1 year ago

A-ha! I did the same (installed Rtools42), and I was able to successfully install rGEDI from github. Problem solved. Thanks!