Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation error #2

Open
dipterix opened this issue Apr 15, 2021 · 3 comments
Open

Installation error #2

dipterix opened this issue Apr 15, 2021 · 3 comments

Comments

@dipterix
Copy link

Hi @mllg , I encounter an installation error on RedHat R 4.0.4

It seems the compiler is complaining about initial declarations in the for loop. Is it possible that R 4.0 uses newer standards , or my gcc version is too low?

Error message (install from source)

* installing *source* package ‘base64url’ ...
** package ‘base64url’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -I"/opt2/software/R/4.0.4/lib64/R/include" -DNDEBUG   -I/opt2/software/gcc/7.2.0/include   -fpic  -g -O2  -c base32.c -o base32.o
base32.c: In function ‘b32e’:
base32.c:257:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for (R_xlen_t i = 0; i < n; i++) {
     ^
base32.c:257:5: note: use option -std=c99 or -std=gnu99 to compile your code
base32.c: In function ‘b32d’:
base32.c:293:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for (R_xlen_t i = 0; i < n; i++) {
     ^
make: *** [base32.o] Error 1
ERROR: compilation failed for package ‘base64url’

Session info

R version 4.0.4 (2021-02-15)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux

Matrix products: default
BLAS:   /usr/lib64/libblas.so.3.4.2
LAPACK: /opt2/software/R/4.0.4/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

loaded via a namespace (and not attached):
[1] compiler_4.0.4 tools_4.0.4    packrat_0.5.0 
@dipterix
Copy link
Author

After changing to

SEXP b64d(SEXP strings) {
    ...

    R_xlen_t i = 0;
    for (; i < n; i++) {
    ...

I was able to compile locally.

@mllg
Copy link
Owner

mllg commented Apr 15, 2021

What is the output of gcc --version?

@dipterix
Copy link
Author

@mllg Sorry for the late reply, here you go!

(base) bash-4.2$ gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
Copyright (C) 2015 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants