R 包 RGL 无法安装在带有 MRAN 的 Mac 上

R package RGL fails to install on a Mac with MRAN

我正在尝试安装 rgl,因为另一个包需要它的一些元素。我在 Mac 上安装了 XQuartz 运行ning,因为我使用的是 MRAN R。安装(来自 Rstudio 中的 CRAN,来自 Rstudio 中的 shell 和其他来源)失败并出现以下错误.

    clang-omp++ -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/System/Library/Frameworks/OpenGL.framework/Headers  -DHAVE_PNG_H -I/Users/gcn/anaconda/include/libpng16 -I/usr/X11/include -DDarwin -DNO_GL_PREFIX -I/opt/X11/include -DHAVE_FREETYPE -Iext/ftgl -I/opt/X11/include/freetype2 -Iext  -I/Users/Shared/Jenkins/workspace/External-R-3.3.3/vendor/build/include -DU_STATIC_IMPLEMENTATION -Wall -mtune=core2 -g -O2 -I/opt/X11/include   -fPIC  -g -O3 -Wall -pedantic -mtune=native -std=c++11 -c platform.cpp -o platform.o
platform.cpp:38:18: error: no member named 'x' in '_GLKVector3'
      *winX = result.x;
              ~~~~~~ ^
    platform.cpp:39:18: error: no member named 'y' in '_GLKVector3'
      *winY = result.y;
              ~~~~~~ ^
    platform.cpp:40:18: error: no member named 'z' in '_GLKVector3'
      *winZ = result.z;
              ~~~~~~ ^
    platform.cpp:64:18: error: no member named 'x' in '_GLKVector3'
      *objX = result.x;
              ~~~~~~ ^
    platform.cpp:65:18: error: no member named 'y' in '_GLKVector3'
      *objY = result.y;
              ~~~~~~ ^
    platform.cpp:66:18: error: no member named 'z' in '_GLKVector3'
      *objZ = result.z;

我在 AWS 的 ubuntu 实例中也有一个 Rstudio 运行ning 版本,我在安装时没有遇到这些错误。 ubuntu 不使用 MRAN,所以我想问题的根源可能在 mac,但是 Microsoft 的这个页面 - https://mran.microsoft.com/web/checks/check_results_rgl.html 似乎建议 rgl 运行在 mac 上使用 MRAN。

您似乎设置了编译器定义 __STRICT_ANSI__。通常 rgl 不会设置它。 R-forge 上最新版本的 rgl (0.98.13) 已在您看到错误的 platform.cpp 文件中修复了此问题,但可能还有其他地方出现问题。

您可以在R-forge 上获取最新版本。它在 CRAN(或 MRAN)上不可用。