stan-dev / rstan

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

CRAN & Conda Forge builds fail on Windows R 4.1 #1043

Closed mfansler closed 1 year ago

mfansler commented 1 year ago

Summary:

v2.21.8 does not build on Windows R 4.1.3.

Description:

Both the CRAN submission and the latest Conda Forge CI fail while compiling the grammar_inst.cpp.

Reproducible Steps:

See CRAN logs (unfortunately this not a persistent link). See Conda Forge logs (note this will only persist for 30 days).

Current Output:

CRAN fails with:

cc1plus.exe: out of memory allocating 65536 bytes
make[1]: *** [D:/RCompile/recent/R-4.1.3/etc/i386/Makeconf:245: grammar_inst.o] Error 1

Conda Forge is a bit more specific

In file included from grammar_inst.cpp:2:0:
./stan/lang/grammars/block_var_decls_grammar_def.hpp: In constructor 'stan::lang::block_var_decls_grammar<Iterator>::block_var_decls_grammar(stan::lang::variable_map&, std::stringstream&) [with Iterator = boost::spirit::line_pos_iterator<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > >; std::stringstream = std::__cxx11::basic_stringstream<char>]':
./stan/lang/grammars/block_var_decls_grammar_def.hpp:78:1: internal compiler error: Segmentation fault
 block_var_decls_grammar<Iterator>::block_var_decls_grammar(
 ^
libbacktrace could not find executable to open
make: *** [grammar_inst.o] Error 1

Expected Output:

Compilation should work.

RStan Version:

2.21.8

R Version:

CRAN: 4.1.3 (2022-03-10) Conda Forge: r-base=4.1.3=hdca333a_5

Operating System:

CRAN: Windows Server 2008 (64-bit) Conda Forge: Microsoft Windows Server 2022 (10.0.20348)

andrjohns commented 1 year ago

The current CRAN rstan cannot be installed from source on R 4.1.x.

You have three options:

mfansler commented 1 year ago

@andrjohns Does this imply a future release will again support R 4.1 on Windows? Is there already a patch in development branch that we could apply that addresses the underlying issue?

Please note, I am asking as a Conda Forge maintainer delivering builds for others, not as an end user. As I interpret, we should simply skip a Windows R 4.1 build for this release.

andrjohns commented 1 year ago

The issue is that compilation currently uses too much memory for 32-bit builds, but this will not be an issue in the next release.

You can either skip the 4.1 build for this release, or only build binaries for 64-bit (which is what CRAN currently does)