R OSX:ggraph安装错误

时间:2017-07-21 16:22:58

标签: r macos

我尝试从CRAN安装ggraph软件包

> install.packages("ggraph")

这是输出

Installing package into ‘/usr/local/lib/R/3.4/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/ggraph_1.0.0.tar.gz'
Content type 'application/x-gzip' length 2628485 bytes (2.5 MB)
==================================================
downloaded 2.5 MB

* installing *source* package ‘ggraph’ ...
** package ‘ggraph’ successfully unpacked and MD5 sums checked
** libs
/usr/local/opt/llvm/bin/clang++ -I/usr/local/Cellar/r/3.4.1_1/R.framework/Resources/include -DNDEBUG  -I"/usr/local/lib/R/3.4/site-library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include   -fPIC  -g -O3 -Wall -pedantic -std=c++11 -mtune=native -pipe -c RcppExports.cpp -o RcppExports.o
/usr/local/opt/llvm/bin/clang++ -I/usr/local/Cellar/r/3.4.1_1/R.framework/Resources/include -DNDEBUG  -I"/usr/local/lib/R/3.4/site-library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include   -fPIC  -g -O3 -Wall -pedantic -std=c++11 -mtune=native -pipe -c circlePack.cpp -o circlePack.o
circlePack.cpp:447:58: error: non-constant-expression cannot be narrowed from type 'unsigned long' to 'int' in initializer list [-Wc++11-narrowing]
        Circle c = {0, 0, std::sqrt(float(*itr / M_PI)), circles.size() + 1};
                                                         ^~~~~~~~~~~~~~~~~~
circlePack.cpp:447:58: note: insert an explicit cast to silence this issue
        Circle c = {0, 0, std::sqrt(float(*itr / M_PI)), circles.size() + 1};
                                                         ^~~~~~~~~~~~~~~~~~
                                                         static_cast<int>( )
1 error generated.
make: *** [circlePack.o] Error 1
ERROR: compilation failed for package ‘ggraph’
* removing ‘/usr/local/lib/R/3.4/site-library/ggraph’
Warning in install.packages :
  installation of package ‘ggraph’ had non-zero exit status

我已经运行brew install udunits,从源代码构建,尝试使用Github版本等,问题仍然存在。

如何绕过/解决此问题?

1 个答案:

答案 0 :(得分:1)

这是代码中的错误。我是submitted a fix的错误。如果您从该pull请求安装,它应该工作:

set