egeulgen / pathfindR

pathfindR: Enrichment Analysis Utilizing Active Subnetworks
https://egeulgen.github.io/pathfindR/
Other
179 stars 25 forks source link

Installation errors #188

Closed avishai987 closed 8 months ago

avishai987 commented 8 months ago

Hi, and thanks for the nice-looking package. I have an error while installing. I tried "install.packages("pathfindR")", pak::pkg_install("pathfindR") and devtools::install_github("egeulgen/pathfindR") and I get different error message:

Describe the bug for install.packages("pathfindR") I am getting error: Java version not detected. I saw that it has been asked before, but the problem in my case is that JAVA is installed and JAVA_HOME is set (I debug the function fetch_java_version) but the folder not visible to rsutdio, thus getting TRUE when: !file.exists("/usr/lib/jvm/java-11-openjdk-amd64/") but the folder is definitely exists.

> install.packages("pathfindR")
Installing package into ‘/sci/labs/yotamd/lab_share/avishai.wizel/R_projects/libs’
(as ‘lib’ is unspecified)
trying URL 'https://packagemanager.rstudio.com/cran/__linux__/focal/2022-04-21/src/contrib/pathfindR_1.6.3.tar.gz'
Content type 'binary/octet-stream' length 3503776 bytes (3.3 MB)
==================================================
downloaded 3.3 MB

* installing *source* package ‘pathfindR’ ...
** package ‘pathfindR’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘pathfindR’:
 .onAttach failed in attachNamespace() for 'pathfindR', details:
  call: fetch_java_version()
  error: Java version not detected. Please download and install Java from “https://www.java.com/en/”
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/sci/labs/yotamd/lab_share/avishai.wizel/R_projects/libs/pathfindR’
Warning in install.packages :
  installation of package ‘pathfindR’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpejJNwb/downloaded_packages’

pak::pkg_install("pathfindR") raised unexplained error:

> pak::pkg_install("pathfindR")
✓ Loading metadata database ... done

→ Will install 1 package.
→ Will download 1 CRAN package (3.90 MB).
+ pathfindR   1.6.3 [bld][dl] (3.90 MB)
ℹ Getting 1 pkg (3.90 MB)
✓ Cached copy of pathfindR 1.6.3 (source) is the latest build       
✓ No downloads needed, all packages are cached                      
ℹ Building pathfindR 1.6.3
x Failed to build pathfindR 1.6.3                                        
Error: Failed to build source package 'pathfindR'                        
Type .Last.error.trace to see where the error occurred
> 
> .Last.error.trace

 Stack trace:

 12. (function (...)  ...
 13. base:::withCallingHandlers(cli_message = function(msg) { ...
 14. get("pkg_install_do_plan", asNamespace("pak"))(...)
 15. pkgdepends::install_package_plan(plan = plan, lib = lib, num_workers = num_ ...
 16. base:::withCallingHandlers({ ...
 17. pkgdepends:::handle_events(state, events)
 18. pkgdepends:::handle_event(state, i)
 19. pkgdepends:::stop_task(state, worker)
 20. pkgdepends:::stop_task_build(state, worker)
 21. base:::throw(new_pkg_build_error("Failed to build source package {pkg}",  ...
 22. base:::signalCondition(cond)
 23. (function (e)  ...
 24. base:::stop(e)
 25. (function (e)  ...

 x Failed to build source package 'pathfindR' 

And devtools::install_github("egeulgen/pathfindR") raise: Error: package ‘pathfindR.data’ 1.1.2 was found, but >= 2.0 is required by ‘pathfindR’

> devtools::install_github("egeulgen/pathfindR")
Downloading GitHub repo egeulgen/pathfindR@HEAD
✓  checking for file ‘/tmp/RtmpDA9VS1/remotesdfd529cde2f3/egeulgen-pathfindR-2e894e5/DESCRIPTION’ ... OK
─  preparing ‘pathfindR’:
✓  checking DESCRIPTION meta-information ... OK
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
   Omitted ‘LazyData’ from DESCRIPTION
─  building ‘pathfindR_2.3.0.9002.tar.gz’
   Warning in sprintf(gettext(fmt, domain = domain), ...) :
     one argument not used by format 'invalid uid value replaced by that for user 'nobody''
   Warning: invalid uid value replaced by that for user 'nobody'

Installing package into ‘/sci/labs/yotamd/lab_share/avishai.wizel/R_projects/libs’
(as ‘lib’ is unspecified)
* installing *source* package ‘pathfindR’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error: package ‘pathfindR.data’ 1.1.2 was found, but >= 2.0 is required by ‘pathfindR’
Execution halted
ERROR: lazy loading failed for package ‘pathfindR’
* removing ‘/sci/labs/yotamd/lab_share/avishai.wizel/R_projects/libs/pathfindR’
Warning message:
In i.p(...) :
  installation of package ‘/tmp/RtmpDA9VS1/filedfd537014c9f/pathfindR_2.3.0.9002.tar.gz’ had non-zero exit status

R Session Information:

R version 4.1.3 (2022-03-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] grDevices datasets  stats4    stats     graphics  utils     methods   base     

other attached packages:
 [1] print.rmd.tabs_0.1.0       My.rmd.template_0.0.0.9000 reticulate_1.24            msigdbr_7.5.1              SourceFromGithub_0.1.0     devtools_2.4.3            
 [7] usethis_2.1.5              GSEABase_1.56.0            graph_1.72.0               annotate_1.72.0            XML_3.99-0.9               AnnotationDbi_1.56.2      
[13] IRanges_2.28.0             S4Vectors_0.32.4           Biobase_2.54.0             BiocGenerics_0.40.0        ggpubr_0.4.0               RColorBrewer_1.1-3        
[19] forcats_0.5.1              stringr_1.4.0              dplyr_1.0.8                purrr_0.3.4                readr_2.1.2                tidyr_1.2.0               
[25] tibble_3.1.6               tidyverse_1.3.1            data.table_1.14.2          ggplot2_3.3.5              pheatmap_1.0.12           

loaded via a namespace (and not attached):
  [1] coda_0.19-4                 SeuratObject_4.1.0          bit64_4.0.5                 knitr_1.38                  multcomp_1.4-19            
  [6] DelayedArray_0.20.0         KEGGREST_1.34.0             RCurl_1.98-1.6              doParallel_1.0.17           generics_0.1.2             
 [11] callr_3.7.0                 cowplot_1.1.1               lambda.r_1.2.4              TH.data_1.1-1               RSQLite_2.2.12             
 [16] RANN_2.6.1                  future_1.24.0               bit_4.0.4                   tzdb_0.3.0                  webshot_0.5.3              
 [21] xml2_1.3.3                  lubridate_1.8.0             SummarizedExperiment_1.24.0 assertthat_0.2.1            xfun_0.30                  
 [26] hms_1.1.1                   babelgene_22.3              evaluate_0.15               argparse_2.1.5              fansi_1.0.3                
 [31] caTools_1.18.2              dbplyr_2.1.1                readxl_1.4.0                htmlwidgets_1.5.4           geneplotter_1.72.0         
 [36] DBI_1.1.2                   futile.logger_1.4.3         ellipsis_0.3.2              backports_1.4.1             ulimit_0.0-3               
 [41] libcoin_1.0-9               MatrixGenerics_1.6.0        vctrs_0.4.1                 SingleCellExperiment_1.16.0 remotes_2.4.2              
 [46] ROCR_1.0-11                 abind_1.4-5                 cachem_1.0.6                withr_2.5.0                 ggforce_0.3.3              
 [51] progressr_0.10.0            prettyunits_1.1.1           svglite_2.1.0               cluster_2.1.2               DOSE_3.20.1                
 [56] ape_5.6-2                   crayon_1.5.1                genefilter_1.76.0           edgeR_3.36.0                pkgconfig_2.0.3            
 [61] tweenr_1.0.2                GenomeInfoDb_1.30.1         nlme_3.1-155                pkgload_1.2.4               rlang_1.0.2                
 [66] globals_0.14.0              lifecycle_1.0.1             sandwich_3.0-1              downloader_0.4              modelr_0.1.8               
 [71] cellranger_1.1.0            rprojroot_2.0.3             polyclip_1.10-0             matrixStats_0.62.0          Matrix_1.4-0               
 [76] pak_0.3.0                   carData_3.0-5               zoo_1.8-10                  reprex_2.0.1                GlobalOptions_0.1.2        
 [81] ggridges_0.5.3              processx_3.8.2.9000         rjson_0.2.21                png_0.1-7                   viridisLite_0.4.0          
 [86] bitops_1.0-7                KernSmooth_2.23-20          Biostrings_2.62.0           blob_1.2.3                  shape_1.4.6                
 [91] qvalue_2.26.0               coin_1.4-2                  parallelly_1.31.0           rstatix_0.7.0               ggsignif_0.6.3             
 [96] scales_1.2.0                memoise_2.0.1               magrittr_2.0.3              plyr_1.8.7                  ica_1.0-2                  
[101] gplots_3.1.1                zlibbioc_1.40.0             compiler_4.1.3              kableExtra_1.3.4            clue_0.3-60                
[106] DESeq2_1.34.0               fitdistrplus_1.1-8          cli_3.2.0                   XVector_0.34.0              listenv_0.8.0              
[111] ps_1.7.0                    formatR_1.12                MASS_7.3-55                 tidyselect_1.1.2            stringi_1.7.6              
[116] GOSemSim_2.20.0             locfit_1.5-9.5              ggrepel_0.9.1               grid_4.1.3                  fastmatch_1.1-3            
[121] tools_4.1.3                 future.apply_1.8.1          parallel_4.1.3              circlize_0.4.14             rstudioapi_0.13            
[126] foreach_1.5.2               gridExtra_2.3               farver_2.1.0                Rtsne_0.16                  BiocManager_1.30.17        
[131] digest_0.6.29               rgeos_0.5-9                 Rcpp_1.0.8.3                GenomicRanges_1.46.1        car_3.0-12                 
[136] broom_0.8.0                 RcppAnnoy_0.0.19            httr_1.4.2                  ComplexHeatmap_2.10.0       colorspace_2.0-3           
[141] rvest_1.0.2                 brio_1.1.3                  fs_1.5.2                    splines_4.1.3               sp_1.4-7                   
[146] sessioninfo_1.2.2           systemfonts_1.0.4           xtable_1.8-4                jsonlite_1.8.0              futile.options_1.0.1       
[151] modeltools_0.2-23           testthat_3.1.4              R6_2.5.1                    pillar_1.7.0                htmltools_0.5.2            
[156] DT_0.22                     glue_1.6.2                  fastmap_1.1.0               BiocParallel_1.28.3         codetools_0.2-18           
[161] fgsea_1.20.0                pkgbuild_1.3.1              mvtnorm_1.1-3               utf8_1.2.2                  lattice_0.20-45            
[166] curl_4.3.2                  gtools_3.9.2                GO.db_3.14.0                survival_3.2-13             limma_3.50.3               
[171] rmarkdown_2.13              desc_1.4.1                  munsell_0.5.0               GetoptLong_1.0.5            DO.db_2.9                  
[176] fastcluster_1.2.3           GenomeInfoDbData_1.2.7      iterators_1.0.14            haven_2.5.0                 reshape2_1.4.4             
[181] gtable_0.3.0

Thanks in advance

egeulgen commented 8 months ago

Hello @avishai987 Please follow the advice in this article and let me know if that resolves the issue. Particularly, this section to reconfigure R so that R points to the desired Java installation.

sudo R CMD javareconf
avishai987 commented 8 months ago

Hello @avishai987 Please follow the advice in this article and let me know if that resolves the issue. Particularly, this section to reconfigure R so that R points to the desired Java installation.

sudo R CMD javareconf

Thanks, forgot to mention that I tried that, but I don't have sudo permission (university server), so:

moriah-gw-02:~% R CMD javareconf
Java interpreter : /usr/lib/jvm/default-java/bin/java
Java version     : 11.0.12
Java home path   : /usr/lib/jvm/default-java
Java compiler    : /usr/lib/jvm/default-java/bin/javac
Java headers gen.:
Java archive tool: /usr/lib/jvm/default-java/bin/jar

trying to compile and link a JNI program
detected JNI cpp flags    : -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
detected JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux     -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c conftest.c -o conftest.o
gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-z,relro -o conftest.so conftest.o -L/usr/lib/jvm/default-java/lib/server -ljvm -L/usr/lib/R/lib -lR

JAVA_HOME        : /usr/lib/jvm/default-java
Java library path: $(JAVA_HOME)/lib/server
JNI cpp flags    : -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
Updating Java configuration in /usr/lib/R
/usr/lib/R/bin/javareconf: line 399: /usr/lib/R/etc/Makeconf.new: Read-only file system
*** cannot create /usr/lib/R/etc/Makeconf.new
*** Please run as root if required.
egeulgen commented 8 months ago

I would contact your sysadmin. Without the proper configuration, you will not be able to pathfindR or other R packages that depend on Java. If you feel comfortable, other options are:- to use the conda package (likely to run into the same issue  - to use the docker image of pathfindR (I’m not sure but it should up-to-date)-EOn 17 Jan 2024, at 11:56, Avishai Wizel @.***> wrote:

Hello @avishai987 Please follow the advice in this article and let me know if that resolves the issue. Particularly, this section to reconfigure R so that R points to the desired Java installation. sudo R CMD javareconf

Thanks, forgot to mention that I tried that, but I don't have sudo permission, so: moriah-gw-02:~% R CMD javareconf Java interpreter : /usr/lib/jvm/default-java/bin/java Java version : 11.0.12 Java home path : /usr/lib/jvm/default-java Java compiler : /usr/lib/jvm/default-java/bin/javac Java headers gen.: Java archive tool: /usr/lib/jvm/default-java/bin/jar

trying to compile and link a JNI program detected JNI cpp flags : -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux detected JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -fpic -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c conftest.c -o conftest.o gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-z,relro -o conftest.so conftest.o -L/usr/lib/jvm/default-java/lib/server -ljvm -L/usr/lib/R/lib -lR

JAVA_HOME : /usr/lib/jvm/default-java Java library path: $(JAVA_HOME)/lib/server JNI cpp flags : -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm Updating Java configuration in /usr/lib/R /usr/lib/R/bin/javareconf: line 399: /usr/lib/R/etc/Makeconf.new: Read-only file system cannot create /usr/lib/R/etc/Makeconf.new Please run as root if required.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>