Irstea / chocR

Other
5 stars 0 forks source link

Error: Failed to install 'chocR' from GitHub on Mac #1

Open Otoliths opened 3 years ago

Otoliths commented 3 years ago

Hi Irstea, I encountered a bug installing the 'chocR' package on a Mac system. I guess it was due to a dependency on the package robustbase update. I'm looking forward to fixing the bug.

devtools::install_github("Irstea/chocR",build=TRUE,build_opts = c("--no-resave-data","--no-manual"),build_vignettes = TRUE)

ERROR: package installation failed Error: Failed to install 'chocR' from GitHub: System command 'R' failed, exit status: 1, stdout + stderr (last 10 lines): E> In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/Rcpp.h:57: E> /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/Rcpp/DataFrame.h:136:18: warning: unused variable 'data' [-Wunused-variable] E> SEXP data = Parent::get__(); E> ^ E> 15 warnings and 14 errors generated. E> make: ** [RcppExports.o] Error 1 E> ERROR: compilation failed for package ‘chocR’ E> removing ‘/private/var/folders/1x/5mjvgdgx0m754gnfv6_dyxqm0000gn/T/RtmphFtMIc/Rinste5ae19e1cbf2/chocR’ E> ----------------------------------- E> ERROR: package installation failed

elfunesto commented 3 years ago

Hi, Sorry, I don't have any mac to make tests so difficult to answer precisely since the error message is not very explicit. Do you have Rcpp package? Hilaire

elfunesto commented 3 years ago

Hi again, Can you give me details about your specifications? R version? are you using Rstudio? MacOs version? IYou error message is weird, don't you have a longer version of the message? Might be related to that issue https://github.com/rstudio/rstudio/issues/8800 since the package is based on RcppArmadillo.

Otoliths commented 3 years ago

Hi again, Can you give me details about your specifications? R version? are you using Rstudio? MacOs version? IYou error message is weird, don't you have a longer version of the message? Might be related to that issue rstudio/rstudio#8800 since the package is based on RcppArmadillo.

Hi elfunesto,

Thank you very much for your prompt reply. I found the installtation failed with error message via devtools::check() in chocR source package, the error message is as follows:

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: warning: directory not found for option
'-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0’

ld: library not found for -lgfortran

For MacOS system, there maybe "-lgfortran" and "-lquadmath" errors because of the use of Rcpp, RcppArmadillo. This website offers the solution: http://thecoatlessprofessor.com/programming/rcpp-rcpparmadillo-and-os-x-mavericks-lgfortran-and-lquadmath-error/ And then, all one needs to do is run the downloaded installer gfortran-6.1.pkg from https://cran.r-project.org/bin/macosx/tools/ and rejoice!

Finally, the chocR package was installed successfully. But there was one ERROR via devtools::check_built() again. I've already installed package 'Rcpp'.

the check.log is as follows:

* using log directory ‘/Users/yong/Downloads/chocR.Rcheck’
* using R version 4.0.5 (2021-03-31)
* using platform: x86_64-apple-darwin17.0 (64-bit)
* using session charset: UTF-8
* using options ‘--no-manual --as-cran’
* checking for file ‘chocR/DESCRIPTION’ ... OK
* this is package ‘chocR’ version ‘1.0.0’
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘chocR’ can be installed ... OK
* checking installed package size ... OK
* checking package directory ... OK
* checking for future file timestamps ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd line widths ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking contents of ‘data’ directory ... OK
* checking data for non-ASCII characters ... OK
* checking data for ASCII and uncompressed saves ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking line endings in Makefiles ... OK
* checking compilation flags in Makevars ... OK
* checking for GNU extensions in Makefiles ... OK
* checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK
* checking use of PKG_*FLAGS in Makefiles ... OK
* checking use of SHLIB_OPENMP_*FLAGS in Makefiles ... OK
* checking pragmas in C/C++ headers and code ... OK
* checking compilation flags used ... OK
* checking compiled code ... OK
* checking installed files from ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... ERROR
Running examples in ‘chocR-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: choc
> ### Title: choc carry out a choc analysis on a multivariate time series
> ### Aliases: choc
> 
> ### ** Examples
> 
> #generate artificial data set
> #two time series measured on 40 time steps with 365 observations per time step.
> #the two series follow a multinormal time series with a tend on means and a constant
> #covariance matrix
> library(MASS)
> require(ks)
Loading required package: ks
> tvar <- rep(1:40,times=100) #times steps
> meansX <-tvar/40 #trend on 1st variable
> meansY <- -0.5*tvar/40 #trend on 2nd variable
> sigma <- matrix(c(1,.1,.1,1),2,2) #covariance matrix
> values <- t(apply(cbind(meansX,meansY),1,function(mu) mvrnorm(1,mu,sigma))) #generate the values
> H <- Hpi #choose the default bandwith
> res_choc <- choc(values,H,tvar)
Error in get_root_i(cholH) : 
  function 'enterRNGScope' not provided by package 'Rcpp'
Calls: choc -> get_root_i
Execution halted
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in ‘inst/doc’ ... OK
* checking re-building of vignette outputs ... OK
* checking for non-standard things in the check directory ... OK
* checking for detritus in the temp directory ... OK
* DONE
Status: 1 ERROR

the install.out is as follows:

* installing *source* package ‘chocR’ ...
** using staged installation
** libs
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -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'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/dqrng/include' -I/usr/local/include    -fPIC  -Wall -g -O2  -c RcppExports.cpp -o RcppExports.o
In file included from RcppExports.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.
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -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'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/dqrng/include' -I/usr/local/include    -fPIC  -Wall -g -O2  -c dkernel.cpp -o dkernel.o
In file included from dkernel.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.
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 chocR.so RcppExports.o dkernel.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
ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0'
installing to /Users/yong/Downloads/chocR.Rcheck/00LOCK-chocR/00new/chocR/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** 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 (chocR)

This is current R session

sessionInfo()


R version 4.0.5 (2021-03-31)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 10.16

Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.0/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_4.0.5 tools_4.0.5 yaml_2.2.1



Liuyong

Thank you
Otoliths commented 3 years ago

Hi, Sorry, I don't have any mac to make tests so difficult to answer precisely since the error message is not very explicit. Do you have Rcpp package? Hilaire

Hi again, Tips for tests R package on multiple OS: This package rhub (https://github.com/r-hub/rhub) check package developed across multiple operating systems, which may be useful for package chocR upgraded. Looking forward to this package being able to do more.

Liuyong

elfunesto commented 3 years ago

Thanks for the feedback. I added your installation recommendation in the readme. For the remaining bug, it seems that it was due to a problem with rcpp and rcpparmadillo with some version. I've just pushed a fix that should have solved this issue. Thanks for rhub, will have a look.