immunogenomics / harmony

Fast, sensitive and accurate integration of single-cell data with Harmony
https://portals.broadinstitute.org/harmony/
Other
512 stars 98 forks source link

Error in Installing Harmony in Rstudio #113

Open aimer-entropy opened 3 years ago

aimer-entropy commented 3 years ago

Hello, I'm trying to install harmony through these two ways: library(devtools) install_github("immunogenomics/harmony") install_local('mypathway/harmony-master.zip') While all these two way to install this package failed. I'm using Rstuidio 4.0.2 on maxOS Catalina Version 10.15.

Here's the information when I failed to install.

julia-kraus commented 3 years ago

I have the same problem installing the forecast package on MacOs Big Sur.

dannyconrad commented 3 years ago

@aimer-entropy @julia-kraus

Check your version of RcppArmadillo using RcppArmadillo::armadillo_version(single = F)

If your version is 10.1.0, this is the reason. Try installing an older version of RcppArmadillo, as suggested in the warning messages. Version 9.900.3 worked for me:

packageurl <- "https://cran.r-project.org/src/contrib/Archive/RcppArmadillo/RcppArmadillo_0.9.900.3.0.tar.gz"
install.packages(packageurl, repos=NULL, type="source")

Make sure to either restart R or detach and re-load the package in order to confirm the new version is being used.

If you need to, it is probably fine to update back to the newer version after you finish installing your package (forecast or Harmony), since compilation should only need to happen once.

Yunxiu123 commented 3 years ago

@aimer-entropy @julia-kraus

Check your version of RcppArmadillo using RcppArmadillo::armadillo_version(single = F)

If your version is 10.1.0, this is the reason. Try installing an older version of RcppArmadillo, as suggested in the warning messages. Version 9.900.3 worked for me:

packageurl <- "https://cran.r-project.org/src/contrib/Archive/RcppArmadillo/RcppArmadillo_0.9.900.3.0.tar.gz"
install.packages(packageurl, repos=NULL, type="source")

Make sure to either restart R or detach and re-load the package in order to confirm the new version is being used.

If you need to, it is probably fine to update back to the newer version after you finish installing your package (forecast or Harmony), since compilation should only need to happen once.

Thanks a lot. This works fine to me with the same installation problems.

kengel001 commented 3 years ago

@aimer-entropy @julia-kraus

I had the exact same issue that the above install of an older RcppArmadillo corrected. However, I'll add a nuance here. I tried the default harmony install on two separate machines. They both had RcppArmadillo 10.1.2, it worked on one and not on the other. They both have the same version of gcc, but I suspect that there was an issue with the one it did not work on with the correct compiler being defaulted to by R. Or perhaps it's a clang version issue?

And yes, defaulting back to the updated version of RccpArmadillo after install worked just fine.

JarvanDi commented 3 years ago

@aimer-entropy @julia-kraus

Check your version of RcppArmadillo using RcppArmadillo::armadillo_version(single = F)

If your version is 10.1.0, this is the reason. Try installing an older version of RcppArmadillo, as suggested in the warning messages. Version 9.900.3 worked for me:

packageurl <- "https://cran.r-project.org/src/contrib/Archive/RcppArmadillo/RcppArmadillo_0.9.900.3.0.tar.gz"
install.packages(packageurl, repos=NULL, type="source")

Make sure to either restart R or detach and re-load the package in order to confirm the new version is being used.

If you need to, it is probably fine to update back to the newer version after you finish installing your package (forecast or Harmony), since compilation should only need to happen once.

Thanks,it really works.

ostkampp commented 3 years ago

I had a similar Issue on macOS 11.1 Big Sur and couldn't get the Armadillo downgrade working. I then followed the error code which tells you to enable C++11 compiling mode. Following this tutorials https://gallery.rcpp.org/articles/first-steps-with-C++11/ first line of code did the trick for me:

Sys.setenv("PKG_CXXFLAGS"="-std=c++11")

elva0328 commented 3 years ago

@pseudonym2 thank you so much, your advice did works.

dportelacassab commented 3 years ago

I get this problem after trying to compile a simple method including RcppArmadillo.h I'm on a mac os Big sure, any help, please.

In file included from trying.cpp:4: In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include/RcppArmadillo.h:34: In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/Rcpp.h:57: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/Rcpp/DataFrame.h:136:18: warning: unused variable 'data' [-Wunused-variable] SEXP data = Parent::get__(); ^ 1 warning generated. ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0' ld: warning: directory not found for option '-L/usr/local/gfortran/lib' ld: library not found for -lgfortran clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [sourceCpp_24.so] Error 1 clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include" -I"/Applications/Diego Alejandro/2021-2 (Internship)/c++Projects/src1" -I/usr/local/include -std=c++11 -fPIC -Wall -g -O2 -c trying.cpp -o trying.o clang++ -mmacosx-version-min=10.13 -std=gnu++11 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o sourceCpp_24.so trying.o -L/Library/Frameworks/R.framework/Resources/lib -lRlapack -L/Library/Frameworks/R.framework/Resources/lib -lRblas -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation Error in Rcpp::sourceCpp("/Applications/Diego Alejandro/2021-2 (Internship)/c++Projects/src1/trying.cpp") : Error 1 occurred building shared library.

ilyakorsunsky commented 3 years ago

Dear all,

Harmony is now available on CRAN! Please try to install through install.packages("harmony"). I hope this makes the process more painless and you can get back to your analyses faster.

Cheers, Ilya