Failing to install "igraph" package in R - r

I'm trying to install the 'igraph' package but running into this error:
** libs
gfortran -fPIC -g -O2 -c AMD/Source/amd.f -o AMD/Source/amd.o
clang: error: invalid version number in '-mmacosx-version-min=11.4'
make: *** [AMD/Source/amd.o] Error 1
ERROR: compilation failed for package ‘igraph’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/igraph’
Did some searches on the issue but haven't seen much coverage on this topic. Any help is appreciated.

Related

Issues installing RcppMP in MacOS

I am trying to install RcppMP in MacOS.
However, when I type:
remotes::install_github("Thell/RcppMP",dependencies = T)
I get the following error:
* installing *source* package ‘RcppMP’ ...
** using staged installation
** libs
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include/ -I'/Library/Frameworks/R.framework/Versions/4.1/Resources/library/BH/include' -I'/Library/Frameworks/R.framework/Versions/4.1/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c RcppExports.cpp -o RcppExports.o
In file included from RcppExports.cpp:4:
In file included from ./../inst/include/RcppMP.h:7:
In file included from ../inst/include/RcppMP_RcppExports.h:7:
../inst/include/RcppMP_types.hpp:15:10: fatal error: 'mpreal.h' file not found
#include <mpreal.h>
^~~~~~~~~~
1 error generated.
make: *** [RcppExports.o] Error 1
ERROR: compilation failed for package ‘RcppMP’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/RcppMP’
Warning message:
In i.p(...) :
installation of package ‘/var/folders/pq/hxwd9my563q_qpy4rbrlgkmw0000gn/T//RtmpIdnyiB/file2184610d74ea/RcppMP_0.1.1.tar.gz’ had non-zero exit status
My ~/.R/Makevars file contain the following specifications:
CC=/usr/local/opt/llvm/bin/clang
CXX=/usr/local/opt/llvm/bin/clang++
CXX1X=/usr/local/opt/llvm/bin/clang++
LDFLAGS=-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib
CXXFLAGS=-I/usr/local/opt/llvm/include
FLIBS=-L/usr/local/Cellar/gcc/11.3.0_1/lib/gcc/11
This was a bit more complicated than I thought; this package requires mpfr, gmp and the very-similarly-named mpfrc++. The steps that worked for me are:
Install gmp and mpfr via homebrew
Download and unzip "mpfrc++-3.6.8.zip" from
http://www.holoborodko.com/pavel/mpfr/#download
Copy the mpreal header file ("mpreal.h") to
/usr/local/include (sudo cp ./mpreal.h /usr/local/include/) or, in your case, perhaps sudo cp ./mpreal.h /usr/local/opt/llvm/include would make more sense
Install/compile RcppMP
(remotes::install_github("Thell/RcppMP",dependencies = TRUE))
I got some warnings but no errors, and the package loaded (library(RcppMP)), so I'm relatively confident it installed successfully. If you find otherwise, please let me know and I'll look into it further.

fatal error installing systemfonts in jupyter R docker

I am running jupyterlabs on docker and wanted to install the rvg package. One of the dependencies are systemfonts, and when I tried to install this using install.packages("systemfonts") I get:
Warning: unable to access index for repository https://cran.yu.ac.kr/src/contrib:
cannot open URL 'https://cran.yu.ac.kr/src/contrib/PACKAGES'
Warning message:
package ‘systemfonts’ is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
So I downloaded the tar.gz file from CRAN and installed from file, but I get a fatal error:
> install.packages("systemfonts_1.0.2.tar.gz", repo = NULL, type = "source")
* installing *source* package ‘systemfonts’ ...
** package ‘systemfonts’ successfully unpacked and MD5 sums checked
** using staged installation
Using PKG_CFLAGS=
Using PKG_LIBS=-lfontconfig -lfreetype
** libs
rm -f systemfonts.so caches.o cpp11.o dev_metrics.o font_matching.o font_registry.o ft_cache.o string_shape.o font_metrics.o font_fallback.o string_metrics.o emoji.o cache_store.o init.o unix/FontManagerLinux.o
x86_64-conda-linux-gnu-c++ -std=gnu++11 -I"/opt/conda/lib/R/include" -DNDEBUG -I'/opt/conda/lib/R/library/cpp11/include' -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /opt/conda/include -I/opt/conda/include -Wl,-rpath-link,/opt/conda/lib -fpic -fvisibility-inlines-hidden -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /opt/conda/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/r-base-split_1607284869564/work=/usr/local/src/conda/r-base-4.0.3 -fdebug-prefix-map=/opt/conda=/usr/local/src/conda-prefix -c caches.cpp -o caches.o
In file included from caches.h:7,
from caches.cpp:1:
ft_cache.h:9:10: fatal error: ft2build.h: No such file or directory
9 | #include <ft2build.h>
| ^~~~~~~~~~~~
compilation terminated.
make: *** [/opt/conda/lib/R/etc/Makeconf:181: caches.o] Error 1
ERROR: compilation failed for package ‘systemfonts’
* removing ‘/opt/conda/lib/R/library/systemfonts’
Warning message:
In install.packages("work/corehead_data/systemfonts_1.0.2.tar.gz", :
installation of package ‘work/corehead_data/systemfonts_1.0.2.tar.gz’ had non-zero exit status
I tried to follow this SO Post, by typing in sudo apt-get install -y libfreetype6 to get freetype, but it is already the newest version. I'm not sure what else to try, hopefully someone can provide some expertise. Thanks.
Searching for "ft2build.h: No such file or directory Ubuntu" leads to this issue on systemfonts library GitHub where a workaround for the compilation error for Ubuntu 20.04 is shown:
sudo apt-get update
sudo apt-get install libfontconfig1-dev
This should help you to compile library from the tar.gz source.

How can I solve the CPLEX directory issues in R

The problem is that, am trying to install a package cplexAPI using the code
install.packages("cplexAPI")
"C:/rtools40/mingw32/bin/"gcc -I"C:/PROGRA~1/R/R-40~1.5/include" -DNDEBUG -g -D_R_=1 -DUSE_R=1 -I"\cplex\include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c cplexAPI.c -o cplexAPI.o
In file included from cplexAPI.h:26,
from cplexAPI.c:26:
cplexR.h:50:10: fatal error: ilcplex/cplex.h: No such file or directory
#include <ilcplex/cplex.h>
^~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [C:/PROGRA~1/R/R-40~1.5/etc/i386/Makeconf:222: cplexAPI.o] Error 1
ERROR: compilation failed for package 'cplexAPI'
* removing 'C:/Users/ATM/Documents/R/win-library/4.0/cplexAPI'
Warning in install.packages :
installation of package ‘cplexAPI’ had non-zero exit status
What have done
Have installed IBM ILOG CPLEX Optimization Studio
Version: 12.10.0.0
and tried to install the package again and i experience the same issue
Kindly assist

R error: make: llvm-gcc-4.2: No such file or directory

I have RStudio 1.1.419 running on a Mac OS El Capitan. I am trying to install the dplyr package. The installation first attempts to install package utf8. The following is the text I get back:
installing source package ‘utf8’ ...
** package ‘utf8’ successfully unpacked and MD5 sums checked
** libs
llvm-gcc-4.2 -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -Iutf8lite/src -fPIC -mtune=core2 -g -O2 -c as_utf8.c -o as_utf8.o
make: llvm-gcc-4.2: No such file or directory
make: *** [as_utf8.o] Error 1
ERROR: compilation failed for package ‘utf8’
removing ‘/Users/andrewdkilmer/Library/R/3.2/library/utf8’
Warning in install.packages :
installation of package ‘utf8’ had non-zero exit status
Since utf8 failed to install, dplyr cannot install either. Why am I getting this 'No such file or directory' error?
Never mind, updated to R version 3.4 and it is working.

installation package "tm" fails

I am trying to install package "tm" and get an error (see below). From this error I can't see what is going wrong. Package Rcpp is installed. Working on R 3.4.0, Xubuntu 64.
How can I install package tm?
* installing *source* package ‘tm’ ...
** package ‘tm’ successfully unpacked and MD5 sums checked
** libs
g++ -I/usr/share/R/include -DNDEBUG -I"/home/henk/R/x86_64-pc-linux-gnu-library/3.4/BH/include" -I"/home/henk/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o
In file included from /home/henk/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp.h:34:0,
from RcppExports.cpp:4:
/home/henk/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/grow.h:73:47: fatal error: Rcpp/generated/grow__pairlist.h: No such file or directory
compilation terminated.
/usr/lib/R/etc/Makeconf:168: recipe for target 'RcppExports.o' failed
make: *** [RcppExports.o] Error 1
ERROR: compilation failed for package ‘tm’
* removing ‘/home/henk/R/x86_64-pc-linux-gnu-library/3.4/tm’
Warning in install.packages :
installation of package 'tm' had non-zero exit status
The downloaded source packages are in
'/tmp/Rtmp3tKSat/downloaded_packages'
At first we can install "devtools" packages and than install "tm"
by using devtools::install_cran("tm")
try
sudo apt-get install r-cran-rcpp

Resources