2017-08-16 100 views
0

我想安装rgl,因为另一个包需要它的某些元素。我在Mac上运行XQuartz,因为我正在使用MRAN R.安装(从Rstudio中的CRAN,Rstudio中的shell以及其他源中)安装失败,并显示以下错误。R包RGL无法安装在带有MRAN的Mac上

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和安装时,我没有得到这些错误。 ubuntu不使用MRAN,所以我想这可能是mac上的问题的根源,但是这个来自微软的页面 - https://mran.microsoft.com/web/checks/check_results_rgl.html似乎表明rgl在MAC上运行MRAN。

+0

您可以将错误发布到MRAN的Github页面,或者仅使用来自CRAN的R.我听说过(但没有亲自证实)MRAN不正确地处理C++,并且使用C++的许多软件包都存在问题。 – user2554330

+0

几周前我在MRAN社区网站上发布了一个查询,并在昨天更新了它。没有回应。我找不到MRAN的GitHub页面。我一直在使用MRAN一段时间,并没有任何MRAN特定的问题,至少我可以记录。 – JerryN

+0

我想到的Github页面是https://github.com/Microsoft/microsoft-r-open,不完全是MRAN。 – user2554330

回答

1

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

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

+0

这是我使用的过程。从'https://r-forge.r-project.org/R/?group_id = 234'下载'rgl_0.98.13.tar.gz',并将其放在我的项目目录的根目录下。然后运行'install.packages(“rgl_0.98.13.tar.gz”,repos = NULL)'。似乎已经工作。谢谢! – JerryN