satijalab / sctransform

R package for modeling single cell UMI expression data using regularized negative binomial regression
GNU General Public License v3.0
203 stars 33 forks source link

failed install of sctransform 0.3.5, but successful install of 0.3 #188

Closed bpyenson closed 3 months ago

bpyenson commented 3 months ago

Hi,

Following advice here, https://github.com/satijalab/seurat-object/issues/165

In RStudio, I am trying to install an earlier version of sctransform 0.3.5. to replicate analyses with an earlier version of Seurat (Seurat 4.2.0 and SeuratObject 4.1.3).

Specifically, I have tried this step that fails to install sctransform 0.3.5, but instead installs the most recent version:

if (!requireNamespace("remotes", quietly = TRUE)) { install.packages("remotes") } options(repos = c("https://satijalab.r-universe.dev", getOption("repos")))

remotes::install_version("sctransform", "0.3.5", repos = c("https://satijalab.r-universe.dev", getOption("repos")))

Instead, this step installs version 0.3, though. install.packages('sctransform', version = '0.3')

Can you clarify why this might be happening?

saketkc commented 3 months ago

Hi @bpyenson, I can install v0.3.5. using remotes (probably the extra repos confuses remotes):

> remotes::install_version("sctransform", "0.3.5")
Downloading package from url: https://cran.rstudio.com//src/contrib/Archive/sctransform/sctransform_0.3.5.tar.gz
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: RcppArmad... (0.12.8.1.0 -> 0.12.8.2.0) [CRAN]

Enter one or more numbers, or an empty line to skip updates: 3
Installing package into ‘/opt/homebrew/lib/R/4.3/site-library’
(as ‘lib’ is unspecified)
* installing *source* package ‘sctransform’ ...
** package ‘sctransform’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
using C++ compiler: ‘Apple clang version 15.0.0 (clang-1500.3.9.4)’
using C++11
using SDK: ‘MacOSX14.4.sdk’
clang++ -std=gnu++11 -I"/opt/homebrew/Cellar/r/4.3.3/lib/R/include" -DNDEBUG  -I'/opt/homebrew/lib/R/4.3/site-library/RcppArmadillo/include' -I'/opt/homebrew/lib/R/4.3/site-library/Rcpp/include' -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include    -fPIC  -g -O2  -c RcppExports.cpp -o RcppExports.o
clang++ -std=gnu++11 -I"/opt/homebrew/Cellar/r/4.3.3/lib/R/include" -DNDEBUG  -I'/opt/homebrew/lib/R/4.3/site-library/RcppArmadillo/include' -I'/opt/homebrew/lib/R/4.3/site-library/Rcpp/include' -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include    -fPIC  -g -O2  -c utils.cpp -o utils.o
clang++ -std=gnu++11 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/opt/homebrew/Cellar/r/4.3.3/lib/R/lib -L/opt/homebrew/opt/gettext/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/xz/lib -L/opt/homebrew/lib -o sctransform.so RcppExports.o utils.o -L/opt/homebrew/Cellar/r/4.3.3/lib/R/lib -lRlapack -L/opt/homebrew/opt/openblas/lib -lopenblas -L/opt/homebrew/opt/gcc/lib/gcc/current/gcc/aarch64-apple-darwin23/13 -L/opt/homebrew/opt/gcc/lib/gcc/current/gcc -L/opt/homebrew/opt/gcc/lib/gcc/current -lgfortran -lemutls_w -lquadmath -L/opt/homebrew/Cellar/r/4.3.3/lib/R/lib -lR -lintl -Wl,-framework -Wl,CoreFoundation
installing to /opt/homebrew/lib/R/4.3/site-library/00LOCK-sctransform/00new/sctransform/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** 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
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (sctransform)
bpyenson commented 3 months ago

Hi Satijalab/Sctransform,

Thank you for the timely reply! I have the same version R and also the same MacOSX as you, so your output was quite informative.

The fundamental issue seemed to be that I did not have gfortran installed on my computer.

For others who encounter this issue, one must follow the instructions here https://stackoverflow.com/questions/77836548/library-gfortran-not-found-when-installing-r-packages .

After installing gfortran-12.2-universal.pkg https://mac.r-project.org/tools/gfortran-12.2-universal.pkg I was able to successfully install sctransform 0.3.5 using the code you mention above.

Unfortunately, however, I cannot install Seurat version 4.2.3 or 4.2.2. but I can install Seurat version 4.2.1. Specifically, these do not work:

remotes::install_version("Seurat", "4.2.3", upgrade = FALSE) # remotes will try to upgrade SeuratObject to v5, we need to tell it no Error in download_version_url(package, version, repos, type) : version '4.2.3' is invalid for package 'Seurat' remotes::install_version("Seurat", "4.2.2", upgrade = FALSE) # remotes will try to upgrade SeuratObject to v5, we need to tell it no Error in download_version_url(package, version, repos, type) : version '4.2.2' is invalid for package 'Seurat' But, this works: remotes::install_version("Seurat", "4.2.1", upgrade = FALSE) # remotes will try to upgrade SeuratObject to v5, we need to tell it no

Can you clarify why this might be the case?

On Wed, Apr 10, 2024 at 1:06 PM Saket Choudhary @.***> wrote:

Hi @bpyenson https://github.com/bpyenson, I can install v0.3.5. using remotes (probably the extra repos confuses remotes):

remotes::install_version("sctransform", "0.3.5")Downloading package from url: https://cran.rstudio.com//src/contrib/Archive/sctransform/sctransform_0.3.5.tar.gzThese 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: RcppArmad... (0.12.8.1.0 -> 0.12.8.2.0) [CRAN] Enter one or more numbers, or an empty line to skip updates: 3Installing package into ‘/opt/homebrew/lib/R/4.3/site-library’ (as ‘lib’ is unspecified) installing source package ‘sctransform’ ... package ‘sctransform’ successfully unpacked and MD5 sums checked using staged installation libsusing C++ compiler: ‘Apple clang version 15.0.0 (clang-1500.3.9.4)’using C++11using SDK: ‘MacOSX14.4.sdk’clang++ -std=gnu++11 -I"/opt/homebrew/Cellar/r/4.3.3/lib/R/include" -DNDEBUG -I'/opt/homebrew/lib/R/4.3/site-library/RcppArmadillo/include' -I'/opt/homebrew/lib/R/4.3/site-library/Rcpp/include' -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include -fPIC -g -O2 -c RcppExports.cpp -o RcppExports.oclang++ -std=gnu++11 -I"/opt/homebrew/Cellar/r/4.3.3/lib/R/include" -DNDEBUG -I'/opt/homebrew/lib/R/4.3/site-library/RcppArmadillo/include' -I'/opt/homebrew/lib/R/4.3/site-library/Rcpp/include' -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include -fPIC -g -O2 -c utils.cpp -o utils.oclang++ -std=gnu++11 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/opt/homebrew/Cellar/r/4.3.3/lib/R/lib -L/opt/homebrew/opt/gettext/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/xz/lib -L/opt/homebrew/lib -o sctransform.so RcppExports.o utils.o -L/opt/homebrew/Cellar/r/4.3.3/lib/R/lib -lRlapack -L/opt/homebrew/opt/openblas/lib -lopenblas -L/opt/homebrew/opt/gcc/lib/gcc/current/gcc/aarch64-apple-darwin23/13 -L/opt/homebrew/opt/gcc/lib/gcc/current/gcc -L/opt/homebrew/opt/gcc/lib/gcc/current -lgfortran -lemutls_w -lquadmath -L/opt/homebrew/Cellar/r/4.3.3/lib/R/lib -lR -lintl -Wl,-framework -Wl,CoreFoundationinstalling to /opt/homebrew/lib/R/4.3/site-library/00LOCK-sctransform/00new/sctransform/libs R data moving datasets to lazyload DB inst 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 checking absolute paths in shared objects and dynamic libraries testing if installed package can be loaded from final location testing if installed package keeps a record of temporary installation path DONE (sctransform)

— Reply to this email directly, view it on GitHub https://github.com/satijalab/sctransform/issues/188#issuecomment-2048066298, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWIV5PUX32VMIJHJX47XQBLY4VWQLAVCNFSM6AAAAABGA2HUFWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBYGA3DMMRZHA . You are receiving this because you were mentioned.Message ID: @.***>

--

Ben Pyenson, PhD Preferred pronouns (he/him/his) Postdoctoral Fellow Sandra Rehan Lab, York University Toronto, Ontario, Canada

saketkc commented 3 months ago

I am not sure but if you open an issue on Seurat repo, someone from the team might be able to answer. A general trick is to remove the packages first (remove.packages(c("Seurat", "SeuratObject")) and restart your session before doing a version install.

bpyenson commented 3 months ago

Hi again,

My mistake! There never was a Seurat v. 4.2.3. I confused it with a version of R* I was using at the time.

Instead, I was using Seurat 4.3.0, which works fine with the installation of gfortran as described above. Thanks again for your rapid help!

On Wed, Apr 10, 2024 at 2:25 PM Saket Choudhary @.***> wrote:

I am not sure but if you open an issue on Seurat repo, someone from the team might be able to answer. A general trick is to remove the packages first (remove.packages(c("Seurat", "SeuratObject")) and restart your session before doing a version install.

— Reply to this email directly, view it on GitHub https://github.com/satijalab/sctransform/issues/188#issuecomment-2048195059, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWIV5PWTTYHU3QOSP2ABTV3Y4V72DAVCNFSM6AAAAABGA2HUFWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBYGE4TKMBVHE . You are receiving this because you were mentioned.Message ID: @.***>

--

Ben Pyenson, PhD Preferred pronouns (he/him/his) Postdoctoral Fellow Sandra Rehan Lab, York University Toronto, Ontario, Canada