Brms compiling error - no such file or directory, invalid connection

#1

Operating System: Windows 10
brms Version: 2.8.0
R version: 3.5.3, installed under C:\Program Files\R
Rtools 3.5 is installed under C:\Rtools

I’m getting this error when compiling a model (that works on other computers):

Compiling the C++ model
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! file2b83e9c5ba8.cpp:8:39: fatal error: stan/model/model_header.hpp: No such file or directory
#include <stan/model/model_header.hpp>
^
compilation terminated.
make: *** [C:/PROGRA~1/R/R-35~1.3/etc/x64/Makeconf:215: file2b83e9c5ba8.o] Error 1
In addition: Warning message:
In system(cmd, intern = !verbose) :
running command ‘C:/PROGRA~1/R/R-35~1.3/bin/x64/R CMD SHLIB file2b83e9c5ba8.cpp 2> file2b83e9c5ba8.cpp.err.txt’ had status 1
Error in sink(type = “output”) : invalid connection

Any ideas how to fix it?
Thanks,

Gareth

0 Likes

#2

It can’t find StanHeaders. I would try

install.packages("StanHeaders")

in a clean R session.

0 Likes

#3

Thanks.
I should have mentioned I have tried this before and it does not help.
It installed the package in a different place to where brms installed itself though, which could be my problem. I’ll try setting the library path to match where brms was installed and reinstalling StanHeaders.

0 Likes

#4

This does not work. Every time I try to set the path to install to I get an error that says it is not writable.

0 Likes

#5

You may have to alter the order of

.libPaths()

to get everything to find everything else if you installed packages in a bunch of different places.

0 Likes

#6

Ok thanks. The only thing I have installed though is brms, and then StanHeaders because brms didn’t work. So should make it easier I suppose.

0 Likes

#7

I’ve installed everything into the same place and it still comes up with the same error.

0 Likes

#8

The fourth person I spoke to in IT managed to fix it. It was a permissions error to do with security defaults in windows 10 for computer on a network. The solution was to specify to install into Program files rather than the default path on the network, and to set RStudio to always run as admin so that it can write into Program files.

0 Likes

#9

OK. Glad you got it fixed.

0 Likes