Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue installing BPCell on Windows RStudio #41

Closed
sentisci opened this issue Aug 11, 2023 · 2 comments
Closed

Issue installing BPCell on Windows RStudio #41

sentisci opened this issue Aug 11, 2023 · 2 comments

Comments

@sentisci
Copy link

When I am trying to install BPCell, It throws following error

_-- R CMD build --------------------------------------------------------------------------------------------------------------------------------
v checking for file 'C:\Users\sindiris\Documents\R\R-4.1.3\library\BPCells/DESCRIPTION' (359ms)

  • preparing 'BPCells': (669ms)
    v checking DESCRIPTION meta-information ...
  • cleaning src
  • checking for LF line-endings in source and make files and shell scripts (369ms)
  • checking for empty or unneeded directories
  • building 'BPCells_0.1.0.tar.gz'
    Warning: file 'BPCells/cleanup' did not have execute permissions: corrected
    Warning: file 'BPCells/configure' did not have execute permissions: corrected

Running "C:/Users/sindiris/Documents/R/R-4.1.3/bin/x64/Rcmd.exe" INSTALL
"C:\Users\sindiris\AppData\Local\Temp\1\Rtmp61cBHj/BPCells_0.1.0.tar.gz" --install-tests

  • installing to library 'C:/Users/sindiris/Documents/R/R-4.1.3/library'
  • installing source package 'BPCells' ...
    ** using staged installation
    Testing hdf5 by compiling example program...
    tools/h5write.c:19:10: fatal error: hdf5.h: No such file or directory
    #include "hdf5.h"
    ^~~~~~~~
    compilation terminated.

Retrying without -lsz flag...
tools/h5write.c:19:10: fatal error: hdf5.h: No such file or directory
#include "hdf5.h"
^~~~~~~~
compilation terminated.

Unable to locate libhdf5. Please install manually or edit compiler flags.
ERROR: configuration failed for package 'BPCells'

  • removing 'C:/Users/sindiris/Documents/R/R-4.1.3/library/BPCells'
  • restoring previous 'C:/Users/sindiris/Documents/R/R-4.1.3/library/BPCells'
    Error in (function (command = NULL, args = character(), error_on_status = TRUE, ...:
    ! System command 'Rcmd.exe' failed

Exit status: 1
stdout & stderr:

Type .Last.error to see the more details._


Then I changed hfwrite.c file by including the complete path of the HDF5 library like below
#include "C:/Program Files/HDF_Group/HDF5/1.14.1/include/hdf5.h"
Then I am getting the following issue

-- R CMD build --------------------------------------------------------------------------------------------------------------------------------
v checking for file 'C:\Users\sindiris\Documents\R\R-4.1.3\library\BPCells/DESCRIPTION' (345ms)

  • preparing 'BPCells': (658ms)
    v checking DESCRIPTION meta-information ...
  • cleaning src
  • checking for LF line-endings in source and make files and shell scripts (380ms)
  • checking for empty or unneeded directories
  • building 'BPCells_0.1.0.tar.gz'
    Warning: file 'BPCells/cleanup' did not have execute permissions: corrected
    Warning: file 'BPCells/configure' did not have execute permissions: corrected

Running "C:/Users/sindiris/Documents/R/R-4.1.3/bin/x64/Rcmd.exe" INSTALL
"C:\Users\sindiris\AppData\Local\Temp\1\Rtmp61cBHj/BPCells_0.1.0.tar.gz" --install-tests

  • installing to library 'C:/Users/sindiris/Documents/R/R-4.1.3/library'
  • installing source package 'BPCells' ...
    ** using staged installation
    Testing hdf5 by compiling example program...
    C:/rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lhdf5
    C:/rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lsz
    collect2.exe: error: ld returned 1 exit status

Retrying without -lsz flag...
C:/rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lhdf5
collect2.exe: error: ld returned 1 exit status

Unable to locate libhdf5. Please install manually or edit compiler flags.
ERROR: configuration failed for package 'BPCells'

  • removing 'C:/Users/sindiris/Documents/R/R-4.1.3/library/BPCells'
  • restoring previous 'C:/Users/sindiris/Documents/R/R-4.1.3/library/BPCells'
    Error in (function (command = NULL, args = character(), error_on_status = TRUE, ...:
    ! System command 'Rcmd.exe' failed

Exit status: 1
stdout & stderr:


It looks like BPCell is not able to locate "C:\Program Files\HDF_Group\HDF5\1.14.1\lib" path . Can you please help me resolve this ? Where can I declare (by using a global variable or sthng) the above path so that its visible to BPCell. ?

Following is my session info

sessionInfo() R version 4.1.3 (2022-03-10) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19044) Matrix products: default locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] Rcpp_1.0.11 pillar_1.9.0 compiler_4.1.3 later_1.3.1 urlchecker_1.0.1 prettyunits_1.1.1 profvis_0.3.7 [8] remotes_2.4.2.1 tools_4.1.3 digest_0.6.33 pkgbuild_1.4.2 pkgload_1.3.2.1 memoise_2.0.1 lifecycle_1.0.3 [15] tibble_3.2.1 pkgconfig_2.0.3 rlang_1.1.1 shiny_1.7.4.1 cli_3.6.1 rstudioapi_0.15.0 fastmap_1.1.1 [22] stringr_1.5.0 desc_1.4.2 fs_1.6.3 htmlwidgets_1.6.2 vctrs_0.6.3 devtools_2.4.5 rprojroot_2.0.3 [29] glue_1.6.2 R6_2.5.1 processx_3.8.1 fansi_1.0.4 sessioninfo_1.2.2 callr_3.7.3 purrr_1.0.2 [36] magrittr_2.0.3 ps_1.7.5 promises_1.2.1 ellipsis_0.3.2 htmltools_0.5.5 usethis_2.2.2 mime_0.12 [43] xtable_1.8-4 httpuv_1.6.11 utf8_1.2.3 stringi_1.7.12 miniUI_0.1.1.1 cachem_1.0.8 crayon_1.5.2
--
 
  |  
 


@bnprks
Copy link
Owner

bnprks commented Aug 12, 2023

Have you already installed Rtools as described here? This is required for package compilation on Windows. Rtools comes with a copy of hdf5 that it will use automatically

@sentisci
Copy link
Author

The link is helpful. Using R-4.3. and Rtools43 I was able to install BPCells. Thanks much for the help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants