installing brms and rstan in Windows

140 views
Skip to first unread message

Robert Lennox

unread,
Mar 5, 2018, 10:25:15 AM3/5/18
to brms-users
Hi- I am using R version 3.4.3 and installing RStan following instructions listed here: https://github.com/stan-dev/rstan/wiki/Installing-RStan-on-Windows#toolchain and am unsuccessful in initializing brms, which I believe is associated with an inability to compile the C++ data through the RTools program. Any advice for how to resolve this issue would be appreciated. I hope that my description of the errors is thorough and will allow someone familiar with the issue to point out my problem.

I have installed toolchain with RTools into my C:/ drive and have selected the path box. 

When I check Sys.getenv('PATH') it does not include the gcc line as mentioned in the instructions (beginning of output below)

 "C:\\Rtools\\bin;C:\\Program Files\\R\\R-3.4.3\\bin\\x64;c:\\Rtools\\bin;c:\\Rtools\\mingw_32 [...]

Checking system('g++ -v') provides a long summary that does not exactly match the output suggested on the site

Using built-in specs.
COLLECT_GCC=c:\Rtools\mingw_32\bin\G__~1.EXE
COLLECT_LTO_WRAPPER=c:/Rtools/mingw_32/bin/../libexec/gcc/i686-w64-mingw32/4.9.3/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: ../../../src/gcc-4.9.3/configure --host=i686-w64-mingw32 --build=i686-w64-mingw32 --target=i686-w64-mingw32 --prefix=/mingw32 --with-sysroot=/home/Jeroen/mingw-gcc-4.9.3/i686-493-posix-dwarf-rt_v3-s/mingw32 --with-gxx-include-dir=/mingw32/i686-w64-mingw32/include/c++ --enable-static --disable-shared --disable-multilib --enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-sjlj-exceptions --with-dwarf2 --disable-isl-version-check --disable-cloog-version-check --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=i686 --with-tune=generic --with-libiconv --with-system-zlib --with-gmp=/home/Jeroen/mingw-gcc-4.9.3/prerequisites/i686-w64-mingw32-static --with-mpfr=/home/Jeroen/mingw-gcc-4.9.3/prerequisites/i686-w64-mingw32-static --with-mpc=/home/Jeroen/mingw-gcc-4.9.3/prerequisites/i686-w64-mingw32-static --with-isl=/home/Jeroen/mingw-gcc-4.9.3/prerequisites/i686-w64-mingw32-static --with-cloog=/home/Jeroen/mingw-gcc-4.9.3/prerequisites/i686-w64-mingw32-static --enable-cloog-backend=isl --with-pkgversion='i686-posix-dwarf, Built by MinGW-W64 project' --with-bugurl=http://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -I/home/Jeroen/mingw-gcc-4.9.3/i686-493-posix-dwarf-rt_v3-s/mingw32/opt/include -I/home/Jeroen/mingw-gcc-4.9.3/prerequisites/i686-zlib-static/include -I/home/Jeroen/mingw-gcc-4.9.3/prerequisites/i686-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -I/home/Jeroen/mingw-gcc-4.9.3/i686-493-posix-dwarf-rt_v3-s/mingw32/opt/include -I/home/Jeroen/mingw-gcc-4.9.3/prerequisites/i686-zlib-static/include -I/home/Jeroen/mingw-gcc-4.9.3/prerequisites/i686-w64-mingw32-static/include' CPPFLAGS= LDFLAGS='-pipe -L/home/Jeroen/mingw-gcc-4.9.3/i686-493-posix-dwarf-rt_v3-s/mingw32/opt/lib -L/home/Jeroen/mingw-gcc-4.9.3/prerequisites/i686-zlib-static/lib -L/home/Jeroen/mingw-gcc-4.9.3/prerequisites/i686-w64-mingw32-static/lib -Wl,--large-address-aware'
Thread model: posix
gcc version 4.9.3 (i686-posix-dwarf, Built by MinGW-W64 project) 

I have not created a personal MakeVars file because I cannot figure out how

When I check if toolchain is working following this code: 

fx <- inline::cxxfunction( signature(x = "integer", y = "numeric" ) , '
return ScalarReal( INTEGER(x)[0] * REAL(y)[0] ) ;
' )

It returns the following error:

Error in compileCode(f, code, language = language, verbose = verbose) : 
  Compilation ERROR, function(s)/method(s) not created! C:\Rtools\mingw_64\bin\nm.exe: file26481be4617a.o: plugin needed to handle lto object
Cannot export __gnu_lto_slim: symbol not defined
Cannot export __gnu_lto_v1: symbol not defined
collect2.exe: error: ld returned 1 exit status

When I try to run an example brm this is the error:

Compiling the C++ model
Error in compileCode(f, code, language = language, verbose = verbose) : 
  Compilation ERROR, function(s)/method(s) not created! In file included from C:/Users/Robert/Documents/R/win-library/3.4/BH/include/boost/config.hpp:39:0,
                 from C:/Users/Robert/Documents/R/win-library/3.4/BH/include/boost/math/tools/config.hpp:13,
                 from C:/Users/Robert/Documents/R/win-library/3.4/StanHeaders/include/stan/math/rev/core/var.hpp:7,
                 from C:/Users/Robert/Documents/R/win-library/3.4/StanHeaders/include/stan/math/rev/core/gevv_vvv_vari.hpp:5,
                 from C:/Users/Robert/Documents/R/win-library/3.4/StanHeaders/include/stan/math/rev/core.hpp:12,
                 from C:/Users/Robert/Documents/R/win-library/3.4/StanHeaders/include/stan/math/rev/mat.hpp:4,
                 from C:/Users/Robert/Documents/R/win-library/3.4/StanHeaders/include/stan/math.hpp:4,
                 from C:/Users/Robert/Documents/R/win-library/3.4/StanHeaders/include/src/stan/model/model_header.hpp:4,
                 from file26483f9c183

Regards,

Robert

Paul Buerkner

unread,
Mar 5, 2018, 10:26:41 AM3/5/18
to Robert Lennox, brms-users
I suggest you ask this question on the Stan forums (http://discourse.mc-stan.org/), because this is not a brms related issue.

--
You received this message because you are subscribed to the Google Groups "brms-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brms-users+unsubscribe@googlegroups.com.
To post to this group, send email to brms-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brms-users/726c748c-8dca-4aef-a541-7f0d32ea1cbc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages