harrelfe / Hmisc

Harrell Miscellaneous
Other
208 stars 81 forks source link

Error in Hmisc installation for R 3.4.3 #82

Open StatsQuo opened 6 years ago

StatsQuo commented 6 years ago

I am getting the following error (in bold text) when using:

install.packages("Hmisc",dependencies = TRUE)

Installing package into ‘C:/Users/user/Documents/R/win-library/3.4’ (as ‘lib’ is unspecified) trying URL 'https://repo.bppt.go.id/cran/bin/windows/contrib/3.4/Hmisc_4.0-3.zip' Content type 'application/zip' length 1792302 bytes (1.7 MB) downloaded 1.7 MB

package ‘Hmisc’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in C:\Users\user\AppData\Local\Temp\RtmpWGOFzV\downloaded_packages

library("Hmisc") Loading required package: lattice Loading required package: survival Loading required package: Formula Error: package or namespace load failed for ‘Hmisc’: .onLoad failed in loadNamespace() for 'checkmate', details: call: loadNamespace(name) error: there is no package called ‘backports’

Thanks in advance!!

harrelfe commented 6 years ago

backports is nowhere mentioned in Hmisc

couthcommander commented 6 years ago

I'm not sure of a fix yet but I can see that Hmisc imports htmlTable, which imports checkmate, which imports backports. backports is on CRAN so I'm not sure why it would fail to install. Maybe you can install it manually before installing Hmisc?

adeslatt commented 6 years ago

Hello -- Hmisc fails to compile for me as well. I manually installed backports as shown above and still had the failure.

backports install was done with R CMD INSTALL backports_1.1.2.tar.gz

Hmisc install was attempted with R CMD INSTALL Hmisc_4.1-1.tar.gz

output was:

* installing *source* package ‘Hmisc’ ...
** package ‘Hmisc’ successfully unpacked and MD5 sums checked
** libs
gcc-7.2 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c Hmisc.c -o Hmisc.o
"gfortran-7.2"   -fPIC  -g -O2  -c cidxcn.f -o cidxcn.o
"gfortran-7.2"   -fPIC  -g -O2  -c cidxcp.f -o cidxcp.o
"gfortran-7.2"   -fPIC  -g -O2  -c hoeffd.f -o hoeffd.o
gcc-7.2 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c init.c -o init.o
"gfortran-7.2"   -fPIC  -g -O2  -c jacklins.f -o jacklins.o
"gfortran-7.2"   -fPIC  -g -O2  -c largrec.f -o largrec.o
gcc-7.2 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c mChoice.c -o mChoice.o
"gfortran-7.2"   -fPIC  -g -O2  -c maxempr.f -o maxempr.o
gcc-7.2 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c nstr.c -o nstr.o
gcc-7.2 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c ranksort.c -o ranksort.o
"gfortran-7.2"   -fPIC  -g -O2  -c rcorr.f -o rcorr.o
gcc-7.2 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c string_box.c -o string_box.o
"gfortran-7.2"   -fPIC  -g -O2  -c wclosest.f -o wclosest.o
gcc-7.2 -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 Hmisc.so Hmisc.o cidxcn.o cidxcp.o hoeffd.o init.o jacklins.o largrec.o mChoice.o maxempr.o nstr.o ranksort.o rcorr.o string_box.o wclosest.o -fopenmp  -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
gcc-7.2: error: : No such file or directory
make: *** [Hmisc.so] Error 1
ERROR: compilation failed for package ‘Hmisc’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Hmisc’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Hmisc’```

starting R to retrieve typical session info:
sessionInfo()
```R version 3.4.3 (2017-11-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: OS X El Capitan 10.11.6

Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

loaded via a namespace (and not attached):
[1] compiler_3.4.3
harrelfe commented 6 years ago

Be sure to work with the package maintainer for htmlTable to resolve this

stuzog commented 6 years ago

Failure to install in RStudio Version 1.1.412 on Intel Mac OS X 10_11_6

> install.packages("Hmisc")
Installing package into ‘/Users/Stuart/Data/Active/Technology/Data mining/Data Mining books/R Data Mining/packrat/lib/x86_64-apple-darwin15.6.0/3.4.3’
(as ‘lib’ is unspecified)

  There is a binary version available but the source version is later:
      binary source needs_compilation
Hmisc  4.1-0  4.1-1              TRUE

Do you want to install from sources the package which needs compilation?
y/n: n
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/Hmisc_4.1-0.tgz'
Content type 'application/x-gzip' length 1797119 bytes (1.7 MB)
==================================================
downloaded 1.7 MB

The downloaded binary packages are in
    /var/folders/qt/6jh4c4yn5zdbf07t61nmz0_w0000gn/T//RtmpFxsV2A/downloaded_packages
> 
> install.packages("Hmisc")
Installing package into ‘/Users/Stuart/Data/Active/Technology/Data mining/Data Mining books/R Data Mining/packrat/lib/x86_64-apple-darwin15.6.0/3.4.3’
(as ‘lib’ is unspecified)

  There is a binary version available but the source version is later:
      binary source needs_compilation
Hmisc  4.1-0  4.1-1              TRUE

Do you want to install from sources the package which needs compilation?
y/n: y
installing the source package ‘Hmisc’

trying URL 'https://cran.rstudio.com/src/contrib/Hmisc_4.1-1.tar.gz'
Content type 'application/x-gzip' length 711786 bytes (695 KB)
==================================================
downloaded 695 KB

* installing *source* package ‘Hmisc’ ...
** package ‘Hmisc’ successfully unpacked and MD5 sums checked
** libs
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c Hmisc.c -o Hmisc.o
gfortran   -fPIC  -g -O2  -c cidxcn.f -o cidxcn.o
gfortran   -fPIC  -g -O2  -c cidxcp.f -o cidxcp.o
gfortran   -fPIC  -g -O2  -c hoeffd.f -o hoeffd.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c init.c -o init.o
gfortran   -fPIC  -g -O2  -c jacklins.f -o jacklins.o
gfortran   -fPIC  -g -O2  -c largrec.f -o largrec.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c mChoice.c -o mChoice.o
gfortran   -fPIC  -g -O2  -c maxempr.f -o maxempr.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c nstr.c -o nstr.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c ranksort.c -o ranksort.o
gfortran   -fPIC  -g -O2  -c rcorr.f -o rcorr.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c string_box.c -o string_box.o
gfortran   -fPIC  -g -O2  -c wclosest.f -o wclosest.o
clang -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 Hmisc.so Hmisc.o cidxcn.o cidxcp.o hoeffd.o init.o jacklins.o largrec.o mChoice.o maxempr.o nstr.o ranksort.o rcorr.o string_box.o wclosest.o -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.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: *** [Hmisc.so] Error 1
ERROR: compilation failed for package ‘Hmisc’
* removing ‘/Users/Stuart/Data/Active/Technology/Data mining/Data Mining books/R Data Mining/packrat/lib/x86_64-apple-darwin15.6.0/3.4.3/Hmisc’
* restoring previous ‘/Users/Stuart/Data/Active/Technology/Data mining/Data Mining books/R Data Mining/packrat/lib/x86_64-apple-darwin15.6.0/3.4.3/Hmisc’
Warning in install.packages :
  installation of package ‘Hmisc’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/qt/6jh4c4yn5zdbf07t61nmz0_w0000gn/T/RtmpFxsV2A/downloaded_packages’
harrelfe commented 6 years ago

I'll look for a Mac user to give us the general solution. This problem is not occuring on linux or windows to my knowledge.

StatsQuo commented 6 years ago

No. I have this problems in Windows too.

On Jan 23, 2018 17:45, "Frank Harrell" notifications@github.com wrote:

I'll look for a Mac user to give us the general solution. This problem is not occuring on linux or windows to my knowledge.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/harrelfe/Hmisc/issues/82#issuecomment-359772607, or mute the thread https://github.com/notifications/unsubscribe-auth/AhEQlmpkvpoek6zUIFvhyTzN0tfQ7KMuks5tNc1TgaJpZM4RGgXK .

couthcommander commented 6 years ago

I believe @adeslatt and @stuzog (Mac users) are encountering a different installation problem than @StatsQuo. I am able to install Hmisc 4.1-1 source on macos sierra (10.12.6). My best guess is that the Mac users should try re-installing gfortran. I installed mine from https://gcc.gnu.org/wiki/GFortranBinaries (which is referenced https://cran.r-project.org/bin/macosx/tools/). Also, see https://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html#Installation-of-source-packages, which references the file /Library/Frameworks/R.framework/Resources/etc/Makeconf. There's a flag labelled FLIBS in this file - do the libraries listed here exist on your system?

couthcommander commented 6 years ago

@StatsQuo Were you able to manually install backports? What error messages do you receive now?

stuzog commented 6 years ago

Since updating RStudio to 1.1.414 Hmisc 4.1-1 now installs from CRAN. And yes, the file /Library/Frameworks/R.framework/Resources/etc/Makeconf does exist on the system, including the flag FLIBS:

FLIBS = -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm

Thanks @couthcommander for your response. Whatever bug seems to have been resolved in the RStudio update.

adeslatt commented 6 years ago

Thanks @couthcommander, I did as you recommended.

I used Homebrew to reinstall gcc

brew update brew install gcc

I checked /Library/Frameworks/R.framework/Resources/etc/Makeconf the FLIBS flag was as you stated.

then within R

biocLite() biocLite('Hmisc")

seemingly succeeded then library(Hmisc)

failed with this error Error in value[[3L]](cond) : Package 'Hmisc' version 4.0.3 cannot be unloaded: Error in unloadNamespace(package) : namespace 'Hmisc' is imported by 'biovizBase' so cannot be unloaded

I did as one might guess biocLite("biovizBase") library(biovizBase)

succeeded.

I am able now to compile Hmisc But its instantiation with the library command fails.

couthcommander commented 6 years ago

@adeslatt I'm not familiar with Bioconductor at all. If you start a new R session without bioconductor loaded, I assume you can load Hmisc successfully?

adeslatt commented 6 years ago

@couthcommander -- you are correct! Interesting. Wonder what the conflict was -- but it is now fixed in that Hmisc compiled.

As an aside, in the world of biological sequence data and the need to analyze, bioconductor is a means by which to get that job done and to scale efficiently. Biological data is diverse and not always consistent, bioconductor is an organized structure of creating systematic tools and enabling the researcher to efficiently get all annotations associated with known or orthologous genomes....! this is a website that can give you an introduction if you are interested.

https://www.bioconductor.org/help/course-materials/2016/BiocIntro-May/

Thank you for your help!

harrelfe commented 6 years ago

Does anyone have suggestions for how the other packages can be permanently fixed to avoid these problems? I haven't seen anything that would suggest Hmisc is at fault.

sarakyeo commented 6 years ago

I am a relatively new R user and am attempting to use rcorr (in Hmisc package for correlation matrix with p-values). I'm using RStudio Version 1.1.423 on Windows 10. Unfortunately, I am having problems installing Hmisc:

Installing package into ‘C:/Users/SaraK/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
also installing the dependency ‘htmlTable’

  There are binary versions available but the source versions are later:
          binary source needs_compilation
htmlTable    1.9 1.11.2             FALSE
Hmisc      4.0-2  4.1-1              TRUE

  Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/Hmisc_4.0-2.zip'
Content type 'application/zip' length 1785229 bytes (1.7 MB)
downloaded 1.7 MB

package ‘Hmisc’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\SaraK\AppData\Local\Temp\RtmpgNl5iF\downloaded_packages
installing the source package ‘htmlTable’

trying URL 'https://cran.rstudio.com/src/contrib/htmlTable_1.11.2.tar.gz'
Content type 'application/x-gzip' length 370185 bytes (361 KB)
downloaded 361 KB

* installing *source* package 'htmlTable' ...
** package 'htmlTable' successfully unpacked and MD5 sums checked
** R
** data
** inst
** preparing package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  there is no package called 'backports'
ERROR: lazy loading failed for package 'htmlTable'
* removing 'C:/Users/SaraK/Documents/R/win-library/3.2/htmlTable'
Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-32~1.5/bin/x64/R" CMD INSTALL -l "C:\Users\SaraK\Documents\R\win-library\3.2" C:\Users\SaraK\AppData\Local\Temp\RtmpgNl5iF/downloaded_packages/htmlTable_1.11.2.tar.gz' had status 1
Warning in install.packages :
  installation of package ‘htmlTable’ had non-zero exit status

The downloaded source packages are in
    ‘C:\Users\SaraK\AppData\Local\Temp\RtmpgNl5iF\downloaded_packages’

@couthcommander: I tried to manually install backports, but received the following error:

Installing package into ‘C:/Users/SaraK/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)

  There is a binary version available but the source version is later:
          binary source needs_compilation
backports  1.0.5  1.1.2             FALSE

installing the source package ‘backports’

trying URL 'https://cran.rstudio.com/src/contrib/backports_1.1.2.tar.gz'
Content type 'application/x-gzip' length 10900 bytes (10 KB)
downloaded 10 KB

* installing *source* package 'backports' ...
** package 'backports' successfully unpacked and MD5 sums checked
** libs

*** arch - i386
Warning: running command 'make -f "C:/PROGRA~1/R/R-32~1.5/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-32~1.5/share/make/winshlib.mk" SHLIB="backports.dll" OBJECTS="dotsElt.o dotsLength.o init.o"' had status 127
ERROR: compilation failed for package 'backports'
* removing 'C:/Users/SaraK/Documents/R/win-library/3.2/backports'
Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-32~1.5/bin/x64/R" CMD INSTALL -l "C:\Users\SaraK\Documents\R\win-library\3.2" C:\Users\SaraK\AppData\Local\Temp\RtmpgNl5iF/downloaded_packages/backports_1.1.2.tar.gz' had status 1
Warning in install.packages :
  installation of package ‘backports’ had non-zero exit status

The downloaded source packages are in
    ‘C:\Users\SaraK\AppData\Local\Temp\RtmpgNl5iF\downloaded_packages’

Any help would be appreciated, thanks.

[UPDATE] A bit more searching led me to a solution: Manually install an older version of backports. Hmisc compiled just fine for me after that.

Shreyansh-Sheth-31 commented 3 years ago

Manually download .zip file from https://cran.r-project.org/web/packages/backports/index.html Paste the folder in the library folder of R.

Now, type in console:

library(backports) library(hmisc)

RealCoChenchao commented 3 years ago

Tried solutions above and did not work for me. This manually install helped me out. https://github.com/tidyverts/fable/issues/107

jwisse commented 3 years ago

This may have been resolved in some of the R updates since this was originally posted. I couldn't get the solutions above to work, but the problem resolved when I updated to R 4.1.1

y3rawat commented 2 years ago

I'll look for a Mac user to give us the general solution. This problem is not occuring on linux or windows to my knowledge.

./inst/include/Eigen/src/Core/CoreEvaluators.h:989:54: warning: ignoring attributes on template argument ‘Eigen::internal::packet_traits::type’ {aka ‘__m128d’} [-Wignored-attributes] gcc -I"/usr/share/R/include" -DNDEBUG -I'/home/yash/R/x86_64-pc-linux-gnu-library/4.2/Rcpp/include' -fpic -g -O2 -ffile-prefix-map=/build/r-base-wSz8CH/r-base-4.2.1=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c init.c -o init.o g++ -std=gnu++14 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -o RcppEigen.so RcppEigen.o RcppExports.o fastLm.o init.o -llapack -lblas -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR /usr/bin/ld: cannot find -llapack: No such file or directory /usr/bin/ld: cannot find -lblas: No such file or directory collect2: error: ld returned 1 exit status make: *** [/usr/share/R/share/make/shlib.mk:10: RcppEigen.so] Error 1 ERROR: compilation failed for package ‘RcppEigen’

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

it also happens in Linux

couthcommander commented 2 years ago

@ysh-rawat-11 Your underlying problem are the packages "RcppEigen" and "jpeg". Install the development files for liblapack, libblas, and libjpeg. If you were on a Debian based system you could run sudo apt install libjpeg-dev liblapack-dev libblas-dev.

Once those are installed, try install.packages(c('RcppEigen','jpeg')) from R. If they successfully install, try "Hmisc" again.