tidyverse / purrr

A functional programming toolkit for R
https://purrr.tidyverse.org/
Other
1.28k stars 272 forks source link

compilation error on Amazon Linux 2 using gcc 7.3.1 #1085

Closed tyner closed 1 year ago

tyner commented 1 year ago

I am using R version 3.4.3 on Amazon Linux 2 (platform x86_64-koji-linux-gnu). Any idea what could be the issue?

* installing *source* package ‘purrr’ ...
** package ‘purrr’ successfully unpacked and MD5 sums checked
** libs
gcc -m64 -I/usr/include/R -DNDEBUG  -I"/home/hadoop/R/x86_64-koji-linux-gnu-library/3.4/cli/include" -I/usr/local/include  -fvisibility=hidden -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c backports.c -o backports.o
gcc -m64 -I/usr/include/R -DNDEBUG  -I"/home/hadoop/R/x86_64-koji-linux-gnu-library/3.4/cli/include" -I/usr/local/include  -fvisibility=hidden -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c cleancall.c -o cleancall.o
gcc -m64 -I/usr/include/R -DNDEBUG  -I"/home/hadoop/R/x86_64-koji-linux-gnu-library/3.4/cli/include" -I/usr/local/include  -fvisibility=hidden -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c coerce.c -o coerce.o
gcc -m64 -I/usr/include/R -DNDEBUG  -I"/home/hadoop/R/x86_64-koji-linux-gnu-library/3.4/cli/include" -I/usr/local/include  -fvisibility=hidden -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c conditions.c -o conditions.o
gcc -m64 -I/usr/include/R -DNDEBUG  -I"/home/hadoop/R/x86_64-koji-linux-gnu-library/3.4/cli/include" -I/usr/local/include  -fvisibility=hidden -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c flatten.c -o flatten.o
gcc -m64 -I/usr/include/R -DNDEBUG  -I"/home/hadoop/R/x86_64-koji-linux-gnu-library/3.4/cli/include" -I/usr/local/include  -fvisibility=hidden -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c init.c -o init.o
gcc -m64 -I/usr/include/R -DNDEBUG  -I"/home/hadoop/R/x86_64-koji-linux-gnu-library/3.4/cli/include" -I/usr/local/include  -fvisibility=hidden -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c map.c -o map.o
map.c: In function ‘map_impl’:
map.c:86:11: warning: implicit declaration of function ‘INTEGER_ELT’; did you mean ‘INTEGER’? [-Wimplicit-function-declaration]
   int n = INTEGER_ELT(ffi_n, 0);
           ^~~~~~~~~~~
           INTEGER
gcc -m64 -I/usr/include/R -DNDEBUG  -I"/home/hadoop/R/x86_64-koji-linux-gnu-library/3.4/cli/include" -I/usr/local/include  -fvisibility=hidden -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c pluck.c -o pluck.o
pluck.c: In function ‘extract_vector’:
pluck.c:130:41: warning: implicit declaration of function ‘COMPLEX_ELT’; did you mean ‘COMPLEX’? [-Wimplicit-function-declaration]
   case CPLXSXP: return Rf_ScalarComplex(COMPLEX_ELT(x, offset));
                                         ^~~~~~~~~~~
                                         COMPLEX
pluck.c:130:41: error: incompatible type for argument 1 of ‘Rf_ScalarComplex’
In file included from pluck.c:3:0:
/usr/include/R/Rinternals.h:1411:7: note: expected ‘Rcomplex {aka struct <anonymous>}’ but argument is of type ‘int’
 SEXP  Rf_ScalarComplex(Rcomplex);
       ^~~~~~~~~~~~~~~~
make: *** [pluck.o] Error 1
ERROR: compilation failed for package ‘purrr’
* removing ‘/home/hadoop/R/x86_64-koji-linux-gnu-library/3.4/purrr’
Error in install.packages("purrr") : 
  (converted from warning) installation of package ‘purrr’ had non-zero exit status
hadley commented 1 year ago

@DavisVaughan any ideas?

DavisVaughan commented 1 year ago

R 3.5.0 is required for INTEGER_ELT https://github.com/tidyverse/purrr/blob/fe11742256d7bebe4912a40d4ee21998d3e4109b/DESCRIPTION#L16

See also https://github.com/r-lib/vctrs/blob/e88a3e28822fa5bf925048e6bd0b10315f7bd9af/src/vctrs-core.h#L99

But i dont think we should add that here

DavisVaughan commented 1 year ago

Oh but the version bump isn't on CRAN yet and didn't get a NEWS bullet https://github.com/tidyverse/purrr/pull/1046

We should probably add a news bullet for that

hadley commented 1 year ago

I'll do a release now too.