stan-dev / stan-dev/rstan

failure to compile models on Win 10

Open
#960 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
1.1k
Forks
266
Avg merge
2h 56m
Merged PRs (30d)
1

Description

Summary:

Please provide a short summary (no more than a sentence or two).
failure to compile brms models

Description:

Describe the issue as clearly as possible.

Reproducible Steps:

Please report steps to reproduce the issue. If it's not possible to reproduce, please include a description of how you discovered the issue.

Hi I ran a simple model using brms, with the following code and I copied the output in the console:

intercept_mdl <- brm(F0 ~ 1, data=pitch)

If you have a reproducible example, please include it.

Current Output:

If applicable, any relevant output from RStan.
Compiling Stan program...
make cmd is
make -f "C:/PROGRA1/R/R-4.0.3/etc/x64/Makeconf" -f "C:/PROGRA1/R/R-4.0.3/share/make/winshlib.mk" -f "C:/Users/Veronica/Documents/.R/Makevars.win" CXX='$(CXX14) $(CXX14STD)' CXXFLAGS='$(CXX14FLAGS)' CXXPICFLAGS='$(CXX14PICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX14LDFLAGS)' SHLIB_LD='$(SHLIB_CXX14LD)' SHLIB="file61085bab729c.dll" WIN=64 TCLBIN=64 OBJECTS="file61085bab729c.o"

make would use
"C:/rtools40/mingw64/bin/"g++ -std=gnu++14 -I"C:/PROGRA1/R/R-4.0.3/include" -DNDEBUG -I"C:/Users/Veronica/Documents/R/win-library/4.0/Rcpp/include/" -I"C:/Users/Veronica/Documents/R/win-library/4.0/RcppEigen/include/" -I"C:/Users/Veronica/Documents/R/win-library/4.0/RcppEigen/include/unsupported" -I"C:/Users/Veronica/Documents/R/win-library/4.0/BH/include" -I"C:/Users/Veronica/Documents/R/win-library/4.0/StanHeaders/include/src/" -I"C:/Users/Veronica/Documents/R/win-library/4.0/StanHeaders/include/" -I"C:/Users/Veronica/Documents/R/win-library/4.0/RcppParallel/include/" -I"C:/Users/Veronica/Documents/R/win-library/4.0/rstan/include" -DEIGEN_NO_DEBUG -DBOOST_DISABLE_ASSERTS -DBOOST_PENDING_INTEGER_LOG2_HPP -DSTAN_THREADS -DBOOST_NO_AUTO_PTR -include "C:/Users/Veronica/Documents/R/win-library/4.0/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp" -std=c++1y -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c file61085bab729c.cpp -o file61085bab729c.o
if test "zfile61085bab729c.o" != "z"; then
if test -e "file61085bab729c-win.def"; then
echo "C:/rtools40/mingw64/bin/"g++ -shared -s -static-libgcc -o file61085bab729c.dll file61085bab729c-win.def file61085bab729c.o "C:/Users/Veronica/Documents/R/win-library/4.0/rstan/lib/x64/libStanServices.a" -L"C:/Users/Veronica/Documents/R/win-library/4.0/StanHeaders/libs/x64" -lStanHeaders -L"C:/Users/Veronica/Documents/R/win-library/4.0/RcppParallel/lib/x64" -ltbb -L"C:/PROGRA
1/R/R-4.0.3/bin/x64" -lR ;
"C:/rtools40/mingw64/bin/"g++ -shared -s -static-libgcc -o file61085bab729c.dll file61085bab729c-win.def file61085bab729c.o "C:/Users/Veronica/Documents/R/win-library/4.0/rstan/lib/x64/libStanServices.a" -L"C:/Users/Veronica/Documents/R/win-library/4.0/StanHeaders/libs/x64" -lStanHeaders -L"C:/Users/Veronica/Documents/R/win-library/4.0/RcppParallel/lib/x64" -ltbb -L"C:/PROGRA1/R/R-4.0.3/bin/x64" -lR ;
else
echo EXPORTS > tmp.def;
"C:/rtools40/mingw64/bin/"nm file61085bab729c.o | sed -n 's/^.* [BCDRT] / /p' | sed -e '/[.]refptr[.]/d' -e '/[.]weak[.]/d' | sed 's/[^ ][^ ]*/"&"/g' >> tmp.def;
echo "C:/rtools40/mingw64/bin/"g++ -shared -s -static-libgcc -o file61085bab729c.dll tmp.def file61085bab729c.o "C:/Users/Veronica/Documents/R/win-library/4.0/rstan/lib/x64/libStanServices.a" -L"C:/Users/Veronica/Documents/R/win-library/4.0/StanHeaders/libs/x64" -lStanHeaders -L"C:/Users/Veronica/Documents/R/win-library/4.0/RcppParallel/lib/x64" -ltbb -L"C:/PROGRA
1/R/R-4.0.3/bin/x64" -lR ;
"C:/rtools40/mingw64/bin/"g++ -shared -s -static-libgcc -o file61085bab729c.dll tmp.def file61085bab729c.o "C:/Users/Veronica/Documents/R/win-library/4.0/rstan/lib/x64/libStanServices.a" -L"C:/Users/Veronica/Documents/R/win-library/4.0/StanHeaders/libs/x64" -lStanHeaders -L"C:/Users/Veronica/Documents/R/win-library/4.0/RcppParallel/lib/x64" -ltbb -L"C:/PROGRA1/R/R-4.0.3/bin/x64" -lR ;
rm -f tmp.def;
fi
fi
Error in compileCode(f, code, language = language, verbose = verbose) :
from C:/Users/Veronica/Documents/R/win-library/4.0/StanHeaders/include/src/stan/model/model_header.hpp:4, from file61085bab729c.cpp:14:C:/Users/Veronica/Documents/R/win-library/4.0/StanHeaders/include/stan/math/rev/core/set_zero_all_adjoints.hpp:14:13: warning: 'void stan::math::set_zero_all_adjoints()' defined but not used [-Wunused-function] static void set_zero_all_adjoints() { ^~~~~~~~~~~~~~~~~~~~~make: *** [C:/PROGRA
1/R/R-4.0.3/etc/x64/Makeconf:229: file61085bab729c.o] Error 1
In addition: Warning message:
In system(paste(CXX, ARGS), ignore.stdout = TRUE, ignore.stderr = TRUE) :
'C:/rtools40/usr/mingw_/bin/g++' not found
Error in sink(type = "output") : invalid connection

Expected Output:

If applicable, the output you expected from RStan.
compiled model

RStan Version:

The version of RStan you are running (e.g., from packageVersion("rstan"))
2.21.2

R Version:

The version of R you are running (e.g., from R.version.string)
4.0.3

Operating System:

Your operating system (e.g., OS X 10.11.3)
devtools::session_info("rstan")

  • Session info ------------------------------------------
    setting value
    version R version 4.0.3 (2020-10-10)
    os Windows 10 x64
    system x86_64, mingw32
    ui RStudio
    language (EN)
    collate Chinese (Simplified)_China.936
    ctype Chinese (Simplified)_China.936
    tz Europe/London
    date 2021-08-25

  • Packages ----------------------------------------------
    ! package * version date lib source
    backports 1.2.0 2020-11-02 [1] CRAN (R 4.0.3)
    BH 1.72.0-3 2020-01-08 [1] CRAN (R 4.0.0)
    brio 1.1.0 2020-08-31 [1] CRAN (R 4.0.3)
    callr 3.7.0 2021-04-20 [1] CRAN (R 4.0.5)
    checkmate 2.0.0 2020-02-06 [1] CRAN (R 4.0.0)
    cli 2.5.0 2021-04-26 [1] CRAN (R 4.0.5)
    colorspace 1.4-1 2019-03-18 [1] CRAN (R 4.0.0)
    crayon 1.4.1 2021-02-08 [1] CRAN (R 4.0.5)
    curl 4.3 2019-12-02 [1] CRAN (R 4.0.0)
    desc 1.3.0 2021-03-05 [1] CRAN (R 4.0.5)
    diffobj 0.3.2 2020-10-05 [1] CRAN (R 4.0.3)
    digest 0.6.27 2020-10-24 [1] CRAN (R 4.0.3)
    ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.0.5)
    evaluate 0.14 2019-05-28 [1] CRAN (R 4.0.0)
    fansi 0.4.1 2020-01-08 [1] CRAN (R 4.0.0)
    farver 2.0.3 2020-01-16 [1] CRAN (R 4.0.0)
    ggplot2 * 3.3.5 2021-06-25 [1] CRAN (R 4.0.5)
    glue 1.4.2 2020-08-27 [1] CRAN (R 4.0.3)
    gridExtra 2.3 2017-09-09 [1] CRAN (R 4.0.0)
    gtable 0.3.0 2019-03-25 [1] CRAN (R 4.0.0)
    V inline 0.3.17 2021-05-31 [1] CRAN (R 4.0.5)
    isoband 0.2.3 2020-12-01 [1] CRAN (R 4.0.3)
    jsonlite 1.7.2 2020-12-09 [1] CRAN (R 4.0.5)
    labeling 0.4.2 2020-10-20 [1] CRAN (R 4.0.3)
    lattice 0.20-41 2020-04-02 [2] CRAN (R 4.0.3)
    lifecycle 1.0.0 2021-02-15 [1] CRAN (R 4.0.5)
    loo 2.4.1 2020-12-09 [1] CRAN (R 4.0.3)
    magrittr 2.0.1 2020-11-17 [1] CRAN (R 4.0.3)
    MASS 7.3-53 2020-09-09 [2] CRAN (R 4.0.3)
    Matrix 1.2-18 2019-11-27 [2] CRAN (R 4.0.3)
    matrixStats 0.57.0 2020-09-25 [1] CRAN (R 4.0.3)
    mgcv 1.8-33 2020-08-27 [2] CRAN (R 4.0.3)
    munsell 0.5.0 2018-06-12 [1] CRAN (R 4.0.0)
    nlme 3.1-149 2020-08-23 [2] CRAN (R 4.0.3)
    pillar 1.6.1 2021-05-16 [1] CRAN (R 4.0.3)
    pkgbuild 1.2.0 2020-12-15 [1] CRAN (R 4.0.3)
    pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.0.0)
    pkgload 1.2.1 2021-04-06 [1] CRAN (R 4.0.5)
    praise 1.0.0 2015-08-11 [1] CRAN (R 4.0.0)
    prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.0.0)
    processx 3.5.2 2021-04-30 [1] CRAN (R 4.0.5)
    ps 1.4.0 2020-10-07 [1] CRAN (R 4.0.3)
    R6 2.5.0 2020-10-28 [1] CRAN (R 4.0.3)
    RColorBrewer 1.1-2 2014-12-07 [1] CRAN (R 4.0.0)
    Rcpp * 1.0.7 2021-07-07 [1] CRAN (R 4.0.5)
    RcppEigen 0.3.3.9.1 2020-12-17 [1] CRAN (R 4.0.3)
    D RcppParallel 5.0.2 2020-06-24 [1] CRAN (R 4.0.3)
    rematch2 2.1.2 2020-05-01 [1] CRAN (R 4.0.0)
    rlang 0.4.11 2021-04-30 [1] CRAN (R 4.0.5)
    rprojroot 2.0.2 2020-11-15 [1] CRAN (R 4.0.3)
    rstan * 2.21.2 2020-07-27 [1] CRAN (R 4.0.3)
    rstudioapi 0.13 2020-11-12 [1] CRAN (R 4.0.3)
    scales 1.1.1 2020-05-11 [1] CRAN (R 4.0.0)
    StanHeaders * 2.21.0-6 2020-08-16 [1] CRAN (R 4.0.3)
    testthat 3.0.2 2021-02-14 [1] CRAN (R 4.0.5)
    tibble * 3.1.1 2021-04-18 [1] CRAN (R 4.0.5)
    utf8 1.1.4 2018-05-24 [1] CRAN (R 4.0.0)
    V8 3.4.0 2020-11-04 [1] CRAN (R 4.0.3)
    vctrs 0.3.8 2021-04-29 [1] CRAN (R 4.0.5)
    viridisLite 0.3.0 2018-02-01 [1] CRAN (R 4.0.0)
    waldo 0.2.5 2021-03-08 [1] CRAN (R 4.0.5)
    withr 2.4.2 2021-04-18 [1] CRAN (R 4.0.5)

[1] C:/Users/Documents/R/win-library/4.0
[2] C:/Program Files/R/R-4.0.3/library

V -- Loaded and on-disk version mismatch.
D -- DLL MD5 mismatch, broken installation.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with the brm(F0 ~ 1, data=pitch) reproduction and the compiler output, especially the reported missing g++ path. Compare the R 4.0.3/RStan 2.21.2 Windows setup shown here with the project's supported toolchain; done means the same model compiles successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, r
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.