Reputation: 3775
I'm trying to install ggraph
package from CRAN
> install.packages("ggraph")
This is the output
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
I already run brew install udunits
, build from source, try with Github version, etc and the problem persists.
How do I bypass/solve this problem?
Upvotes: 1
Views: 445
Reputation: 546173
This is a bug in the code. I submitted a fix for the bug. If you install from that pull request, it should work:
devtools::install_github("thomasp85/ggraph#78")
Upvotes: 1