# Too many sections

**URL:** <https://discourse.mc-stan.org/t/too-many-sections/6261>\
**Category:** brms\
**Tags:** rstan\
**Created:** [October 29, 2018, 11:24am UTC](https://discourse.mc-stan.org/t/too-many-sections/6261 "2018-10-29T11:24:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![asaw123](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@asaw123](https://discourse.mc-stan.org/u/asaw123)\
**Post date:** [October 29, 2018, 11:24am UTC](https://discourse.mc-stan.org/t/too-many-sections/6261/1 "2018-10-29T11:24:27Z")

</div>

Please also provide the following information in addition to your question:

- Operating System: win10
- brms Version: 2.5.0

I have some problems with the package brms. It keep complaining that there are too many sections and the file is too big. I have 8GB RAM and ~100GB disk space and the model only takes a few computational resources. I should have space problem. For example,

fit2 ← brm(rating ~ period + carry + cs(treat), data = inhaler, family = sratio(“logit”), prior = set\_prior(“normal(0,5)”), chains = 2)

DIAGNOSTIC(S) FROM PARSER:

Info: left-hand side variable (name=p) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.

Info: left-hand side variable (name=p) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.

Compiling the C++ model

DIAGNOSTIC(S) FROM PARSER:

Info: left-hand side variable (name=p) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.

Info: left-hand side variable (name=p) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.

Error in compileCode(f, code, language = language, verbose = verbose) :

Compilation ERROR, function(s)/method(s) not created! C:/Rtools/mingw\_64/bin/…/lib/gcc/x86\_64-w64-mingw32/4.9.3/…/…/…/…/x86\_64-w64-mingw32/bin/as.exe: file15e8237e12ae.o: too many sections (37437)

C:\Users\CHARLE~1\AppData\Local\Temp\ccUqegdB.s: Assembler messages:

C:\Users\CHARLE~1\AppData\Local\Temp\ccUqegdB.s: Fatal error: can’t write file15e8237e12ae.o: File too big

C:/Rtools/mingw\_64/bin/…/lib/gcc/x86\_64-w64-mingw32/4.9.3/…/…/…/…/x86\_64-w64-mingw32/bin/as.exe: file15e8237e12ae.o: too many sections (37437)

C:\Users\CHARLE~1\AppData\Local\Temp\ccUqegdB.s: Fatal error: can’t close file15e8237e12ae.o: File too big

make: \*\*\* [C:/PROGRA~1/R/R-35~1.1/etc/x64/Makeconf:215: file15e8237e12ae.o] Error 1

In addition: Warning message:

In FUN(X[[i]], …) : restarting interrupted promise evaluation

I think I have installed the compiler and rstan properly because the following c++ and rstan commands work for me.

src ← ’

- std::vector \< std::string\> s;

- s.push\_back(“hello”);

- s.push\_back(“world”);

- return Rcpp::wrap(s);

- ’

hellofun ← cxxfunction(body = src, includes = ‘’, plugin = ‘Rcpp’, verbose = FALSE)

cat(hellofun(), ‘\n’)

hello world

and

fx ← inline::cxxfunction( signature(x = “integer”;, y = “numeric” ) , ’ return ScalarReal( INTEGER(x)[0] \* REAL(y)[0] ) ;’ ) fx( 2L, 5 ) # 10

Additional information, here are my sessionInfo  
R version 3.5.1 (2018-07-02)  
Platform: x86\_64-w64-mingw32/x64 (64-bit)  
Running under: Windows \>= 8 x64 (build 9200)

Matrix products: default

locale:  
[1] LC\_COLLATE=English\_United Kingdom.1252 LC\_CTYPE=English\_United Kingdom.1252  
[3] LC\_MONETARY=English\_United Kingdom.1252 LC\_NUMERIC=C  
[5] LC\_TIME=English\_United Kingdom.1252

attached base packages:  
[1] stats graphics grDevices utils datasets methods base

other attached packages:  
[1] brms\_2.5.0 Rcpp\_0.12.19 rstan\_2.18.1 StanHeaders\_2.18.0 ggplot2\_3.0.0

loaded via a namespace (and not attached):  
[1] Brobdingnag\_1.2-6 gtools\_3.8.1 threejs\_0.3.1 shiny\_1.1.0  
[5] assertthat\_0.2.0 stats4\_3.5.1 yaml\_2.2.0 backports\_1.1.2  
[9] pillar\_1.3.0 lattice\_0.20-35 glue\_1.3.0 digest\_0.6.17  
[13] promises\_1.0.1 colorspace\_1.3-2 htmltools\_0.3.6 httpuv\_1.4.5  
[17] Matrix\_1.2-14 plyr\_1.8.4 dygraphs\_1.1.1.6 pkgconfig\_2.0.2  
[21] purrr\_0.2.5 xtable\_1.8-3 mvtnorm\_1.0-8 scales\_1.0.0  
[25] processx\_3.2.0 later\_0.7.5 tibble\_1.4.2 bayesplot\_1.6.0  
[29] DT\_0.4 shinyjs\_1.0 withr\_2.1.2 lazyeval\_0.2.1  
[33] cli\_1.0.1 magrittr\_1.5 crayon\_1.3.4 mime\_0.5  
[37] ps\_1.2.0 nlme\_3.1-137 xts\_0.11-1 pkgbuild\_1.0.2  
[41] colourpicker\_1.0 rsconnect\_0.8.8 tools\_3.5.1 loo\_2.0.0  
[45] prettyunits\_1.0.2 matrixStats\_0.54.0 stringr\_1.3.1 munsell\_0.5.0  
[49] bindrcpp\_0.2.2 callr\_3.0.0 compiler\_3.5.1 rlang\_0.2.2  
[53] grid\_3.5.1 ggridges\_0.5.1 rstudioapi\_0.7 htmlwidgets\_1.3  
[57] crosstalk\_1.0.0 igraph\_1.2.2 miniUI\_0.1.1.1 base64enc\_0.1-3  
[61] gtable\_0.2.0 inline\_0.3.15 abind\_1.4-5 markdown\_0.8  
[65] reshape2\_1.4.3 R6\_2.2.2 gridExtra\_2.3 rstantools\_1.5.1  
[69] zoo\_1.8-4 bridgesampling\_0.5-2 dplyr\_0.7.6 shinythemes\_1.1.1  
[73] bindr\_0.1.1 shinystan\_2.5.0 stringi\_1.1.7 parallel\_3.5.1  
[77] tidyselect\_0.2.4 coda\_0.19-1

Here is my Path

> Sys.getenv()[“PATH”]  
> PATH C:\Program  
> Files\R\R-3.5.1\bin\x64;C:\Rtools\bin;C:\Rtools\mingw\_64\bin;C:\Perl\site\bin;C:\Perl\bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program  
> Files (x86)\QuickTime\QTSystem;C:\Program Files  
> (x86)\Skype\Phone;C:\Program  
> Files\PuTTY;C:\WINDOWS\System32\OpenSSH;C:\Program Files  
> (x86)\SSH Communications Security\SSH Secure  
> Shell;C:\Users\Charley  
> Work\AppData\Local\Microsoft\WindowsApps;C:\texlive\2017\bin\win3

And here is a part of my R makeconf

CXX14 = g++ -m$(WIN) -std=c++1y  
CXX14FLAGS = Wa, -mbig-obj  
CXX14PICFLAGS =  
CXX14STD =

Can anyone help me with this?  
Many thanks

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [October 29, 2018, 12:49pm UTC](https://discourse.mc-stan.org/t/too-many-sections/6261/2 "2018-10-29T12:49:55Z")

</div>

> [@asaw123](#):
>
> C:\Users\CHARLE~1\AppData\Local\Temp\ccUqegdB.s: Fatal error: can’t write file15e8237e12ae.o: File too big

In my experience, this is usually caused by not having `-O3` in `CXX14FLAGS` of the ~/.R/Makevars file. You might as well put it in `CXX11FLAGS` as well.

---

<div class="post-metadata">

**Author:** ![asaw123](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@asaw123](https://discourse.mc-stan.org/u/asaw123)\
**Post date:** [October 29, 2018, 1:02pm UTC](https://discourse.mc-stan.org/t/too-many-sections/6261/3 "2018-10-29T13:02:41Z")

</div>

Thanks. It works now. I have deleted R, Rtools and R libraries completely from the windows system and then re-installed everything in the following order R, Rtools and then rstan. Finally, I have added O3 in the makevars file (by default it was O2, i changed it to O3) for both Cxx11 and Cxx14 flags, it’s now working.

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [October 29, 2018, 2:16pm UTC](https://discourse.mc-stan.org/t/too-many-sections/6261/4 "2018-10-29T14:16:40Z")

</div>

Was the all that reinstalling actually necessary? Or can you make it compile or not just by switching the optimiziation level back and forth?
