Compilation ERROR, function(s)/method(s) not created

371 views
Skip to first unread message

Dmitry Onishchenko

unread,
Sep 27, 2016, 10:57:46 AM9/27/16
to Stan users mailing list
Hi, I'm trying to run the 'Rats' demo example in RStan and get compile errors.

My working directory "C:/Users/kkzp510/Documents/Stan/Test examples" contains rats.txt and rats.stan files ( which are directly downloaded from https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started#how-to-use-rstan ) and rats.r file which looks as follows:

y = read.table('rats.txt', header = TRUE)
x
= c(8, 15, 22, 29, 36)
xbar
= mean(x)
N
= nrow(y)
T
= ncol(y)
rats_fit
= stan(file = 'rats.stan', verbose = TRUE)


Running rats.r, I'm getting the following message:

Error in compileCode(f, code, language = language, verbose = verbose) :
 
Compilation ERROR, function(s)/method(s) not created! C:\Users\kkzp510\AppData\Local\Temp\ccnnCXR4.s: Assembler messages:
C
:\Users\kkzp510\AppData\Local\Temp\ccnnCXR4.s:8149: Error: no such instruction: `vfnmadd312sd (%r11),%xmm1,%xmm0'
C:\Users\kkzp510\AppData\Local\Temp\ccnnCXR4.s:8181: Error: no such instruction: `
vfnmadd312sd (%r8),%xmm1,%xmm0'
C:\Users\kkzp510\AppData\Local\Temp\ccnnCXR4.s:8794: Error: no such instruction: `vfmadd312sd 0(%rbp,%r10,8),%xmm5,%xmm4'

C
:\Users\kkzp510\AppData\Local\Temp\ccnnCXR4.s:8797: Error: no such instruction: `vfmadd312sd (%r9,%r10,8),%xmm5,%xmm3'
C:\Users\kkzp510\AppData\Local\Temp\ccnnCXR4.s:8799: Error: no such instruction: `
vfmadd312sd (%rsi,%r10,8),%xmm5,%xmm2'
C:\Users\kkzp510\AppData\Local\Temp\ccnnCXR4.s:8801: Error: no such instruction: `vfmadd312sd (%rbx,%r10,8),%xmm5,%xmm1'

C
:\Users\kkzp510\AppData\Local\Temp\ccnnCXR4.s:8967: Error: no such instruction: `vfmadd312sd (%rsi,%r8,8),%xmm5,%xmm0'
C:\Users\kkzp510\AppData\Local\Temp
In addition: Warning message:
running command 'C:/Users/kkzp510/DOCUME~1/R/R-32~1.5/bin/x64/R CMD SHLIB filef604fa2f64.cpp 2> filef604fa2f64.cpp.err.txt' had status 1

Could you please assist in fixing this?

Versions in use: R 3.2.5, Rtools 32, RStudio 0.99.467, gcc 4.6.3
> system('g++ -v')
Using built-in specs.
COLLECT_GCC
=c:\Rtools\GCC-46~1.3\bin\G__~1.EXE
COLLECT_LTO_WRAPPER
=c:/rtools/gcc-46~1.3/bin/../libexec/gcc/i686-w64-mingw32/4.6.3/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: /data/gannet/ripley/Sources/mingw-test3/src/gcc/configure --host=i686-w64-mingw32 --build=x86_64-linux-gnu --target=i686-w64-mingw32 --with-sysroot=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/mingw32 --prefix=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/mingw32 --with-gmp=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/prereq_install --with-mpfr=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/prereq_install --with-mpc=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/prereq_install --disable-shared --enable-static --enable-targets=all --enable-languages=c,c++,fortran --enable-libgomp --enable-sjlj-exceptions --enable-fully-dynamic-string --disable-nls --disable-werror --enable-checking=release --disable-win32-registry --disable-rpath --disable-werror CFLAGS='-O2 -mtune=core2 -fomit-frame-pointer' LDFLAGS=
Thread model: win32
gcc version
4.6.3 20111208 (prerelease) (GCC)

Toolchain diagnostics seems to work ok:
> fx <- inline::cxxfunction( signature(x = "integer", y = "numeric" ) , '
+     return ScalarReal( INTEGER(x)[0] * REAL(y)[0] ) ;
+                            '
)
> fx( 2L, 5 ) # should be 10
[1] 10

Thanks,
Dmitry

Ben Goodrich

unread,
Sep 27, 2016, 11:29:44 AM9/27/16
to Stan users mailing list
On Tuesday, September 27, 2016 at 10:57:46 AM UTC-4, Dmitry Onishchenko wrote:
Could you please assist in fixing this?
 
Remove the "-mtune=native -march=native" out of the CXXFLAGS line of the file that is returned by

normalizePath("~/.R/Makevars")

Ben

Dmitry Onishchenko

unread,
Sep 27, 2016, 1:31:54 PM9/27/16
to Stan users mailing list
It works. Thanks a lot Ben!

вторник, 27 сентября 2016 г., 18:29:44 UTC+3 пользователь Ben Goodrich написал:
Reply all
Reply to author
Forward
0 new messages