1

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("jlaffy/infercna")

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 (>= 3.5.0)
     WARNING: Added dependency on R >= 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 <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  there is no package called ‘scalop’
Calls: <Anonymous> ... loadNamespace -> withRestarts -> withOneRestart -> 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("jlaffy/scalop")

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"/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’
* 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.

Vincent Laufer
  • 705
  • 10
  • 26
  • 1
    It's a bit of a guess, but in the [NEWS](https://cran.r-project.org/doc/manuals/r-release/NEWS.pdf) for R 4.3, on page 20 it says: > The header ‘S.h’ which has been unsupported since Jan 2016 has been removed. Use ‘R.h’ instead. In [scalop.h](https://github.com/jlaffy/scalop/blob/master/src/scalop.h) it still includes this reference. So I would think that downgrading to 4.2 might fix the issue, or you could fork the repo and try editing the reference (but, that might require other edits). – Taren Sanders Jun 02 '23 at 05:51
  • Thank you Taren. This will be helpful to lots who navigate here – Vincent Laufer Jun 02 '23 at 12:44

2 Answers2

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 :(

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("BiocManager")
library(BiocManager)
BiocManager::install("Homo.sapiens")
BiocManager::install("jpmam1/scalop") # my forked copy
BiocManager::install("jlaffy/infercna")

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

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


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

Created on 2023-06-02 with reprex v2.0.2

jared_mamrot
  • 22,354
  • 4
  • 21
  • 46
  • WOOOWWWWWW. THANK YOU! Terrific answer. Will work through this and report back. thank you so much for your time. – Vincent Laufer Jun 02 '23 at 11:59
  • For context on differences between namespace and attach (referred to in Jared's answer), please see: https://stackoverflow.com/questions/14988722/in-r-what-does-loaded-via-a-namespace-and-not-attached-mean – Vincent Laufer Jun 02 '23 at 12:32
1

All - because in jared'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("jlaffy/infercna")

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

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

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

BiocManager::install("Homo.sapiens")
'getOption("repos")' replaces Bioconductor standard repositories, see 'help("repositories", package = "BiocManager")' 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) 'Homo.sapiens'
also installing the dependencies ‘graph’, ‘RBGL’, ‘OrganismDbi’

trying URL 'https://bioconductor.org/packages/3.17/bioc/bin/macosx/big-sur-x86_64/contrib/4.3/graph_1.78.0.tgz'
Content type 'application/x-gzip' length 2086473 bytes (2.0 MB)
==================================================
downloaded 2.0 MB

trying URL 'https://bioconductor.org/packages/3.17/bioc/bin/macosx/big-sur-x86_64/contrib/4.3/RBGL_1.76.0.tgz'
Content type 'application/x-gzip' length 3547879 bytes (3.4 MB)
==================================================
downloaded 3.4 MB

trying URL 'https://bioconductor.org/packages/3.17/bioc/bin/macosx/big-sur-x86_64/contrib/4.3/OrganismDbi_1.42.0.tgz'
Content type 'application/x-gzip' 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 'https://bioconductor.org/packages/3.17/data/annotation/src/contrib/Homo.sapiens_1.3.1.tar.gz'
Content type 'application/x-gzip' 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: 'matrixStats'
Update all/some/none? [a/s/n]: BiocManager::install("jpmam1/scalop")
Update all/some/none? [a/s/n]: 
a
trying URL 'https://cran.rstudio.com/bin/macosx/big-sur-x86_64/contrib/4.3/matrixStats_0.63.0.tgz'
Content type 'application/x-gzip' length 653132 bytes (637 KB)
==================================================
downloaded 637 KB


The downloaded binary packages are in
    /var/folders/hj/1wvjfb692c3gswybcg8xdcwm0000gn/T//Rtmp6rXv9T/downloaded_packages
> BiocManager::install("jpmam1/scalop")
'getOption("repos")' replaces Bioconductor standard repositories, see 'help("repositories", package = "BiocManager")' 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) 'jpmam1/scalop'
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 -> 1.0.0) [CRAN]

Enter one or more numbers, or an empty line to skip updates: 1
matrixStats (0.63.0 -> 1.0.0) [CRAN]
Installing 1 packages: matrixStats
trying URL 'https://cran.rstudio.com/bin/macosx/big-sur-x86_64/contrib/4.3/matrixStats_0.63.0.tgz'
Content type 'application/x-gzip' 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"/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
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 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: 'matrixStats'
Update all/some/none? [a/s/n]: 
a
trying URL 'https://cran.rstudio.com/bin/macosx/big-sur-x86_64/contrib/4.3/matrixStats_0.63.0.tgz'
Content type 'application/x-gzip' length 653132 bytes (637 KB)
==================================================
downloaded 637 KB


The downloaded binary packages are in
    /var/folders/hj/1wvjfb692c3gswybcg8xdcwm0000gn/T//Rtmp6rXv9T/downloaded_packages
> BiocManager::install("jlaffy/infercna")
'getOption("repos")' replaces Bioconductor standard repositories, see 'help("repositories", package = "BiocManager")' 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) 'jlaffy/infercna'
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 (>= 3.5.0)
     WARNING: Added dependency on R >= 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: 'matrixStats'
Update all/some/none? [a/s/n]: 
a
trying URL 'https://cran.rstudio.com/bin/macosx/big-sur-x86_64/contrib/4.3/matrixStats_0.63.0.tgz'
Content type 'application/x-gzip' 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   
Vincent Laufer
  • 705
  • 10
  • 26
  • 1
    Super frustrating problem, but I'm glad you got it sorted :) – jared_mamrot Jun 02 '23 at 22:09
  • It actually wasn't jared, but, that's entirely thanks to you. thank you so much for your help. – Vincent Laufer Jun 03 '23 at 07:48
  • Jared - a quick observation - I wonder if the decision not to reinstall GCC will create fewer failures/compatiblity issues down the road (like what you note above). As a corollary, this experience really leaves me wondering what the differences in the installation process that are implied by devtools::install_github() contra BiocManager::install(). in other words, what parts of the solution depend on your fork, versus what parts (if any) depend on use of BiocManager() – Vincent Laufer Jun 03 '23 at 07:49
  • 1
    I use gcc to enable openMP multithreading. I use data.table a lot and you get much better performance with openMP. You can also use llvm + openMP, but I found fewer 'edge case' failures compiling packages with gcc + openMP, so that's what I use. 'reinstall gcc' is just to get the most up-to-date version. The reason I used bioconductor to install the packages is that it adds a layer of 'dependency resolving' and when you have ~100 dependencies there might be some 'clashes' that BiocManager::install() will handle. It might not be necessary here, but it's helped me in the past. – jared_mamrot Jun 04 '23 at 01:06
  • 1
    For the last part of your question ("what parts of the solution depend on your fork, versus what parts (if any) depend on use of BiocManager()") it's almost certainly the fork that fixed the installation problem. Using bioconductor with bioinformatics software is good practice, but it may or may not have helped - I didn't want to spend more time than necessary on this though, so I went with the 'most likely' route to get the job done :) – jared_mamrot Jun 04 '23 at 01:08
  • copy all of that. Thanks again, jared. – Vincent Laufer Jun 05 '23 at 16:46