在 Rccp 中编译 c++ 时缺少头文件/模板文件 c++ Big Sur

问题描述

我对 C++ 一无所知,但是当我尝试编译 brms 模型时,我收到错误消息。同样,当我编译 Rstan 程序时,会发生完全相同的事情。大部分时间我都剩下:

Error in compileCode(f,code,language = language,verbose = verbose) : 
  /Library/Developer/CommandLinetools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:653:25: error: no template named 'numeric_limits'  return _FloatBigger ? numeric_limits<_IntT>::max() :  (numeric_limits<_IntT>::max() >> _Bits << _Bits);                        ^Fatal error: too many errors emitted,stopping Now [-ferror-limit=]20 errors generated.make: *** [file101515b125541.o] Error 1

同样,如果我从源代码安装库,我会收到 samme 错误消息(或另一个标题丢失)。到目前为止,我已经尝试在没有任何帮助的情况下删除并重新安装命令行工具(多次),并且我尝试了 this SO approach 没有任何帮助。除了以上这些我还能做什么?

我使用的是 Big Sur 11.4(英特尔),R 4.1.0。

❯ clang++ -Wp,-v -E -                                                                                                                                        ─╯
clang -cc1 version 12.0.5 (clang-1205.0.22.11) default target x86_64-apple-darwin20.5.0
ignoring nonexistent directory "/Library/Developer/CommandLinetools/SDKs/MacOSX.sdk/usr/local/include"
ignoring nonexistent directory "/Library/Developer/CommandLinetools/SDKs/MacOSX.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /Library/Developer/CommandLinetools/usr/lib/clang/12.0.5/include
 /Library/Developer/CommandLinetools/SDKs/MacOSX.sdk/usr/include
 /Library/Developer/CommandLinetools/usr/include
 /Library/Developer/CommandLinetools/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory) 

我目前在没有任何 Makevars 文件的情况下运行,但我曾经运行过这个:

FLIBS=-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin19/10.2.0 -L/usr/local/gfortran/lib -lgfortran -lquadm$
CXX1X=/usr/local/gfortran/bin/g++
CXX98=/usr/local/gfortran/bin/g++
CXX11=/usr/local/gfortran/bin/g++
CXX14=/usr/local/gfortran/bin/g++
CXX17=/usr/local/gfortran/bin/g++

LLVM_LOC = /usr/local/opt/llvm
CC=/usr/local/gfortran/bin/gcc -fopenmp
CXX=/usr/local/gfortran/bin/g++ -fopenmp
CFLAGS=-g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe
CXXFLAGS=-g -O3 -Wall -pedantic -std=c++11 -mtune=native -pipe
LDFLAGS=-L/usr/local/opt/gettext/lib -L$(LLVM_LOC)/lib -Wl,-rpath,$(LLVM_LOC)/lib
CPPFLAGS=-I/usr/local/opt/gettext/include -I$(LLVM_LOC)/include -I/Library/Developer/CommandLinetools/SDKs/Ma$

我的 Rprofile 也是空的。

解决方法

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

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

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