amices / mice

Multivariate Imputation by Chained Equations
https://amices.org/mice/
GNU General Public License v2.0
444 stars 107 forks source link

Can'tinstall mice with R4.1.0 on ubuntu 20.04.2 LTS (weird g++ error) #417

Closed jay-sf closed 3 years ago

jay-sf commented 3 years ago

Hi,

first of all, thanks for maintaining this great package!

I have problems to intall mice on an ubuntu system. I successfully installed it on a CentOS system so it's probably not a pure linux issue. Also I heard that other ubuntu users don't have this specific problem.

I have hard times to decipher what's actually failing. Seems related to the compiler somehow.

> install.packages('mice')
Installing package into ‘/home/jay/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/mice_3.13.0.tar.gz'
Content type 'application/x-gzip' length 574057 bytes (560 KB)
==================================================
downloaded 560 KB

[1] "LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=de_CH.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=de_CH.UTF-8;LC_IDENTIFICATION=C"
* installing *source* package ‘mice’ ...
** package ‘mice’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG  -I'/home/jay/R/x86_64-pc-linux-gnu-library/4.1/cpp11/include' -I'/home/jay/R/x86_64-pc-linux-gnu-library/4.1/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tbZjLv/r-base-4.1.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG  -I'/home/jay/R/x86_64-pc-linux-gnu-library/4.1/cpp11/include' -I'/home/jay/R/x86_64-pc-linux-gnu-library/4.1/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tbZjLv/r-base-4.1.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c match.cpp -o match.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG  -I'/home/jay/R/x86_64-pc-linux-gnu-library/4.1/cpp11/include' -I'/home/jay/R/x86_64-pc-linux-gnu-library/4.1/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tbZjLv/r-base-4.1.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c matchindex.cpp -o matchindex.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o mice.so RcppExports.o match.o matchindex.o [1] "LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=de_CH.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=de_CH.UTF-8;LC_IDENTIFICATION=C" -L/usr/lib/R/lib -lR
g++: error: [1]: No such file or directory
g++: error: "LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=de_CH.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=de_CH.UTF-8;LC_IDENTIFICATION=C": No such file or directory
make: *** [/usr/share/R/share/make/shlib.mk:10: mice.so] Error 1
ERROR: compilation failed for package ‘mice’
* removing ‘/home/jay/R/x86_64-pc-linux-gnu-library/4.1/mice’
Warning in install.packages :
  installation of package ‘mice’ had non-zero exit status

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

The compiler seems to be up to date, though. Should I use a different compiler for mice? How would I do that?

/$ gcc --version
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

This is my system environment:

> version
               _                           
platform       x86_64-pc-linux-gnu         
arch           x86_64                      
os             linux-gnu                   
system         x86_64, linux-gnu           
status                                     
major          4                           
minor          1.0                         
year           2021                        
month          05                          
day            18                          
svn rev        80317                       
language       R                           
version.string R version 4.1.0 (2021-05-18)
nickname       Camp Pontanezen  

Note: I also tried the dev version devtools::install_github(repo = "amices/mice") with the same result.

It would be great if you could have a look at that. Thanks!

Cheers

gerkovink commented 3 years ago

Can you try installing from source?

jay-sf commented 3 years ago

Already tried to git clone ... and install.packages('/home/jay/git/mice', repos=NULL), looks exactly the same, though.

jay-sf commented 3 years ago

In the menawhile I could solve the issue. As you may have noiticed, constantly my R locale was shuffled into the installation process. The problem was that I globally set Sys.setenv(LANGUAGE = "EN") and Sys.setlocale("LC_ALL", 'C') in the Renviron.site file. This apprently is wrong and should be done in the Rprofile with LANGUAGE=EN and LC_ALL=C. So the problem was related to this error, and not to your package, sorry. This can be closed then, thanks!

stefvanbuuren commented 3 years ago

Jay-sf, thanks for reporting back. Great that you managed to find the culprit.