stan-dev / rstan

RStan, the R interface to Stan
https://mc-stan.org
1.04k stars 265 forks source link

building fails on arch linux with no error message despite verbose=TRUE #466

Open bfredl opened 6 years ago

bfredl commented 6 years ago

Description:

I followed the suggested build instructions at https://github.com/stan-dev/rstan/wiki/Installing-RStan-on-Mac-or-Linux. But the build fails with no actionable error message, even with verbose=TRUE.

Reproducible Steps:

dotR <- file.path(Sys.getenv("HOME"), ".R")
if (!file.exists(dotR)) dir.create(dotR)
M <- file.path(dotR, "Makevars")
if (!file.exists(M)) file.create(M)
cat("\nCXXFLAGS=-O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function", 
    file = M, sep = "\n", append = TRUE)

library(devtools)
Sys.setenv(MAKEFLAGS = "-j4")
# installs deps, but rstan fails:
install.packages("rstan", repos = "https://cloud.r-project.org/", dependencies=TRUE)
# so try verbose build from source
install.packages("rstan", type = "source", quiet=FALSE, verbose=TRUE)

Current Output:

Installing package into ‘/home/bjorn/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
system (cmd0): /usr/lib64/R/bin/R CMD INSTALL
foundpkgs: rstan, /tmp/Rtmpf4QkoH/downloaded_packages/rstan_2.16.2.tar.gz
files: /tmp/Rtmpf4QkoH/downloaded_packages/rstan_2.16.2.tar.gz
Warning message in install.packages("rstan", type = "source", quiet = FALSE, verbose = TRUE):
“installation of package ‘rstan’ had non-zero exit status”

Expected Output:

The actual command that had "non-zero exit", and its output, so there is any chance to debug it.

RStan Version:

Rstan 2.16.2

R Version:

R 3.4.2

Operating System:

Arch Linux gcc 7.2 (The compiler builds cmdstan and Rcpp successfully)

bfredl commented 6 years ago

It turns out installation works fine (almost, a compilator error that could be silenced with -fpermissive) if all the commands on the wiki page is execuded in sudo R instead of R. Is this intentional? Still, I would expect an error message like "permission denied" rather than absolute silence.

sakrejda commented 6 years ago

Can you check where files are written that's inappropriate?

On Thu, Nov 16, 2017, 12:16 PM Björn Linse notifications@github.com wrote:

It turns out installation works fine (almost, a compilator error that could be silenced with -fpermissive) if all the commands on the wiki page is execuded in sudo R instead of R. Is this intentional? Still, I would expect an error message like "permission denied" rather than absolute silence.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstan/issues/466#issuecomment-344993814, or mute the thread https://github.com/notifications/unsubscribe-auth/AAfA6basLMxepXb3CPfFc-Xx5xYLyEQKks5s3G31gaJpZM4QdPw_ .

bfredl commented 6 years ago

I tried again with strace, but user building does not fail anymore with sudo package in place. I guess some file now exists so it does not try/need to create it. I might try later on another arch computer from scratch.

sakrejda commented 6 years ago

It would be great if you manage to find the problem, that's bizarre behavior.

On Thu, Nov 16, 2017 at 1:33 PM Björn Linse notifications@github.com wrote:

I tried again with strace, but user building does not fail anymore with sudo package in place. I guess some file now exists so it does not try/need to create it. I might try later on another arch computer from scratch.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstan/issues/466#issuecomment-345015659, or mute the thread https://github.com/notifications/unsubscribe-auth/AAfA6VtXMZwB7H_UfP4V-wG-mfGZCJuYks5s3H_lgaJpZM4QdPw_ .