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

readxl installation problem #14688

Closed
2 of 4 tasks
fbenedett opened this issue May 10, 2024 · 6 comments
Closed
2 of 4 tasks

readxl installation problem #14688

fbenedett opened this issue May 10, 2024 · 6 comments
Labels
bug info needed Additional information requested—reprex, steps, open question, etc.

Comments

@fbenedett
Copy link

fbenedett commented May 10, 2024

Hello I am trying to install "readxl", but I encounter a problem.

Here what I did:

install.packages("readxl")
Installing package into ‘/home/fbenedet/R/x86_64-pc-linux-gnu-library/4.4’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/readxl_1.4.3.tar.gz'
Content type 'application/x-gzip' length 2093488 bytes (2.0 MB)
==================================================
downloaded 2.0 MB

* installing *source* package ‘readxl’ ...
** package ‘readxl’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
using C++ compiler: ‘g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG -Iunix -I. -I'/usr/lib/R/site-library/cpp11/include' -I'/usr/lib/R/site-library/progress/include'    -fvisibility=hidden -fpic  -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -c cpp11.cpp -o cpp11.o
In file included from /usr/lib/R/site-library/cpp11/include/cpp11/as.hpp:11,
                 from /usr/lib/R/site-library/cpp11/include/cpp11.hpp:5,
                 from /usr/lib/R/site-library/cpp11/include/cpp11/declarations.hpp:8,
                 from cpp11.cpp:5:
/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp: In member function ‘void cpp11::<unnamed struct>::print()’:
/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp:337:18: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘SEXP’ {aka ‘SEXPREC*’} [-Wformat=]
  337 |       REprintf("%x CAR: %x CDR: %x TAG: %x\n", head, CAR(head), CDR(head), TAG(head));
      |                 ~^                             ~~~~
      |                  |                             |
      |                  unsigned int                  SEXP {aka SEXPREC*}
/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp:337:26: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘SEXP’ {aka ‘SEXPREC*’} [-Wformat=]
  337 |       REprintf("%x CAR: %x CDR: %x TAG: %x\n", head, CAR(head), CDR(head), TAG(head));
      |                         ~^                           ~~~~~~~~~
      |                          |                              |
      |                          unsigned int                   SEXP {aka SEXPREC*}
/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp:337:34: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘SEXP’ {aka ‘SEXPREC*’} [-Wformat=]
  337 |       REprintf("%x CAR: %x CDR: %x TAG: %x\n", head, CAR(head), CDR(head), TAG(head));
      |                                 ~^                              ~~~~~~~~~
      |                                  |                                 |
      |                                  unsigned int                      SEXP {aka SEXPREC*}
/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp:337:42: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘SEXP’ {aka ‘SEXPREC*’} [-Wformat=]
  337 |       REprintf("%x CAR: %x CDR: %x TAG: %x\n", head, CAR(head), CDR(head), TAG(head));
      |                                         ~^                                 ~~~~~~~~~
      |                                          |                                    |
      |                                          unsigned int                         SEXP {aka SEXPREC*}
g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG -Iunix -I. -I'/usr/lib/R/site-library/cpp11/include' -I'/usr/lib/R/site-library/progress/include'    -fvisibility=hidden -fpic  -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -c XlsWorkBook.cpp -o XlsWorkBook.o
In file included from utils.h:3,
                 from ColSpec.h:3,
                 from XlsWorkBook.h:3,
                 from XlsWorkBook.cpp:1:
/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp: In member function ‘void cpp11::<unnamed struct>::print()’:
/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp:337:18: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘SEXP’ {aka ‘SEXPREC*’} [-Wformat=]
  337 |       REprintf("%x CAR: %x CDR: %x TAG: %x\n", head, CAR(head), CDR(head), TAG(head));
      |                 ~^                             ~~~~
      |                  |                             |
      |                  unsigned int                  SEXP {aka SEXPREC*}
/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp:337:26: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘SEXP’ {aka ‘SEXPREC*’} [-Wformat=]
  337 |       REprintf("%x CAR: %x CDR: %x TAG: %x\n", head, CAR(head), CDR(head), TAG(head));
      |                         ~^                           ~~~~~~~~~
      |                          |                              |
      |                          unsigned int                   SEXP {aka SEXPREC*}
/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp:337:34: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘SEXP’ {aka ‘SEXPREC*’} [-Wformat=]
  337 |       REprintf("%x CAR: %x CDR: %x TAG: %x\n", head, CAR(head), CDR(head), TAG(head));
      |                                 ~^                              ~~~~~~~~~
      |                                  |                                 |
      |                                  unsigned int                      SEXP {aka SEXPREC*}
/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp:337:42: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘SEXP’ {aka ‘SEXPREC*’} [-Wformat=]
  337 |       REprintf("%x CAR: %x CDR: %x TAG: %x\n", head, CAR(head), CDR(head), TAG(head));
      |                                         ~^                                 ~~~~~~~~~
      |                                          |                                    |
      |                                          unsigned int                         SEXP {aka SEXPREC*}
g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG -Iunix -I. -I'/usr/lib/R/site-library/cpp11/include' -I'/usr/lib/R/site-library/progress/include'    -fvisibility=hidden -fpic  -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -c XlsxWorkBook.cpp -o XlsxWorkBook.o
In file included from utils.h:3,
                 from ColSpec.h:3,
                 from XlsxWorkBook.h:3,
                 from XlsxWorkBook.cpp:1:
/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp: In member function ‘void cpp11::<unnamed struct>::print()’:
/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp:337:18: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘SEXP’ {aka ‘SEXPREC*’} [-Wformat=]
  337 |       REprintf("%x CAR: %x CDR: %x TAG: %x\n", head, CAR(head), CDR(head), TAG(head));
      |                 ~^                             ~~~~
      |                  |                             |
      |                  unsigned int                  SEXP {aka SEXPREC*}
/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp:337:26: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘SEXP’ {aka ‘SEXPREC*’} [-Wformat=]
  337 |       REprintf("%x CAR: %x CDR: %x TAG: %x\n", head, CAR(head), CDR(head), TAG(head));
      |                         ~^                           ~~~~~~~~~
      |                          |                              |
      |                          unsigned int                   SEXP {aka SEXPREC*}
/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp:337:34: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘SEXP’ {aka ‘SEXPREC*’} [-Wformat=]
  337 |       REprintf("%x CAR: %x CDR: %x TAG: %x\n", head, CAR(head), CDR(head), TAG(head));
      |                                 ~^                              ~~~~~~~~~
      |                                  |                                 |
      |                                  unsigned int                      SEXP {aka SEXPREC*}
/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp:337:42: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘SEXP’ {aka ‘SEXPREC*’} [-Wformat=]
  337 |       REprintf("%x CAR: %x CDR: %x TAG: %x\n", head, CAR(head), CDR(head), TAG(head));
      |                                         ~^                                 ~~~~~~~~~
      |                                          |                                    |
      |                                          unsigned int                         SEXP {aka SEXPREC*}
g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG -Iunix -I. -I'/usr/lib/R/site-library/cpp11/include' -I'/usr/lib/R/site-library/progress/include'    -fvisibility=hidden -fpic  -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -c zip.cpp -o zip.o
In file included from /usr/lib/R/site-library/cpp11/include/cpp11/as.hpp:11,
                 from /usr/lib/R/site-library/cpp11/include/cpp11/function.hpp:10,
                 from zip.cpp:5:
/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp: In member function ‘void cpp11::<unnamed struct>::print()’:
/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp:337:18: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘SEXP’ {aka ‘SEXPREC*’} [-Wformat=]
  337 |       REprintf("%x CAR: %x CDR: %x TAG: %x\n", head, CAR(head), CDR(head), TAG(head));
      |                 ~^                             ~~~~
      |                  |                             |
      |                  unsigned int                  SEXP {aka SEXPREC*}
/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp:337:26: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘SEXP’ {aka ‘SEXPREC*’} [-Wformat=]
  337 |       REprintf("%x CAR: %x CDR: %x TAG: %x\n", head, CAR(head), CDR(head), TAG(head));
      |                         ~^                           ~~~~~~~~~
      |                          |                              |
      |                          unsigned int                   SEXP {aka SEXPREC*}
/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp:337:34: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘SEXP’ {aka ‘SEXPREC*’} [-Wformat=]
  337 |       REprintf("%x CAR: %x CDR: %x TAG: %x\n", head, CAR(head), CDR(head), TAG(head));
      |                                 ~^                              ~~~~~~~~~
      |                                  |                                 |
      |                                  unsigned int                      SEXP {aka SEXPREC*}
/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp:337:42: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘SEXP’ {aka ‘SEXPREC*’} [-Wformat=]
  337 |       REprintf("%x CAR: %x CDR: %x TAG: %x\n", head, CAR(head), CDR(head), TAG(head));
      |                                         ~^                                 ~~~~~~~~~
      |                                          |                                    |
      |                                          unsigned int                         SEXP {aka SEXPREC*}
g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG -Iunix -I. -I'/usr/lib/R/site-library/cpp11/include' -I'/usr/lib/R/site-library/progress/include'    -fvisibility=hidden -fpic  -g -O2 -ffile-prefix-map=/build/r-base-H8urij/r-base-4.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -c Read.cpp -o Read.o
In file included from utils.h:3,
                 from ColSpec.h:3,
                 from XlsCell.h:3,
                 from CellLimits.h:3,
                 from SheetView.h:4,
                 from Read.cpp:1:
/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp: In member function ‘void cpp11::<unnamed struct>::print()’:
/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp:337:18: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘SEXP’ {aka ‘SEXPREC*’} [-Wformat=]
  337 |       REprintf("%x CAR: %x CDR: %x TAG: %x\n", head, CAR(head), CDR(head), TAG(head));
      |                 ~^                             ~~~~
      |                  |                             |
      |                  unsigned int                  SEXP {aka SEXPREC*}
/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp:337:26: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘SEXP’ {aka ‘SEXPREC*’} [-Wformat=]
  337 |       REprintf("%x CAR: %x CDR: %x TAG: %x\n", head, CAR(head), CDR(head), TAG(head));
      |                         ~^                           ~~~~~~~~~
      |                          |                              |
      |                          unsigned int                   SEXP {aka SEXPREC*}
/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp:337:34: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘SEXP’ {aka ‘SEXPREC*’} [-Wformat=]
  337 |       REprintf("%x CAR: %x CDR: %x TAG: %x\n", head, CAR(head), CDR(head), TAG(head));
      |                                 ~^                              ~~~~~~~~~
      |                                  |                                 |
      |                                  unsigned int                      SEXP {aka SEXPREC*}
/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp:337:42: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘SEXP’ {aka ‘SEXPREC*’} [-Wformat=]
  337 |       REprintf("%x CAR: %x CDR: %x TAG: %x\n", head, CAR(head), CDR(head), TAG(head));
      |                                         ~^                                 ~~~~~~~~~
      |                                          |                                    |
      |                                          unsigned int                         SEXP {aka SEXPREC*}
In file included from Spinner.h:3,
                 from XlsCellSet.h:4,
                 from SheetView.h:8,
                 from Read.cpp:1:
/usr/lib/R/site-library/progress/include/RProgress.h: In member function ‘void RProgress::RProgress::render()’:
/usr/lib/R/site-library/progress/include/RProgress.h:229:17: error: format not a string literal and no format arguments [-Werror=format-security]
  229 |         REprintf(str.c_str());
      |         ~~~~~~~~^~~~~~~~~~~~~
/usr/lib/R/site-library/progress/include/RProgress.h:231:16: error: format not a string literal and no format arguments [-Werror=format-security]
  231 |         Rprintf(str.c_str());
      |         ~~~~~~~^~~~~~~~~~~~~
/usr/lib/R/site-library/progress/include/RProgress.h: In member function ‘void RProgress::RProgress::clear_line(bool, int)’:
/usr/lib/R/site-library/progress/include/RProgress.h:272:15: error: format not a string literal and no format arguments [-Werror=format-security]
  272 |       REprintf(spaces);
      |       ~~~~~~~~^~~~~~~~
/usr/lib/R/site-library/progress/include/RProgress.h:274:14: error: format not a string literal and no format arguments [-Werror=format-security]
  274 |       Rprintf(spaces);
      |       ~~~~~~~^~~~~~~~
cc1plus: some warnings being treated as errors
make: *** [/usr/lib/R/etc/Makeconf:204: Read.o] Error 1
ERROR: compilation failed for package ‘readxl’
* removing ‘/home/fbenedet/R/x86_64-pc-linux-gnu-library/4.4/readxl’
Warning in install.packages :
  installation of package ‘readxl’ had non-zero exit status

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

System details

> version
               _                           
platform       x86_64-pc-linux-gnu         
arch           x86_64                      
os             linux-gnu                   
system         x86_64, linux-gnu           
status                                     
major          4                           
minor          4.0                         
year           2024                        
month          04                          
day            24                          
svn rev        86474                       
language       R                           
version.string R version 4.4.0 (2024-04-24)
nickname       Puppy Cup  

Rstudio version 2024.04.0 Build 735

RStudio Edition : Desktop
OS Version      :  Ubuntu 22.04
  • I have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • If I am reporting an RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
@fbenedett fbenedett added bug new New incoming issues, ready for initial review. labels May 10, 2024
@fbenedett fbenedett reopened this May 10, 2024
@ronblum
Copy link
Contributor

ronblum commented May 10, 2024

@fbenedett Thank you for raising this! What happens if you try to install the package in R, outside of RStudio?

@ronblum ronblum added info needed Additional information requested—reprex, steps, open question, etc. and removed new New incoming issues, ready for initial review. labels May 10, 2024
@Med-AL
Copy link

Med-AL commented May 10, 2024

Can you try to install progress and Rcpp package

install.package("Rcpp")
install.package("Rcpp11")
install.package("progress")

And reinstall readxl

@fbenedett
Copy link
Author

Hello, I tried another solution and I was able to fix the problem.
I had to mofify the file Makevars (there are severals, mine was one under the directory: /home/fbenedet/R/x86_64-pc-linux-gnu-library/4.4/)
I had to add this options. After, I was able to install readxl
CXXFLAGS += -Wno-format-security

@ronblum
Copy link
Contributor

ronblum commented May 14, 2024

Does the problem occur in R outside of RStudio?

@fbenedett
Copy link
Author

I cannot confirm it, because I fixed from within Rstudio with the solution I provided.

@pwkraft
Copy link

pwkraft commented May 20, 2024

Can you try to install progress and Rcpp package

install.package("Rcpp") install.package("Rcpp11") install.package("progress")

And reinstall readxl

I encountered the same issue described above (same OS & R Version). The problem also occurred in R outside of RStudio, but (re-)installing Rcpp and progress as suggested by @Med-AL fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug info needed Additional information requested—reprex, steps, open question, etc.
Projects
None yet
Development

No branches or pull requests

4 participants