致命错误与安装 R ‘scalop’ 包时涉及到 “include S.h” 相关。

huangapple go评论75阅读模式
英文:

Fatal error relating to "include S.h" when installing R 'scalop' package

问题

我正尝试安装一个名为'infercna'的R包,其GitHub存储库链接在这里

安装过程尝试加载另一个名为'scalop'的包,其链接在这里

具体而言,这个命令:

devtools::install_github("jlaffy/infercna")

返回如下:

下载 GitHub 存储库 jlaffy/infercna@HEAD
── R CMD 构建 ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔ 检查文件 ‘/private/var/folders/hj/1wvjfb692c3gswybcg8xdcwm0000gn/T/RtmpqQIEYL/remotes7d75586a9ac5/jlaffy-infercna-98a8db8/DESCRIPTION’ (343ms)
── 准备 ‘infercna’:
✔ 检查 DESCRIPTION 元信息 ...
── 检查源文件和构建文件以及 shell 脚本中的 LF 行结束符
── 检查空目录或不需要的目录
     NB: 此包现在依赖于 R (>= 3.5.0)
     警告: 添加了对 R (>= 3.5.0) 的依赖,因为序列化对象在旧版本的 R 中无法读取。
     包含此类对象的文件:
       ‘infercna/data-raw/genes.rda’
── 构建 ‘infercna_1.0.0.tar.gz’

* 正在安装 *source* 包 ‘infercna’ ...
** 使用分阶段安装
** R
** 数据
*** 将数据集移动到 lazyload DB
** 编译字节码并为延迟加载准备包
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  没有叫做 ‘scalop’ 的包
Calls: <Anonymous> ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
ERROR: lazy loading failed for package ‘infercna’
* 删除 ‘/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/infercna’

因此,我回溯并尝试安装'scalop',如下:

```R
remotes::install_github("jlaffy/scalop")

从这里开始情况变得非常复杂。要安装'scalop',需要95个依赖项。成功安装所有95个依赖项后,安装'scalop'最终仍然会失败,如下:

检查文件 ‘/private/var/folders/hj/1wvjfb692c3gswybcg8xdcwm0000gn/T/RtmpqQIEYL/remotes7d757fe15404/jlaffy-scalop-021999d/DESCRIPTION’ ...
── 准备 ‘scalop’: (385ms)
✔ 检查 DESCRIPTION 元信息 ...
── 清理 src
── 检查源文件和构建文件以及 shell 脚本中的 LF 行结束符
── 检查空目录或不需要的目录
── 构建 ‘scalop_1.1.0.tar.gz’

* 正在安装 *source* 包 ‘scalop’ ...
** 使用分阶段安装
** libs
使用 C 编译器: ‘Apple clang version 11.0.3 (clang-1103.0.32.62)’
使用 SDK: ‘MacOSX10.15.sdk’
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/Rcpp/include' -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init.c -o init.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/Rcpp/include' -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c nd.c -o nd.o
nd.c:24:10: fatal error: ‘S.h’ file not found
#include "S.h"
         ^~~~~
1 error generated.
make: *** [nd.o] Error 1
ERROR: compilation failed for package ‘scalop’
* 删除 ‘/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/scalop’

我写信是想问有没有人对这个输出了解足够多,知道如何修复“致命错误,未找到‘S.h’文件”的错误,这个错误最终导致下载失败。

已经有几个人通过在scalop的问题页面上发表问题,特别是问题4问题5来联系作者,但没有回复。此外,将错误消息发布到Google并没有返回有用的结果,就我所见。

最后,我愿意提供所有必要的信息;例如 sessionInfo(),R版本(4.3),Mac OS(11.7)等。

帮助我,Stack Overflow-Kenobi,你是我唯一的希望。

英文:

I am attempting to install an R package named 'infercna', the github repository to which is linked here.

The install process attempts to load another package named 'scalop', which is linked here.

Specifically, this command:

devtools::install_github(&quot;jlaffy/infercna&quot;)

returns

Downloading GitHub repo jlaffy/infercna@HEAD
── R CMD build ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔  checking for file ‘/private/var/folders/hj/1wvjfb692c3gswybcg8xdcwm0000gn/T/RtmpqQIEYL/remotes7d75586a9ac5/jlaffy-infercna-98a8db8/DESCRIPTION’ (343ms)
─  preparing ‘infercna’:
✔  checking DESCRIPTION meta-information ...
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
     NB: this package now depends on R (&gt;= 3.5.0)
     WARNING: Added dependency on R &gt;= 3.5.0 because serialized objects in
     serialize/load version 3 cannot be read in older versions of R.
     File(s) containing such objects:
       ‘infercna/data-raw/genes.rda’
─  building ‘infercna_1.0.0.tar.gz’
   
* installing *source* package ‘infercna’ ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading
Error in loadNamespace(j &lt;- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  there is no package called ‘scalop’
Calls: &lt;Anonymous&gt; ... loadNamespace -&gt; withRestarts -&gt; withOneRestart -&gt; doWithOneRestart
Execution halted
ERROR: lazy loading failed for package ‘infercna’
* removing ‘/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/infercna’

As such, I backtracked and attempted to install scalop, like so:

remotes::install_github(&quot;jlaffy/scalop&quot;)

This is where things start to really get hairy. To install, scalop requires 95 dependencies. Upon successful installation of all 95, the installation for scalop will eventually still fail, like so:

checking for file ‘/private/var/folders/hj/1wvjfb692c3gswybcg8xdcwm0000gn/T/RtmpqQIEYL/remotes7d757fe15404/jlaffy-scalop-021999d/DESCRIPTION’ ...
─  preparing ‘scalop’: (385ms)
✔  checking DESCRIPTION meta-information ...
─  cleaning src
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘scalop_1.1.0.tar.gz’
   
* installing *source* package ‘scalop’ ...
** using staged installation
** libs
using C compiler: ‘Apple clang version 11.0.3 (clang-1103.0.32.62)’
using SDK: ‘MacOSX10.15.sdk’
clang -arch x86_64 -I&quot;/Library/Frameworks/R.framework/Resources/include&quot; -DNDEBUG  -I&#39;/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/Rcpp/include&#39; -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init.c -o init.o
clang -arch x86_64 -I&quot;/Library/Frameworks/R.framework/Resources/include&quot; -DNDEBUG  -I&#39;/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/Rcpp/include&#39; -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c nd.c -o nd.o
nd.c:24:10: fatal error: &#39;S.h&#39; file not found
#include &quot;S.h&quot;
         ^~~~~
1 error generated.
make: *** [nd.o] Error 1
ERROR: compilation failed for package ‘scalop’
* removing ‘/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/scalop’

I am writing to ask if anyone knows enough about this output to know what to do to fix the "fatal error, 'S.h' file not found" error, which ultimately kills the download.

Several people have reached out to the author, as per the issues posted on scalop; specifically issues 4 and 5, but no reply. Additionally, posting the error message into google does not return useful hits, so far as I can see.

Finally, I am happy to provide any and all necessary info; e.g. sessionInfo(), R version (4.3) Mac OS (11.7) etc.

Help me Stack Overflow-Kenobi, you're my only hope.

答案1

得分: 1

以下是翻译好的部分:

  1. "S.h" 头文件来自于 "S" 语言(R 语言的前身);将 "S.h" 替换为 "R.h" 可以修复 '找不到 S.h' 错误,但会引发其他问题。显然,这个软件包没有得到维护 致命错误与安装 R ‘scalop’ 包时涉及到 “include S.h” 相关。

  2. 我分叉了存储库并对源代码进行了一些更改(提交 fe15cf9 和 ab9fe5c)。我成功地通过 Bioconductor 安装了 scalop 和 infercna 软件包,但它们在编译时会产生很多警告。我使用 gcc 编译它们,而不是 Apple Clang,并使用了以下标志:

    cat ~/.R/Makevars
    LOC=/usr/local/gfortran
    CC=$(LOC)/bin/gcc -fopenmp
    CXX=$(LOC)/bin/g++ -fopenmp
    CXX11=$(LOC)/bin/g++ -fopenmp
    
    CFLAGS=-g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe
    CXXFLAGS=-g -O3 -Wall -pedantic -std=c++11 -mtune=native -pipe
    LDFLAGS=-L$(LOC)/lib -Wl,-rpath,$(LOC)/lib,-L/usr/local/lib
    CPPFLAGS=-I$(LOC)/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/include
    
    FLIBS=-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin19/10.2.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm
    CXX1X=/usr/local/gfortran/bin/g++
    CXX98=/usr/local/gfortran/bin/g++
    CXX11=/usr/local/gfortran/bin/g++
    CXX14=/usr/local/gfortran/bin/g++
    CXX17=/usr/local/gfortran/bin/g++
    
  3. 如果您在使用 Apple Clang 安装 scalop 软件包时遇到问题,并且您有英特尔处理器,可以尝试查看此处的编译 R 软件包的说明:https://stackoverflow.com/a/65334247/12957340

  4. 如果您有 Apple Silicon 处理器,可以尝试查看此处的说明:https://stackoverflow.com/a/68275558/12957340

  5. 这是我安装软件包的方法:

    install.packages("BiocManager")
    library(BiocManager)
    BiocManager::install("Homo.sapiens")
    BiocManager::install("jpmam1/scalop") # 我的分叉版本
    BiocManager::install("jlaffy/infercna")
    
  6. 示例来自于用户手册,但其中一些函数不再按预期工作。

  7. 根据您的用例,您可能需要进一步更改源代码以获得所需的输出。如果您有更多的错误或问题,请在评论中发布,我会在有时间时查看它们。

  8. R 会话信息:

    R 版本 4.3.0(2023-04-21)
    平台:x86_64-apple-darwin20(64 位)
    运行在:macOS Ventura 13.3.1
    

请注意,这些信息可能已过时,因为是从提供的文本中提取的。

英文:

The "S.h" headers file is from the "S" language (the precursor to R); replacing "S.h" with "R.h" fixes the 'cant find S.h' error, but causes other issues. Clearly this package is not being maintained 致命错误与安装 R ‘scalop’ 包时涉及到 “include S.h” 相关。

I've forked the repository and made a couple of changes to the source code (commits fe15cf9 and ab9fe5c). I successfully installed both the scalop and infercna packages via Bioconductor, but there are a lot of warnings when they compile. I used gcc to compile them, rather than Apple Clang, with these flags:

cat ~/.R/Makevars
LOC=/usr/local/gfortran
CC=$(LOC)/bin/gcc -fopenmp
CXX=$(LOC)/bin/g++ -fopenmp
CXX11=$(LOC)/bin/g++ -fopenmp

CFLAGS=-g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe
CXXFLAGS=-g -O3 -Wall -pedantic -std=c++11 -mtune=native -pipe
LDFLAGS=-L$(LOC)/lib -Wl,-rpath,$(LOC)/lib,-L/usr/local/lib
CPPFLAGS=-I$(LOC)/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/include

FLIBS=-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin19/10.2.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm
CXX1X=/usr/local/gfortran/bin/g++
CXX98=/usr/local/gfortran/bin/g++
CXX11=/usr/local/gfortran/bin/g++
CXX14=/usr/local/gfortran/bin/g++
CXX17=/usr/local/gfortran/bin/g++

If you have problems installing the scalop package from source using Apple Clang, and you have an intel processor, my instructions for compiling R packages from source are here: https://stackoverflow.com/a/65334247/12957340

If you have an Apple silicon processor, you can try the instructions here: https://stackoverflow.com/a/68275558/12957340


This is how I installed the packages:

install.packages(&quot;BiocManager&quot;)
library(BiocManager)
BiocManager::install(&quot;Homo.sapiens&quot;)
BiocManager::install(&quot;jpmam1/scalop&quot;) # my forked copy
BiocManager::install(&quot;jlaffy/infercna&quot;)

The example from the vignette runs, but some of the functions no longer work as expected:

library(infercna)
#&gt; 
#&gt; 
#&gt; Warning: replacing previous import &#39;AnnotationDbi::select&#39; by &#39;dplyr::select&#39;
#&gt; when loading &#39;scalop&#39;
#&gt; 
#&gt; Attaching package: &#39;infercna&#39;
#&gt; The following object is masked from &#39;package:graphics&#39;:
#&gt; 
#&gt;     clip
set.seed(1014)
useGenome(&#39;hg19&#39;)
#&gt; Genome has been set to hg19
retrieveGenome()
#&gt; Retrieving: hg19
#&gt; # A tibble: 33,575 &#215; 8
#&gt;    symbol     start_position end_position chromosome_name arm   band   strand
#&gt;    &lt;chr&gt;               &lt;dbl&gt;        &lt;dbl&gt; &lt;fct&gt;           &lt;fct&gt; &lt;chr&gt;   &lt;int&gt;
#&gt;  1 DDX11L1             11869        14412 1               1p    p36.33      1
#&gt;  2 WASH7P              14363        29806 1               1p    p36.33     -1
#&gt;  3 MIR1302-11          29554        31109 1               1p    p36.33      1
#&gt;  4 FAM138A             34554        36081 1               1p    p36.33     -1
#&gt;  5 OR4G4P              52473        54936 1               1p    p36.33      1
#&gt;  6 OR4G11P             62948        63887 1               1p    p36.33      1
#&gt;  7 OR4F5               69091        70008 1               1p    p36.33      1
#&gt;  8 CICP27             131025       134836 1               1p    p36.33      1
#&gt;  9 RNU6-1100P         157784       157887 1               1p    p36.33     -1
#&gt; 10 CICP7              329431       332236 1               1p    p36.33     -1
#&gt; # ℹ 33,565 more rows
#&gt; # ℹ 1 more variable: ensembl_gene_id &lt;chr&gt;
m = useData(mgh125)
dim(m)
#&gt; [1] 8556 1266
range(m)
#&gt; [1]  0.000 15.328
lengths(refCells)
#&gt; oligodendrocytes      macrophages 
#&gt;              219              707

cna = infercna(m = m, refCells = refCells, n = 5000, noise = 0.1, isLog = TRUE, verbose = FALSE)
cnaM = cna[, !colnames(cna) %in% unlist(refCells)]

cnaScatterPlot(cna = cna,
               signal.threshold = NULL,
               main = &#39;Default&#39;)

致命错误与安装 R ‘scalop’ 包时涉及到 “include S.h” 相关。<!-- -->


obj = cnaPlot(cna = cna,
              order.cells = TRUE,
              subtitle = &#39;Copy-Number Aberrations in a patient with Glioblastoma&#39;)
#&gt; Error in if (class(x) == &quot;matrix&quot;) {: the condition has length &gt; 1

Depending on your use-case, you'll probably need to make further changes to the source code to get your desired output. If you have further errors/questions please post them in the comments and I'll take a look at them when I have some time.


sessionInfo()
#&gt; R version 4.3.0 (2023-04-21)
#&gt; Platform: x86_64-apple-darwin20 (64-bit)
#&gt; Running under: macOS Ventura 13.3.1
#&gt; 
#&gt; Matrix products: default
#&gt; BLAS:   /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRblas.0.dylib 
#&gt; LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0
#&gt; 
#&gt; locale:
#&gt; [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#&gt; 
#&gt; time zone: Australia/Melbourne
#&gt; tzcode source: internal
#&gt; 
#&gt; attached base packages:
#&gt; [1] stats     graphics  grDevices utils     datasets  methods   base     
#&gt; 
#&gt; other attached packages:
#&gt; [1] infercna_1.0.0
#&gt; 
#&gt; loaded via a namespace (and not attached):
#&gt;   [1] splines_4.3.0                          
#&gt;   [2] BiocIO_1.10.0                          
#&gt;   [3] bitops_1.0-7                           
#&gt;   [4] ggplotify_0.1.0                        
#&gt;   [5] filelock_1.0.2                         
#&gt;   [6] tibble_3.2.1                           
#&gt;   [7] R.oo_1.25.0                            
#&gt;   [8] polyclip_1.10-4                        
#&gt;   [9] graph_1.78.0                           
#&gt;  [10] reprex_2.0.2                           
#&gt;  [11] XML_3.99-0.14                          
#&gt;  [12] lifecycle_1.0.3                        
#&gt;  [13] rstatix_0.7.2                          
#&gt;  [14] edgeR_3.42.4                           
#&gt;  [15] Homo.sapiens_1.3.1                     
#&gt;  [16] lattice_0.21-8                         
#&gt;  [17] MASS_7.3-60                            
#&gt;  [18] OrganismDbi_1.42.0                     
#&gt;  [19] backports_1.4.1                        
#&gt;  [20] magrittr_2.0.3                         
#&gt;  [21] limma_3.56.1                           
#&gt;  [22] plotly_4.10.1                          
#&gt;  [23] rmarkdown_2.22                         
#&gt;  [24] yaml_2.3.7                             
#&gt;  [25] metapod_1.8.0                          
#&gt;  [26] cowplot_1.1.1                          
#&gt;  [27] DBI_1.1.3                              
#&gt;  [28] RColorBrewer_1.1-3                     
#&gt;  [29] abind_1.4-5                            
#&gt;  [30] zlibbioc_1.46.0                        
#&gt;  [31] Rtsne_0.16                             
#&gt;  [32] R.cache_0.16.0                         
#&gt;  [33] GenomicRanges_1.52.0                   
#&gt;  [34] purrr_1.0.1                            
#&gt;  [35] mixtools_2.0.0                         
#&gt;  [36] R.utils_2.12.2                         
#&gt;  [37] msigdbr_7.5.1                          
#&gt;  [38] ggraph_2.1.0                           
#&gt;  [39] BiocGenerics_0.46.0                    
#&gt;  [40] RCurl_1.98-1.12                        
#&gt;  [41] styler_1.10.0                          
#&gt;  [42] yulab.utils_0.0.6                      
#&gt;  [43] tweenr_2.0.2                           
#&gt;  [44] rappdirs_0.3.3                         
#&gt;  [45] GenomeInfoDbData_1.2.10                
#&gt;  [46] IRanges_2.34.0                         
#&gt;  [47] S4Vectors_0.38.1                       
#&gt;  [48] enrichplot_1.20.0                      
#&gt;  [49] ggrepel_0.9.3                          
#&gt;  [50] irlba_2.3.5.1                          
#&gt;  [51] tidytree_0.4.2                         
#&gt;  [52] dqrng_0.3.0                            
#&gt;  [53] DelayedMatrixStats_1.22.0              
#&gt;  [54] codetools_0.2-19                       
#&gt;  [55] DelayedArray_0.26.3                    
#&gt;  [56] scuttle_1.10.1                         
#&gt;  [57] DOSE_3.26.1                            
#&gt;  [58] xml2_1.3.4                             
#&gt;  [59] ggforce_0.4.1                          
#&gt;  [60] tidyselect_1.2.0                       
#&gt;  [61] aplot_0.1.10                           
#&gt;  [62] farver_2.1.1                           
#&gt;  [63] ScaledMatrix_1.8.1                     
#&gt;  [64] viridis_0.6.3                          
#&gt;  [65] matrixStats_0.63.0                     
#&gt;  [66] stats4_4.3.0                           
#&gt;  [67] BiocFileCache_2.8.0                    
#&gt;  [68] GenomicAlignments_1.36.0               
#&gt;  [69] jsonlite_1.8.4                         
#&gt;  [70] BiocNeighbors_1.18.0                   
#&gt;  [71] tidygraph_1.2.3                        
#&gt;  [72] survival_3.5-5                         
#&gt;  [73] segmented_1.6-4                        
#&gt;  [74] tools_4.3.0                            
#&gt;  [75] progress_1.2.2                         
#&gt;  [76] treeio_1.24.1                          
#&gt;  [77] TxDb.Hsapiens.UCSC.hg19.knownGene_3.2.2
#&gt;  [78] Rcpp_1.0.10                            
#&gt;  [79] glue_1.6.2                             
#&gt;  [80] gridExtra_2.3                          
#&gt;  [81] xfun_0.39                              
#&gt;  [82] qvalue_2.32.0                          
#&gt;  [83] MatrixGenerics_1.12.0                  
#&gt;  [84] GenomeInfoDb_1.36.0                    
#&gt;  [85] dplyr_1.1.2                            
#&gt;  [86] withr_2.5.0                            
#&gt;  [87] BiocManager_1.30.20                    
#&gt;  [88] fastmap_1.1.1                          
#&gt;  [89] bluster_1.10.0                         
#&gt;  [90] fansi_1.0.4                            
#&gt;  [91] rsvd_1.0.5                             
#&gt;  [92] caTools_1.18.2                         
#&gt;  [93] digest_0.6.31                          
#&gt;  [94] R6_2.5.1                               
#&gt;  [95] gridGraphics_0.5-1                     
#&gt;  [96] colorspace_2.1-0                       
#&gt;  [97] GO.db_3.17.0                           
#&gt;  [98] biomaRt_2.56.0                         
#&gt;  [99] RSQLite_2.3.1                          
#&gt; [100] R.methodsS3_1.8.2                      
#&gt; [101] utf8_1.2.3                             
#&gt; [102] tidyr_1.3.0                            
#&gt; [103] generics_0.1.3                         
#&gt; [104] data.table_1.14.8                      
#&gt; [105] rtracklayer_1.60.0                     
#&gt; [106] prettyunits_1.1.1                      
#&gt; [107] graphlayouts_1.0.0                     
#&gt; [108] httr_1.4.6                             
#&gt; [109] htmlwidgets_1.6.2                      
#&gt; [110] S4Arrays_1.0.4                         
#&gt; [111] scatterpie_0.2.0                       
#&gt; [112] pkgconfig_2.0.3                        
#&gt; [113] gtable_0.3.3                           
#&gt; [114] blob_1.2.4                             
#&gt; [115] SingleCellExperiment_1.22.0            
#&gt; [116] XVector_0.40.0                         
#&gt; [117] shadowtext_0.1.2                       
#&gt; [118] clusterProfiler_4.8.1                  
#&gt; [119] htmltools_0.5.5                        
#&gt; [120] carData_3.0-5                          
#&gt; [121] fgsea_1.26.0                           
#&gt; [122] scalop_1.1.0                           
#&gt; [123] RBGL_1.76.0                            
#&gt; [124] scales_1.2.1                           
#&gt; [125] Biobase_2.60.0                         
#&gt; [126] png_0.1-8                              
#&gt; [127] scran_1.28.1                           
#&gt; [128] ggfun_0.0.9                            
#&gt; [129] knitr_1.43                             
#&gt; [130] rstudioapi_0.14                        
#&gt; [131] reshape2_1.4.4                         
#&gt; [132] rjson_0.2.21                           
#&gt; [133] nlme_3.1-162                           
#&gt; [134] curl_5.0.0                             
#&gt; [135] org.Hs.eg.db_3.17.0                    
#&gt; [136] cachem_1.0.8                           
#&gt; [137] stringr_1.5.0                          
#&gt; [138] parallel_4.3.0                         
#&gt; [139] HDO.db_0.99.1                          
#&gt; [140] AnnotationDbi_1.62.1                   
#&gt; [141] restfulr_0.0.15                        
#&gt; [142] pillar_1.9.0                           
#&gt; [143] grid_4.3.0                             
#&gt; [144] vctrs_0.6.2                            
#&gt; [145] ggpubr_0.6.0                           
#&gt; [146] BiocSingular_1.16.0                    
#&gt; [147] car_3.1-2                              
#&gt; [148] beachmat_2.16.0                        
#&gt; [149] dbplyr_2.3.2                           
#&gt; [150] cluster_2.1.4                          
#&gt; [151] evaluate_0.21                          
#&gt; [152] zeallot_0.1.0                          
#&gt; [153] GenomicFeatures_1.52.0                 
#&gt; [154] locfit_1.5-9.7                         
#&gt; [155] cli_3.6.1                              
#&gt; [156] compiler_4.3.0                         
#&gt; [157] Rsamtools_2.16.0                       
#&gt; [158] rlang_1.1.1                            
#&gt; [159] crayon_1.5.2                           
#&gt; [160] ggsignif_0.6.4                         
#&gt; [161] plyr_1.8.8                             
#&gt; [162] fs_1.6.2                               
#&gt; [163] stringi_1.7.12                         
#&gt; [164] viridisLite_0.4.2                      
#&gt; [165] BiocParallel_1.34.2                    
#&gt; [166] babelgene_22.9                         
#&gt; [167] munsell_0.5.0                          
#&gt; [168] Biostrings_2.68.1                      
#&gt; [169] lazyeval_0.2.2                         
#&gt; [170] GOSemSim_2.26.0                        
#&gt; [171] Matrix_1.5-4.1                         
#&gt; [172] patchwork_1.1.2                        
#&gt; [173] hms_1.1.3                              
#&gt; [174] sparseMatrixStats_1.12.0               
#&gt; [175] bit64_4.0.5                            
#&gt; [176] ggplot2_3.4.2                          
#&gt; [177] statmod_1.5.0                          
#&gt; [178] KEGGREST_1.40.0                        
#&gt; [179] SummarizedExperiment_1.30.1            
#&gt; [180] kernlab_0.9-32                         
#&gt; [181] igraph_1.4.3                           
#&gt; [182] broom_1.0.4                            
#&gt; [183] memoise_2.0.1                          
#&gt; [184] ggtree_3.8.0                           
#&gt; [185] fastmatch_1.1-3                        
#&gt; [186] bit_4.0.5                              
#&gt; [187] downloader_0.4                         
#&gt; [188] gson_0.1.0                             
#&gt; [189] ape_5.7-1

<sup>Created on 2023-06-02 with reprex v2.0.2</sup>

答案2

得分: 1

因为贾里德的回答中提到安装GCC可能需要几个小时,所以我想看看他所做的更改,以及与使用BiocManager进行安装相结合,是否可以解决这个问题。

事实上,对我来说是可以的。

具体的步骤如下:

首先安装所有其他依赖项,例如通过运行

devtools::install_github("jlaffy/infercna")

在依赖项安装完成后,包将失败,如原始帖子中所示。在此之后运行:

install.packages("BiocManager") # 如果未安装
library(BiocManager)
BiocManager::install("Homo.sapiens")
BiocManager::install("jpmam1/scalop") # 贾里德的优秀分支副本
BiocManager::install("jlaffy/infercna")

对我来说,在R v4.3、MacOSX 11.7、Intel芯片上,这将返回:

BiocManager::install("Homo.sapiens")
'getOption("repos")' 替代了Bioconductor标准存储库,有关详细信息,请参阅'help("repositories", package = "BiocManager")'替代存储库:
    CRAN: https://cran.rstudio.com/
Bioconductor版本3.17(BiocManager 1.30.20),R 4.3.02023-04-21正在安装软件包'Homo.sapiens'
也安装依赖项'graph''RBGL''OrganismDbi'

尝试URL'https://bioconductor.org/packages/3.17/bioc/bin/macosx/big-sur-x86_64/contrib/4.3/graph_1.78.0.tgz'
内容类型'application/x-gzip'长度2086473字节(2.0 MB)
==================================================
下载了2.0 MB

尝试URL'https://bioconductor.org/packages/3.17/bioc/bin/macosx/big-sur-x86_64/contrib/4.3/RBGL_1.76.0.tgz'
内容类型'application/x-gzip'长度3547879字节(3.4 MB)
==================================================
下载了3.4 MB

尝试URL'https://bioconductor.org/packages/3.17/bioc/bin/macosx/big-sur-x86_64/contrib/4.3/OrganismDbi_1.42.0.tgz'
内容类型'application/x-gzip'长度796254字节(777 KB)
==================================================
下载了777 KB


下载的二进制软件包位于
	/var/folders/hj/1wvjfb692c3gswybcg8xdcwm0000gn/T//Rtmp6rXv9T/downloaded_packages
正在安装源软件包'Homo.sapiens'

尝试URL'https://bioconductor.org/packages/3.17/data/annotation/src/contrib/Homo.sapiens_1.3.1.tar.gz'
内容类型'application/x-gzip'长度1617字节
==================================================
下载了1617字节

* 正在安装**软件包'Homo.sapiens' ...
** 使用分阶段安装
** R
** 数据
** 字节编译并准备包以进行惰性加载
** 帮助
*** 安装帮助索引
** 构建软件包索引
** 测试是否可以从临时位置加载已安装的软件包
** 测试是否可以从最终位置加载已安装的软件包
** 测试是否已安装的软件包保留了临时安装路径的记录
* 完成(Homo.sapiens)

下载的源软件包位于
/private/var/folders/hj/1wvjfb692c3gswybcg8xdcwm0000gn/T/Rtmp6rXv9T/downloaded_packages’
旧软件包:'matrixStats'
更新全部/一些/无? [a/s/n]:BiocManager::install("jpmam1/scalop")
更新全部/一些/无? [a/s/n]: 
a
尝试URL'https://cran.rstudio.com/bin/macosx/big-sur-x86_64/contrib/4.3/matrixStats_0.63.0.tgz'
内容类型'application/x-gzip'长度653132字节(637 KB)
==================================================
下载了637 KB


下载的二进制软件包位于
	/var/folders/hj/1wvjfb692c3gswybcg8xdcwm0000gn/T//Rtmp6rXv9T/downloaded_packages
> BiocManager::install("jpmam1/scalop")
'getOption("repos")' 替代了Bioconductor标准存储库,有关详细信息,请参阅'help("repositories", package = "BiocManager")'替代存储库:
    CRAN: https://cran.rstudio.com/
Bioconductor版本3.17(BiocManager 1.30.20),R 4.3.02023-04-21正在安装GitHub软件包'scalop'
下载GitHub存储库jpmam1/scalop@HEAD
这些软件包有更新版本可用。
建议更新所有这些软件包。
您想要更新哪个?

1:全部
2:仅CRAN软件包
3:无
4:matrixStats(0.63.0 -&gt; 1.0.0)[CRAN]

输入一个或多个数字,或按回车键跳过更新:1
matrixStats(0.63.0 -&gt; 1.0.0)[CRAN]
正在安装1个软件包:matrixStats
尝试URL'https://cran.rstudio.com/bin/macosx/big-sur-x86_64/contrib/4.3/matrixStats_0.63.0.tgz'
内容类型'application/x-gzip'长度653132字节(637 KB)
==================================================
下载了637 KB


下载的二进制软件包位于
	/var/folders/hj/1wvjfb692c3gswybcg8xdcwm0000gn/T//Rtmp6rXv9T/downloaded_packages
─ R CMD构建────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔ 检查文件'/private/var/folders/hj

<details>
<summary>英文:</summary>

All - because in jared&#39;s answer he notes installing GCC can take hours, I wanted to see if the changes he made, in conjunction with use of BiocManager for installation, would solve the problem.

In fact, for me it does. 

Specifically, the procedure is:

Install all other dependencies first, e.g. by running

    devtools::install_github(&quot;jlaffy/infercna&quot;)

after the dependencies install, the package will fail as indicated in the original post. Following this, run:

    install.packages(&quot;BiocManager&quot;) # if not installed
    library(BiocManager)
    BiocManager::install(&quot;Homo.sapiens&quot;)
    BiocManager::install(&quot;jpmam1/scalop&quot;) # Jared&#39;s awesome forked copy
    BiocManager::install(&quot;jlaffy/infercna&quot;)


For me, on R v4.3, MacOSX 11.7, intel chip, this returns:

    BiocManager::install(&quot;Homo.sapiens&quot;)
    &#39;getOption(&quot;repos&quot;)&#39; replaces Bioconductor standard repositories, see &#39;help(&quot;repositories&quot;, package = &quot;BiocManager&quot;)&#39; for details.
    Replacement repositories:
        CRAN: https://cran.rstudio.com/
    Bioconductor version 3.17 (BiocManager 1.30.20), R 4.3.0 (2023-04-21)
    Installing package(s) &#39;Homo.sapiens&#39;
    also installing the dependencies ‘graph’, ‘RBGL’, ‘OrganismDbi’
    
    trying URL &#39;https://bioconductor.org/packages/3.17/bioc/bin/macosx/big-sur-x86_64/contrib/4.3/graph_1.78.0.tgz&#39;
    Content type &#39;application/x-gzip&#39; length 2086473 bytes (2.0 MB)
    ==================================================
    downloaded 2.0 MB
    
    trying URL &#39;https://bioconductor.org/packages/3.17/bioc/bin/macosx/big-sur-x86_64/contrib/4.3/RBGL_1.76.0.tgz&#39;
    Content type &#39;application/x-gzip&#39; length 3547879 bytes (3.4 MB)
    ==================================================
    downloaded 3.4 MB
    
    trying URL &#39;https://bioconductor.org/packages/3.17/bioc/bin/macosx/big-sur-x86_64/contrib/4.3/OrganismDbi_1.42.0.tgz&#39;
    Content type &#39;application/x-gzip&#39; length 796254 bytes (777 KB)
    ==================================================
    downloaded 777 KB
    
    
    The downloaded binary packages are in
    	/var/folders/hj/1wvjfb692c3gswybcg8xdcwm0000gn/T//Rtmp6rXv9T/downloaded_packages
    installing the source package ‘Homo.sapiens’
    
    trying URL &#39;https://bioconductor.org/packages/3.17/data/annotation/src/contrib/Homo.sapiens_1.3.1.tar.gz&#39;
    Content type &#39;application/x-gzip&#39; length 1617 bytes
    ==================================================
    downloaded 1617 bytes
    
    * installing *source* package ‘Homo.sapiens’ ...
    ** using staged installation
    ** R
    ** data
    ** byte-compile and prepare package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** testing if installed package can be loaded from temporary location
    ** testing if installed package can be loaded from final location
    ** testing if installed package keeps a record of temporary installation path
    * DONE (Homo.sapiens)
    
    The downloaded source packages are in
/private/var/folders/hj/1wvjfb692c3gswybcg8xdcwm0000gn/T/Rtmp6rXv9T/downloaded_packages’
    Old packages: &#39;matrixStats&#39;
    Update all/some/none? [a/s/n]: BiocManager::install(&quot;jpmam1/scalop&quot;)
    Update all/some/none? [a/s/n]: 
    a
    trying URL &#39;https://cran.rstudio.com/bin/macosx/big-sur-x86_64/contrib/4.3/matrixStats_0.63.0.tgz&#39;
    Content type &#39;application/x-gzip&#39; length 653132 bytes (637 KB)
    ==================================================
    downloaded 637 KB
    
    
    The downloaded binary packages are in
    	/var/folders/hj/1wvjfb692c3gswybcg8xdcwm0000gn/T//Rtmp6rXv9T/downloaded_packages
    &gt; BiocManager::install(&quot;jpmam1/scalop&quot;)
    &#39;getOption(&quot;repos&quot;)&#39; replaces Bioconductor standard repositories, see &#39;help(&quot;repositories&quot;, package = &quot;BiocManager&quot;)&#39; for details.
    Replacement repositories:
        CRAN: https://cran.rstudio.com/
    Bioconductor version 3.17 (BiocManager 1.30.20), R 4.3.0 (2023-04-21)
    Installing github package(s) &#39;jpmam1/scalop&#39;
    Downloading GitHub repo jpmam1/scalop@HEAD
    These packages have more recent versions available.
    It is recommended to update all of them.
    Which would you like to update?
    
    1: All                                 
    2: CRAN packages only                  
    3: None                                
    4: matrixStats (0.63.0 -&gt; 1.0.0) [CRAN]
    
    Enter one or more numbers, or an empty line to skip updates: 1
    matrixStats (0.63.0 -&gt; 1.0.0) [CRAN]
    Installing 1 packages: matrixStats
    trying URL &#39;https://cran.rstudio.com/bin/macosx/big-sur-x86_64/contrib/4.3/matrixStats_0.63.0.tgz&#39;
    Content type &#39;application/x-gzip&#39; length 653132 bytes (637 KB)
    ==================================================
    downloaded 637 KB
    
    
    The downloaded binary packages are in
    	/var/folders/hj/1wvjfb692c3gswybcg8xdcwm0000gn/T//Rtmp6rXv9T/downloaded_packages
    ── R CMD build ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    ✔  checking for file ‘/private/var/folders/hj/1wvjfb692c3gswybcg8xdcwm0000gn/T/Rtmp6rXv9T/remotes13284246ba83/jpmam1-scalop-ab9fe5c/DESCRIPTION’ ...
    ─  preparing ‘scalop’:
    ✔  checking DESCRIPTION meta-information ...
    ─  cleaning src
    ─  checking for LF line-endings in source and make files and shell scripts
    ─  checking for empty or unneeded directories
    ─  building ‘scalop_1.1.0.tar.gz’
       
    * installing *source* package ‘scalop’ ...
    ** using staged installation
    ** libs
    using C compiler: ‘Apple clang version 11.0.3 (clang-1103.0.32.62)’
    using SDK: ‘MacOSX10.15.sdk’
    clang -arch x86_64 -I&quot;/Library/Frameworks/R.framework/Resources/include&quot; -DNDEBUG  -I&#39;/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/Rcpp/include&#39; -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init.c -o init.o
    clang -arch x86_64 -I&quot;/Library/Frameworks/R.framework/Resources/include&quot; -DNDEBUG  -I&#39;/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/Rcpp/include&#39; -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c nd.c -o nd.o
    clang -arch x86_64 -I&quot;/Library/Frameworks/R.framework/Resources/include&quot; -DNDEBUG  -I&#39;/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/Rcpp/include&#39; -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c rowttests.c -o rowttests.o
    clang -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/x86_64/lib -o scalop.so init.o nd.o rowttests.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
    installing to /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/00LOCK-scalop/00new/scalop/libs
    ** R
    ** data
    *** moving datasets to lazyload DB
    ** inst
    ** byte-compile and prepare package for lazy loading
    Warning: replacing previous import ‘AnnotationDbi::select’ by ‘dplyr::select’ when loading ‘scalop’
    ** help
    *** installing help indices
    ** building package indices
    ** installing vignettes
    ** testing if installed package can be loaded from temporary location
    Warning: replacing previous import ‘AnnotationDbi::select’ by ‘dplyr::select’ when loading ‘scalop’
    ** checking absolute paths in shared objects and dynamic libraries
    ** testing if installed package can be loaded from final location
    Warning: replacing previous import ‘AnnotationDbi::select’ by ‘dplyr::select’ when loading ‘scalop’
    ** testing if installed package keeps a record of temporary installation path
    * DONE (scalop)
    Old packages: &#39;matrixStats&#39;
    Update all/some/none? [a/s/n]: 
    a
    trying URL &#39;https://cran.rstudio.com/bin/macosx/big-sur-x86_64/contrib/4.3/matrixStats_0.63.0.tgz&#39;
    Content type &#39;application/x-gzip&#39; length 653132 bytes (637 KB)
    ==================================================
    downloaded 637 KB
    
    
    The downloaded binary packages are in
    	/var/folders/hj/1wvjfb692c3gswybcg8xdcwm0000gn/T//Rtmp6rXv9T/downloaded_packages
    &gt; BiocManager::install(&quot;jlaffy/infercna&quot;)
    &#39;getOption(&quot;repos&quot;)&#39; replaces Bioconductor standard repositories, see &#39;help(&quot;repositories&quot;, package = &quot;BiocManager&quot;)&#39; for details.
    Replacement repositories:
        CRAN: https://cran.rstudio.com/
    Bioconductor version 3.17 (BiocManager 1.30.20), R 4.3.0 (2023-04-21)
    Installing github package(s) &#39;jlaffy/infercna&#39;
    Downloading GitHub repo jlaffy/infercna@HEAD
    ── R CMD build ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    ✔  checking for file ‘/private/var/folders/hj/1wvjfb692c3gswybcg8xdcwm0000gn/T/Rtmp6rXv9T/remotes13287d6716f0/jlaffy-infercna-98a8db8/DESCRIPTION’ ...
    ─  preparing ‘infercna’:
    ✔  checking DESCRIPTION meta-information ...
    ─  checking for LF line-endings in source and make files and shell scripts
    ─  checking for empty or unneeded directories
         NB: this package now depends on R (&gt;= 3.5.0)
         WARNING: Added dependency on R &gt;= 3.5.0 because serialized objects in
         serialize/load version 3 cannot be read in older versions of R.
         File(s) containing such objects:
           ‘infercna/data-raw/genes.rda’
    ─  building ‘infercna_1.0.0.tar.gz’
       
    * installing *source* package ‘infercna’ ...
    ** using staged installation
    ** R
    ** data
    *** moving datasets to lazyload DB
    ** byte-compile and prepare package for lazy loading
    Warning: replacing previous import ‘AnnotationDbi::select’ by ‘dplyr::select’ when loading ‘scalop’
    Note: ... may be used in an incorrect context 
    ** help
    *** installing help indices
    *** copying figures
    ** building package indices
    ** installing vignettes
    ** testing if installed package can be loaded from temporary location
    Warning: replacing previous import ‘AnnotationDbi::select’ by ‘dplyr::select’ when loading ‘scalop’
    ** testing if installed package can be loaded from final location
    Warning: replacing previous import ‘AnnotationDbi::select’ by ‘dplyr::select’ when loading ‘scalop’
    ** testing if installed package keeps a record of temporary installation path
    * DONE (infercna)
    Old packages: &#39;matrixStats&#39;
    Update all/some/none? [a/s/n]: 
    a
    trying URL &#39;https://cran.rstudio.com/bin/macosx/big-sur-x86_64/contrib/4.3/matrixStats_0.63.0.tgz&#39;
    Content type &#39;application/x-gzip&#39; length 653132 bytes (637 KB)
    ==================================================
    downloaded 637 KB
    
    
    The downloaded binary packages are in
    	/var/folders/hj/1wvjfb692c3gswybcg8xdcwm0000gn/T//Rtmp6rXv9T/downloaded_packages

This saves the user from needing to uninstall (or from having to install) important functionality contained in xcode / GCC.

For completeness and context, here is my sessionInfo():

    sessionInfo()
    R version 4.3.0 (2023-04-21)
    Platform: x86_64-apple-darwin20 (64-bit)
    Running under: macOS Big Sur 11.7
    
    Matrix products: default
    BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
    LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0
    
    Random number generation:
     RNG:     Mersenne-Twister 
     Normal:  Inversion 
     Sample:  Rounding 
     
    locale:
    [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
    
    time zone: America/Detroit
    tzcode source: internal
    
    attached base packages:
    [1] stats     graphics  grDevices utils     datasets  methods   base     
    
    loaded via a namespace (and not attached):
     [1] SummarizedExperiment_1.30.1 gtable_0.3.3                ggplot2_3.4.2               htmlwidgets_1.6.2           remotes_2.4.2              
     [6] ggrepel_0.9.3               processx_3.8.1              Biobase_2.60.0              lattice_0.21-8              callr_3.7.3                
    [11] vctrs_0.6.2                 tools_4.3.0                 ps_1.7.5                    bitops_1.0-7                generics_0.1.3             
    [16] stats4_4.3.0                curl_5.0.0                  tibble_3.2.1                fansi_1.0.4                 pkgconfig_2.0.3            
    [21] Matrix_1.5-4.1              data.table_1.14.8           desc_1.4.2                  S4Vectors_0.38.1            lifecycle_1.0.3            
    [26] GenomeInfoDbData_1.2.10     compiler_4.3.0              munsell_0.5.0               GenomeInfoDb_1.36.0         htmltools_0.5.5            
    [31] RCurl_1.98-1.12             lazyeval_0.2.2              plotly_4.10.1               pillar_1.9.0                crayon_1.5.2               
    [36] tidyr_1.3.0                 DelayedArray_0.26.3         tidyselect_1.2.0            locfit_1.5-9.7              digest_0.6.31              
    [41] dplyr_1.1.2                 purrr_1.0.1                 rprojroot_2.0.3             fastmap_1.1.1               grid_4.3.0                 
    [46] colorspace_2.1-0            cli_3.6.1                   magrittr_2.0.3              S4Arrays_1.0.4              pkgbuild_1.4.0             
    [51] utf8_1.2.3                  withr_2.5.0                 prettyunits_1.1.1           scales_1.2.1                XVector_0.40.0             
    [56] httr_1.4.6                  matrixStats_0.63.0          GenomicRanges_1.52.0        IRanges_2.34.0              viridisLite_0.4.2          
    [61] rlang_1.1.1                 Rcpp_1.0.10                 glue_1.6.2                  BiocManager_1.30.20         BiocGenerics_0.46.0        
    [66] rstudioapi_0.14             jsonlite_1.8.4              R6_2.5.1                    MatrixGenerics_1.12.0       zlibbioc_1.46.0   



</details>



huangapple
  • 本文由 发表于 2023年6月2日 12:45:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/76387189.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定