R studio g++ 问题

问题描述

实际上,当我运行脚本时,它给了我附加的错误。 已尝试重新安装 rstan 包并检查权限,但问题仍然存在。

在屏幕截图上,它说 g++ 文件不存在,但当我检查它时,它在那里,但它的内容非常不可读。

我在控制台上执行此行时遇到的错误

BasicModel6 = stan(file = "Zuricmodel.stan",data = list(nAgents = nAgents,
> sh: /home/Zuric/gcc5/bin/g++ -std=c++1y -fPIC: No such file or directory
The NEXT version of Stan will not be able to pre-process your Stan program.
Please open an issue at
 https://github.com/stan-dev/stanc3/issues 
if you can share or at least describe your Stan program. This will help ensure that Stan
continues to work on your Stan programs in the future. Thank you!
This message can be avoided by wrapping your function call inside suppressMessages().
Error in dyn.load(libLFile) : 
  unable to load shared object '/tmp/RtmpCJz6BL/file44e0333f2bb3.so':
  /tmp/RtmpCJz6BL/file44e0333f2bb3.so: undefined symbol: _ZN5rstan8stan_fitC1EP7SEXPRECi
In addition: Warning messages:
1: In system2(CXX,args = ARGS) : error in running command
2: In file.remove(c(unprocessed,processed)) :
  cannot remove file '/tmp/RtmpCJz6BL/file44e075ca3a78.stan',reason 'No such file or directory'
Error in sink(type = "output") : invalid connection

您可以在此处找到我的 Makevars 文件内容

CXX14 = /home/satmapai/gcc5/bin/g++ -std=c++1y -fPIC
CXX14STD = -std=c++1y -fPIC
CXX14FLAGS=-O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -std=c++1y -fPIC
CXX14FLAGS+=-flto -Wno-unused-local-typedefs -Wno-ignored-attributes -Wno-deprecated-declarations
CXXFLAGS=-std=c++1y -fPIC

#CXX14FLAGS=-O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -std=c++11 -fPIC
#CXX14 = g++
#CXX14FLAGS+=-flto -Wno-unused-local-typedefs -Wno-ignored-attributes -Wno-deprecated-declarations
#CXXFLAGS=-std=c++11 -fPIC

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)