r-lib / fs

Provide cross platform file operations based on libuv.
https://fs.r-lib.org/
Other
365 stars 80 forks source link

Error in installation #309

Closed subhomoyghosh closed 2 years ago

subhomoyghosh commented 3 years ago

Hi, I was trying to install 'fs' and got an error:


install.packages('fs',lib='/home2/sng8/R/R-4.0.3/buildR/lib64/R/library')
trying URL 'https://repo.miserver.it.umich.edu/cran/src/contrib/fs_1.5.0.tar.gz'
Content type 'application/octet-stream' length 796244 bytes (777 KB)
==================================================
downloaded 777 KB
*installing *source* package 'fs' ...
** package ‘fs’ successfully unpacked and MD5 sums checked
using staged installation
** libs
icpc -I"/home2/sng8/R/R-4.0.3/buildR/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/usr/local/include   -fpic  -O3 -ipo -qopenmp -xHost -fPIC -multiple-processes -c id.cc -o id.o
icpc -I"/home2/sng8/R/R-4.0.3/buildR/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/usr/local/include   -fpic  -O3 -ipo -qopenmp -xHost -fPIC -multiple-processes -c utils.cc -o utils.o
icpc -I"/home2/sng8/R/R-4.0.3/buildR/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/usr/local/include   -fpic  -O3 -ipo -qopenmp -xHost -fPIC -multiple-processes -c file.cc -o file.o
icpc -I"/home2/sng8/R/R-4.0.3/buildR/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/usr/local/include   -fpic  -O3 -ipo -qopenmp -xHost -fPIC -multiple-processes -c path.cc -o path.o
icpc -I"/home2/sng8/R/R-4.0.3/buildR/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/usr/local/include   -fpic  -O3 -ipo -qopenmp -xHost -fPIC -multiple-processes -c link.cc -o link.o
icpc -I"/home2/sng8/R/R-4.0.3/buildR/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/usr/local/include   -fpic  -O3 -ipo -qopenmp -xHost -fPIC -multiple-processes -c fs.cc -o fs.o
icpc -I"/home2/sng8/R/R-4.0.3/buildR/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/usr/local/include   -fpic  -O3 -ipo -qopenmp -xHost -fPIC -multiple-processes -c init.cc -o init.o
icpc -I"/home2/sng8/R/R-4.0.3/buildR/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/usr/local/include   -fpic  -O3 -ipo -qopenmp -xHost -fPIC -multiple-processes -c dir.cc -o dir.o
icpc -I"/home2/sng8/R/R-4.0.3/buildR/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/usr/local/include   -fpic  -O3 -ipo -qopenmp -xHost -fPIC -multiple-processes -c getmode.cc -o getmode.o
icpc -I"/home2/sng8/R/R-4.0.3/buildR/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/usr/local/include   -fpic  -O3 -ipo -qopenmp -xHost -fPIC -multiple-processes -c error.cc -o error.o
icpc -I"/home2/sng8/R/R-4.0.3/buildR/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/usr/local/include   -fpic  -O3 -ipo -qopenmp -xHost -fPIC -multiple-processes -c unix/getmode.cc -o unix/getmode.o
icc -std=c99 -I"/home2/sng8/R/R-4.0.3/buildR/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/usr/local/include   -fpic  -O3 -ipo -qopenmp -xHost -fPIC -multiple-processes -c bsd/setmode.c -o bsd/setmode.o
bsd/setmode.c(139): error: identifier "S_IFDIR" is undefined
            if (omode & (S_IFDIR|S_IXUSR|S_IXGRP|S_IXOTH))
                         ^

bsd/setmode.c(174): error: identifier "sigset_t" is undefined
    sigset_t signset, sigoset;
    ^

bsd/setmode.c(192): warning #266: function "sigfillset" declared implicitly
    sigfillset(&signset);
    ^

bsd/setmode.c(193): warning #266: function "sigprocmask" declared implicitly
    (void)sigprocmask(SIG_BLOCK, &signset, &sigoset);
          ^

bsd/setmode.c(193): error: identifier "SIG_BLOCK" is undefined
    (void)sigprocmask(SIG_BLOCK, &signset, &sigoset);
                      ^

bsd/setmode.c(198): error: identifier "SIG_SETMASK" is undefined
    (void)sigprocmask(SIG_SETMASK, &sigoset, NULL);
                      ^

bsd/setmode.c(222): error: identifier "S_ISVTX" is undefined
        if (lval & ~(STANDARD_BITS|S_ISTXT)) {
                                   ^

bsd/setmode.c(227): error: identifier "S_ISVTX" is undefined
        ADDCMD('=', (STANDARD_BITS|S_ISTXT), perm, mask);
        ^

bsd/setmode.c(264): error: identifier "S_ISVTX" is undefined
        who &= ~S_ISTXT;
                ^

compilation aborted for bsd/setmode.c (code 2)
make: *** [bsd/setmode.o] Error 2
ERROR: compilation failed for package ‘fs’
* removing ‘/home2/sng8/R/R-4.0.3/buildR/lib64/R/library/fs’

The downloaded source packages are in
    ‘/home2/sng8/tmp/RtmpExn4On/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("fs", lib = "/home2/sng8/R/R-4.0.3/buildR/lib64/R/library") :
  installation of package ‘fs’ had non-zero exit status

Can you take a look at why this might be happening? It is on OS: CentOS Linux 7

Thanks, SG

jimhester commented 3 years ago

You seem to be using Intels compiler, you likely need to use gcc or clang.

subhomoyghosh commented 3 years ago

I kind of felt that as I am having problems with some other packages as well. However, this is a cluster, and sometimes I need the devtools package to install some packages in the intelR and it won't install without 'fs'. Would there be any conflict if I specify CC and CXX in makevars to tell it to compile with gcc?

jimhester commented 3 years ago

No, it should probably work fine doing that.

subhomoyghosh commented 3 years ago

Thanks, appreciate it! Our cluster is down today. I will try it tomorrow. I might come back with questions if I can't get it to work with that setup. I would really need fs and devtools to be working.

YiweiNiu commented 3 years ago

Hello, I got the same error using gcc to compile fs

** libs
g++ -std=gnu++11 -I"/home/niuyw/software/R.4.0.3/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/home/niuyw/software/zlib.1.2.8/include -I/home/niuyw/software/bzip2.1.0.6/include -I/home/niuyw/software/xz.5.2.2/include -I/home/niuyw/software/pcre.8.44/include -std=c11   -fpic  -g -O2  -c dir.cc -o dir.o
cc1plus: warning: command line option ‘-std=c11’ is valid for C/ObjC but not for C++
g++ -std=gnu++11 -I"/home/niuyw/software/R.4.0.3/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/home/niuyw/software/zlib.1.2.8/include -I/home/niuyw/software/bzip2.1.0.6/include -I/home/niuyw/software/xz.5.2.2/include -I/home/niuyw/software/pcre.8.44/include -std=c11   -fpic  -g -O2  -c error.cc -o error.o
cc1plus: warning: command line option ‘-std=c11’ is valid for C/ObjC but not for C++
g++ -std=gnu++11 -I"/home/niuyw/software/R.4.0.3/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/home/niuyw/software/zlib.1.2.8/include -I/home/niuyw/software/bzip2.1.0.6/include -I/home/niuyw/software/xz.5.2.2/include -I/home/niuyw/software/pcre.8.44/include -std=c11   -fpic  -g -O2  -c file.cc -o file.o
cc1plus: warning: command line option ‘-std=c11’ is valid for C/ObjC but not for C++
g++ -std=gnu++11 -I"/home/niuyw/software/R.4.0.3/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/home/niuyw/software/zlib.1.2.8/include -I/home/niuyw/software/bzip2.1.0.6/include -I/home/niuyw/software/xz.5.2.2/include -I/home/niuyw/software/pcre.8.44/include -std=c11   -fpic  -g -O2  -c fs.cc -o fs.o
cc1plus: warning: command line option ‘-std=c11’ is valid for C/ObjC but not for C++
g++ -std=gnu++11 -I"/home/niuyw/software/R.4.0.3/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/home/niuyw/software/zlib.1.2.8/include -I/home/niuyw/software/bzip2.1.0.6/include -I/home/niuyw/software/xz.5.2.2/include -I/home/niuyw/software/pcre.8.44/include -std=c11   -fpic  -g -O2  -c getmode.cc -o getmode.o
cc1plus: warning: command line option ‘-std=c11’ is valid for C/ObjC but not for C++
g++ -std=gnu++11 -I"/home/niuyw/software/R.4.0.3/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/home/niuyw/software/zlib.1.2.8/include -I/home/niuyw/software/bzip2.1.0.6/include -I/home/niuyw/software/xz.5.2.2/include -I/home/niuyw/software/pcre.8.44/include -std=c11   -fpic  -g -O2  -c id.cc -o id.o
cc1plus: warning: command line option ‘-std=c11’ is valid for C/ObjC but not for C++
g++ -std=gnu++11 -I"/home/niuyw/software/R.4.0.3/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/home/niuyw/software/zlib.1.2.8/include -I/home/niuyw/software/bzip2.1.0.6/include -I/home/niuyw/software/xz.5.2.2/include -I/home/niuyw/software/pcre.8.44/include -std=c11   -fpic  -g -O2  -c init.cc -o init.o
cc1plus: warning: command line option ‘-std=c11’ is valid for C/ObjC but not for C++
g++ -std=gnu++11 -I"/home/niuyw/software/R.4.0.3/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/home/niuyw/software/zlib.1.2.8/include -I/home/niuyw/software/bzip2.1.0.6/include -I/home/niuyw/software/xz.5.2.2/include -I/home/niuyw/software/pcre.8.44/include -std=c11   -fpic  -g -O2  -c link.cc -o link.o
cc1plus: warning: command line option ‘-std=c11’ is valid for C/ObjC but not for C++
g++ -std=gnu++11 -I"/home/niuyw/software/R.4.0.3/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/home/niuyw/software/zlib.1.2.8/include -I/home/niuyw/software/bzip2.1.0.6/include -I/home/niuyw/software/xz.5.2.2/include -I/home/niuyw/software/pcre.8.44/include -std=c11   -fpic  -g -O2  -c path.cc -o path.o
cc1plus: warning: command line option ‘-std=c11’ is valid for C/ObjC but not for C++
g++ -std=gnu++11 -I"/home/niuyw/software/R.4.0.3/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/home/niuyw/software/zlib.1.2.8/include -I/home/niuyw/software/bzip2.1.0.6/include -I/home/niuyw/software/xz.5.2.2/include -I/home/niuyw/software/pcre.8.44/include -std=c11   -fpic  -g -O2  -c utils.cc -o utils.o
cc1plus: warning: command line option ‘-std=c11’ is valid for C/ObjC but not for C++
g++ -std=gnu++11 -I"/home/niuyw/software/R.4.0.3/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/home/niuyw/software/zlib.1.2.8/include -I/home/niuyw/software/bzip2.1.0.6/include -I/home/niuyw/software/xz.5.2.2/include -I/home/niuyw/software/pcre.8.44/include -std=c11   -fpic  -g -O2  -c unix/getmode.cc -o unix/getmode.o
cc1plus: warning: command line option ‘-std=c11’ is valid for C/ObjC but not for C++
gcc -I"/home/niuyw/software/R.4.0.3/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/home/niuyw/software/zlib.1.2.8/include -I/home/niuyw/software/bzip2.1.0.6/include -I/home/niuyw/software/xz.5.2.2/include -I/home/niuyw/software/pcre.8.44/include -std=c11   -fpic  -g -O2  -c bsd/setmode.c -o bsd/setmode.o
bsd/setmode.c: In function ‘getmode’:
bsd/setmode.c:139:17: error: ‘S_IFDIR’ undeclared (first use in this function); did you mean ‘S_ISDIR’?
  139 |    if (omode & (S_IFDIR|S_IXUSR|S_IXGRP|S_IXOTH))
      |                 ^~~~~~~
      |                 S_ISDIR
bsd/setmode.c:139:17: note: each undeclared identifier is reported only once for each function it appears in
bsd/setmode.c: In function ‘setmode’:
bsd/setmode.c:174:2: error: unknown type name ‘sigset_t’; did you mean ‘size_t’?
  174 |  sigset_t signset, sigoset;
      |  ^~~~~~~~
      |  size_t
bsd/setmode.c:192:2: warning: implicit declaration of function ‘sigfillset’ [-Wimplicit-function-declaration]
  192 |  sigfillset(&signset);
      |  ^~~~~~~~~~
bsd/setmode.c:193:8: warning: implicit declaration of function ‘sigprocmask’ [-Wimplicit-function-declaration]
  193 |  (void)sigprocmask(SIG_BLOCK, &signset, &sigoset);
      |        ^~~~~~~~~~~
bsd/setmode.c:193:20: error: ‘SIG_BLOCK’ undeclared (first use in this function)
  193 |  (void)sigprocmask(SIG_BLOCK, &signset, &sigoset);
      |                    ^~~~~~~~~
bsd/setmode.c:198:20: error: ‘SIG_SETMASK’ undeclared (first use in this function)
  198 |  (void)sigprocmask(SIG_SETMASK, &sigoset, NULL);
      |                    ^~~~~~~~~~~
bsd/setmode.c:57:17: error: ‘S_ISVTX’ undeclared (first use in this function); did you mean ‘S_ISTXT’?
   57 | #define S_ISTXT S_ISVTX
      |                 ^~~~~~~
bsd/setmode.c:222:30: note: in expansion of macro ‘S_ISTXT’
  222 |   if (lval & ~(STANDARD_BITS|S_ISTXT)) {
      |                              ^~~~~~~
make: *** [bsd/setmode.o] Error 1
ERROR: compilation failed for package ‘fs’

And the gcc version

$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/home/software/gcc-4.9.3/libexec/gcc/x86_64-unknown-linux-gnu/4.9.3/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/home/software/gcc-4.9.3 --with-mpc=/home/software/
Thread model: posix
gcc version 4.9.3 (GCC)

The OS: CentOS 6.6

gaborcsardi commented 2 years ago

CentOS 6 is not supported any more, and its compiler is likely not modern enough to compile fs.