Error in installation R package
0
0
Entering edit mode
8.3 years ago
niutster ▴ 110

Hi, I am trying to install "minfi" package with these commamnds: source("https://bioconductor.org/biocLite.R") biocLite("minfi"), but when R starts to install RSQLite package on Ubuntu workstation, i get this error: ERROR: compilation failed for package 'RSQLite'. R version is 3.2.3.

How can i solve it?

R • 9.8k views
ADD COMMENT
0
Entering edit mode

Can you post the full error message? It should mention why it failed.

ADD REPLY
0
Entering edit mode

make: * [fetch.o] Error 1 ERROR: compilation failed for package 'RSQLite' R version 3.2.3

ADD REPLY
0
Entering edit mode
fetch.c: In function 'rsqlite_output_alloc':
fetch.c:25:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
   for (int j = 0; j < p; j++) {
   ^
fetch.c:25:3: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
fetch.c:32:12: error: redefinition of 'j'
   for (int j = 0; j < p; j++) {
            ^
fetch.c:25:12: note: previous definition of 'j' was here
   for (int j = 0; j < p; j++) {
            ^
fetch.c:32:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
   for (int j = 0; j < p; j++) {
   ^
fetch.c: In function 'rsqlite_output_expand':
fetch.c:44:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
   for (int j = 0; j < p; j++) {
   ^
fetch.c: In function 'fill_one_row':
fetch.c:251:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
   for (int j = 0; j < flds->num_fields; j++) {
   ^
fetch.c: In function 'rsqlite_query_fetch':
fetch.c:381:5: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
     for (int j = 0; j < num_fields; j++) {
     ^
make: *** [fetch.o] Error 1
ERROR: compilation failed for package 'RSQLite'
* removing '/home/barjaste/R/x86_64-pc-linux-gnu-library/3.2/RSQLite'
* installing *source* package 'openssl' ...
ADD REPLY
0
Entering edit mode

I assume it's the same when you try install.packages("RSQLite")? Do you have an outdated compiler? (Check with gcc --version in a terminal.

ADD REPLY
0
Entering edit mode

I checked it:

gcc (GCC) 4.9.0 Copyright (C) 2014 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.

ADD REPLY
0
Entering edit mode

Can you check install.packages('openssl')? I think that's the culprit. If it fails, please post the complete error message.

ADD REPLY
0
Entering edit mode

I have downloaded openssl from https://cran.r-project.org/web/packages/openssl/index.html and installed it with this command : install.packages("/home/barjaste/openssl_0.9.4.tgz",repos=NULL,source="type") Installing package into '/home/barjaste/R/x86_64-pc-linux-gnu-library/3.2' (as 'lib' is unspecified) * installing binary package 'openssl' ... * DONE (openssl)

require(openssl) Loading required package: openssl Failed with error: 'package 'openssl' was built for x86_64-apple-darwin13.4.0' In addition: Warning message: package 'openssl' was built under R version 3.2.5

ADD REPLY
0
Entering edit mode

It sounds that the problem is for bioconductor packages not for CRAN packages.

ADD REPLY
0
Entering edit mode

Why do you manually download the package and install it then? Just run install.packages('openssl') in R terminal... Could you try with installing libssl-dev first: sudo apt-get install libssl-dev

ADD REPLY
0
Entering edit mode

At first, this massage appears:

Installing package into '/home/barjaste/R/x86_64-pc-linux-gnu-library/3.2' (as 'lib' is unspecified) --- Please select a CRAN mirror for use in this session --- Error in download.file(url, destfile = f, quiet = TRUE) : unsupported URL scheme HTTPS CRAN mirror

1: 0-Cloud [https] 2: Austria [https] 3: Chile [https] 4: China (Beijing 4) [https] 5: Colombia (Cali) [https] 6: France (Lyon 2) [https] 7: France (Paris 2) [https] 8: Germany (M▒nster) [https] 9: Iceland [https] 10: Mexico (Mexico City) [https] 11: Russia (Moscow) [https] 12: Spain (A Coru▒a) [https] 13: Switzerland [https] 14: UK (Bristol) [https] 15: UK (Cambridge) [https] 16: USA (CA 1) [https] 17: USA (KS) [https] 18: USA (MI 1) [https] 19: USA (TN) [https] 20: USA (TX) [https] 21: USA (WA) [https] 22: (HTTP mirrors)

after selection, it says Selection: 1 Warning: unable to access index for repository https://cran.rstudio.com/src/contrib: unsupported URL scheme Warning message: package 'openssl' is not available (for R version 3.2.3)

When i tried for the second time, it says:

Installing package into '/home/barjaste/R/x86_64-pc-linux-gnu-library/3.2' (as 'lib' is unspecified) Warning: unable to access index for repository https://cran.rstudio.com/src/contrib: unsupported URL scheme Warning message: package 'openssl' is not available (for R version 3.2.3)

install.packages('openssl') Installing package into '/home/barjaste/R/x86_64-pc-linux-gnu-library/3.2' (as 'lib' is unspecified) Warning: unable to access index for repository https://cran.rstudio.com/src/contrib: unsupported URL scheme Warning message: package 'openssl' is not available (for R version 3.2.3)

ADD REPLY
0
Entering edit mode

For the second command:

sudo apt-get install libssl-dev Error: unexpected symbol in "sudo apt"

ADD REPLY

Login before adding your answer.

Traffic: 2569 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6