How can I install devtools with Renv without getting an Error - r

Renv, can't install devtools
Goal: install devtools with renv
Expected Results: Installation of devtools.
Actual Results: see error below
I try to install packages in RStudio through renv (On Ubuntu), to use for my own package. I performed Renv init(), packages will install except for devtools. When I try to install devtools through renv::install()I get the following error:
> renv::install("devtools")
Retrieving 'https://cran.rstudio.com/src/contrib/devtools_2.4.4.tar.gz' ...
OK [file is up to date]
Retrieving 'https://cran.rstudio.com/src/contrib/pkgdown_2.0.6.tar.gz' ...
OK [file is up to date]
Retrieving 'https://cran.rstudio.com/src/contrib/ragg_1.2.2.tar.gz' ...
OK [file is up to date]
Installing ragg [1.2.2] ...
FAILED
Error installing package 'ragg':
================================
* installing *source* package ‘ragg’ ...
** package ‘ragg’ successfully unpacked and MD5 sums checked
** using staged installation
Package libtiff-4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libtiff-4.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libtiff-4' found
Package libtiff-4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libtiff-4.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libtiff-4' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lfreetype -lpng16 -ltiff -lz -ljpeg -lbz2
-----------------------------[ ANTICONF ]-------------------------------
Configuration failed to find one of freetype2 libpng libtiff-4. Try installing:
* deb: libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev (Debian, Ubuntu, etc)
* rpm: freetype-devel libpng-devel libtiff-devel libjpeg-turbo-devel (Fedora, CentOS, RHEL)
* csw: libfreetype_dev libpng16_dev libtiff_dev libjpeg_dev (Solaris)
If freetype2 libpng libtiff-4 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a freetype2 libpng libtiff-4.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
<stdin>:1:22: fatal error: ft2build.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘ragg’
* removing ‘/home/SmitsG/Documents/Projects/{"package_location"}/renv/staging/1/ragg’
Error: install of package 'ragg' failed [error code 1]
So this resulted in the following errors:
No package 'libtiff-4' found
:1:22: fatal error: ft2build.h: No such file or directory
Error: install of package 'ragg' failed [error code 1]
I tried the following:
Installation in other package environment. This didn't work out
https://techoverflow.net/2019/06/11/how-to-fix-ft2build-h-no-such-file-or-directory/
Seems that I am missing the ft2build.h header file from
libfreetype. So I tried to install libfreetype from tar.gz and from
CRAN, for renv (this didn't install automatically). This didn't work out.
Package libtiff-4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libtiff-4.pc'
to the PKG_CONFIG_PATH environment variable
I found this link: https://github.com/numworks/epsilon/issues/592 where the set the PKG_CONFIG_PATH. But I think this can only be done when libfreetype is installed through renv.
{:~/path_to_package}$ pkg-config --cflags freetype2-I/usr/include/freetype2
-I/usr/include/libpng16
{:~/path_to_package}$ pkg-config --libs --cflags libtiff-4Package libtiff-4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libtiff-4.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libtiff-4' found

I am a newbie to linux and I have found that installing R packages can be very frustrating because (1) there are numerous linux dependencies that need to be installed first and (2) it takes forever. Below is a script that installs the dependencies that I have found in installing R on my system (Linux Mint 21 Vanessa).
sudo apt update
sudo apt install -q \
cargo \
cmake \
default-jdk \
fonts-roboto \
htop \
libcairo2-dev \
libclang-dev \
libcurl4-openssl-dev \
libfontconfig1-dev \
libfreetype6-dev \
libfribidi-dev \
libgdal-dev \
libgeos-dev \
libharfbuzz-dev \
libjpeg-dev \
libproj-dev \
libpng-dev \
libpq-dev \
libsodium-dev \
libssl-dev \
libtiff5-dev \
libudunits2-dev \
libx11-dev \
libxml2-dev \
openjdk-8-jdk \
openjdk-8-jre \
pandoc \
ttf-mscorefonts-installer \
xorg-dev

Related

Airflow: RScript : Error in library(httr) : there is no package called ‘httr’

Requirement: To install R Packages in Airflow to execute the RScript in Airflow
Tried: Below commands in DockerFile
# Global Docker Build arguments
ARG AIRFLOW_VERSION=2.3.3
ARG PYTHON_RUNTIME_VERSION=3.8
FROM apache/airflow:${AIRFLOW_VERSION}-python${PYTHON_RUNTIME_VERSION}
SHELL ["/bin/bash", "-o", "pipefail", "-e", "-u", "-x", "-c"]
USER 0
RUN apt-get update && apt-get install -y r-base r-base-core && \
rm -r /var/lib/apt/lists/*
RUN R -e "install.packages('httr', repos='https://cran.rstudio.com/')"
RUN R -e "install.packages('jsonlite', repos='http://cran.rstudio.com/')"
Error : Error in library(httr) : there is no package called ‘httr’
Also Tried another by including in the RScript as
install.packages("httr")
install.packages("jsonlite")
library(httr)
library(jsonlite)
Got error as
Running command: ['Rscript', '/opt/airflow/dags/r_scripts/R_script.R']
[2023-01-04, 16:57:58 UTC] {subprocess.py:85} INFO - Output:
[2023-01-04, 16:57:58 UTC] {subprocess.py:92} INFO - Installing package into ‘/usr/local/lib/R/site-library’
[2023-01-04, 16:57:58 UTC] {subprocess.py:92} INFO - (as ‘lib’ is unspecified)
[2023-01-04, 16:57:58 UTC] {subprocess.py:92} INFO - Warning in install.packages("httr") :
[2023-01-04, 16:57:58 UTC] {subprocess.py:92} INFO - 'lib = "/usr/local/lib/R/site-library"' is not writable
[2023-01-04, 16:57:58 UTC] {subprocess.py:92} INFO - Error in install.packages("httr") : unable to install packages
[2023-01-04, 16:57:58 UTC] {subprocess.py:92} INFO - Execution halted
[2023-01-04, 16:57:58 UTC] {subprocess.py:96} INFO - Command exited with return code 1
You are running into errors during compilation that are causing cascading errors. When in trouble building R images, since the docker build process often masks/hides some of the real error messages, I run a container before the installation phase to see what's going on. If we do that, we'll see errors such as:
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libcurl was not found. Try installing:
* deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
* rpm: libcurl-devel (Fedora, CentOS, RHEL)
If libcurl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘curl’
* removing ‘/home/airflow/R/x86_64-pc-linux-gnu-library/4.0/curl’
* installing *source* package ‘openssl’ ...
** package ‘openssl’ successfully unpacked and MD5 sums checked
** using staged installation
Using PKG_CFLAGS=
--------------------------- [ANTICONF] --------------------------------
Configuration failed because openssl was not found. Try installing:
* deb: libssl-dev (Debian, Ubuntu, etc)
* rpm: openssl-devel (Fedora, CentOS, RHEL)
* csw: libssl_dev (Solaris)
* brew: openssl (Mac OSX)
If openssl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a openssl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
tools/version.c:1:10: fatal error: openssl/opensslv.h: No such file or directory
1 | #include <openssl/opensslv.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘openssl’
* removing ‘/home/airflow/R/x86_64-pc-linux-gnu-library/4.0/openssl’
ERROR: dependencies ‘curl’, ‘openssl’ are not available for package ‘httr’
* removing ‘/home/airflow/R/x86_64-pc-linux-gnu-library/4.0/httr’
The downloaded source packages are in
‘/tmp/Rtmp9dyEo5/downloaded_packages’
When you see this, it should be clear: you have OS-level dependencies that are not met. While the CRAN page for httr is uninformative here, know that it relies on curl, which lists:
SystemRequirements: libcurl: libcurl-devel (rpm) or libcurl4-openssl-dev (deb).
If you dive a little deeper, you'll see that we need to add that package as well as libssl-dev.
I only tested against the initial few portions of your Dockerfile, but I was able to build this and confirm that R sees these two new packages. (I also took the liberty of installing both packages in one RUN line, thinking that fewer images in the build process was a good thing.)
ARG AIRFLOW_VERSION=2.3.3
ARG PYTHON_RUNTIME_VERSION=3.8
FROM apache/airflow:${AIRFLOW_VERSION}-python${PYTHON_RUNTIME_VERSION}
SHELL ["/bin/bash", "-o", "pipefail", "-e", "-u", "-x", "-c"]
USER 0
RUN apt-get update && apt-get install -y r-base r-base-core r-base-dev \
libcurl4-openssl-dev libssl-dev && \
rm -r /var/lib/apt/lists/*
RUN R -e "install.packages(c('httr', 'jsonlite'), repos='https://cran.rstudio.com/')"
The build:
$ docker build -t myimage .
[+] Building 20.5s (7/7) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 474B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/apache/airflow:2.3.3-python3.8 0.7s
=> [1/3] FROM docker.io/apache/airflow:2.3.3-python3.8#sha256:3a17e765ce209eb6cc551518f3b7ad5e2126d509ca8bdd35232ed2d35f801049 0.0s
=> CACHED [2/3] RUN apt-get update && apt-get install -y r-base r-base-core r-base-dev libcurl4-openssl-dev libssl-dev && rm -r /var/lib/apt/lists/* 0.0s
=> [3/3] RUN R -e "install.packages(c('httr', 'jsonlite'), repos='https://cran.rstudio.com/')" 19.6s
=> exporting to image 0.2s
=> => exporting layers 0.1s
=> => writing image sha256:6271d7deb41211a7fa603a086f8cc24d1249d831546e2fec0293d87d14558312 0.0s
=> => naming to docker.io/library/myimage
Confirm:
$ docker run -it --rm myimage bash
The container is run as root user. For security, consider using a regular user account.
root#10f43b1bd4c2:/opt/airflow# ls /usr/local/lib/R/site-library/
R6 askpass curl httr jsonlite mime openssl sys
root#10f43b1bd4c2:/opt/airflow# R
R version 4.0.4 (2021-02-15) -- "Lost Library Book"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> packageVersion("httr")
[1] ‘1.4.4’
> packageVersion("jsonlite")
[1] ‘1.8.4’
> q("no")

Install `libudunits2-dev` on Amazon Linux 2

I'm working in an Amazon-Linux-2 environment and would like to install the R-package "sf" which depends on the libudunits2-dev system library. I get the error message:
Configuration failed because libudunits2.so was not found. Try installing:
* deb: libudunits2-dev (Debian, Ubuntu, ...)
* rpm: udunits2-devel (Fedora, EPEL, ...)
* brew: udunits (OSX)
If udunits2 is already installed in a non-standard location, use:
--configure-args='--with-udunits2-lib=/usr/local/lib'
if the library was not found, and/or:
--configure-args='--with-udunits2-include=/usr/include/udunits2'
if the header was not found, replacing paths with appropriate values.
You can alternatively set UDUNITS2_INCLUDE and UDUNITS2_LIBS manually.
udunits2 cannot be installed with sudo yum install libudunits2-dev or libunits2-devel. I attempted installing and using epel but that also does not contain this library.
I installed udunits2 from source, and it can find the library but there is still an error. I am unsure how to build a dev version of this library
wget ftp://ftp.unidata.ucar.edu/pub/udunits/udunits-2.2.28.tar.gz &&\
tar -xvzf udunits-2.2.28.tar.gz; rm udunits-2.2.28.tar.gz &&\
cd udunits-2.2.28 &&\
./configure -prefix=/usr/local &&\
make install &&\
cd .. && rm -rf udunits-2.2.28
Current error message:
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for 'units' in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/usr/lib64/R/library/00LOCK-units/00new/units/libs/units.so':
libudunits2.so.0: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing '/usr/lib64/R/library/units'
ERROR: dependency 'units' is not available for package 'sf'
Edit ---------------------------
Thanks Knud Larsen for correcting the epel-package name. It looks like the installation is a bit involved but here is what I've figured out.
The sf package dependencies are libudunits2-dev libgdal-dev libgeos-dev libproj-dev. Which for amazon-linux-2 needs epel and to built from source. (note: epel gdal is version 1 and not compatible).
# Add epel repository
sudo amazon-linux-extras install epel
# install udunits2
yum install -y udunits2-devel
# install proj/gdal dependency
yum install -y gcc-c++ cpp sqlite-devel libtiff cmake3
# build/install proj
wget https://download.osgeo.org/proj/proj-6.1.1.tar.gz
tar -xvf proj-6.1.1.tar.gz
cd proj-6.1.1
./configure
sudo make
sudo make install
cd ..
rm -rf proj-6.1.1*
# build/install gdal
wget https://github.com/OSGeo/gdal/releases/download/v3.2.1/gdal-3.2.1.tar.gz
tar -xvf gdal-3.2.1.tar.gz
cd gdal-3.2.1
./configure --with-proj=/usr/local --with-python
sudo make
sudo make install
cd ..
rm -rf gdal-3.2.1*

ERROR: configuration failed for package ‘ragg’

> install.packages("ragg")
trying URL 'https://cloud.r-project.org/src/contrib/ragg_1.1.3.tar.gz'
Content type 'application/x-gzip' length 420401 bytes (410 KB)
==================================================
downloaded 410 KB
Welcome at Tue Aug 17 23:24:09 2021
Library path: /home/roy/miniconda3/envs/r-4.1/lib/R/library
Repositories set.
R_MAX_NUM_DLLS set to 1000.
* installing *source* package ‘ragg’ ...
** package ‘ragg’ successfully unpacked and MD5 sums checked
** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/x86_64-linux-gnu
Using PKG_LIBS=-lfreetype -lpng16 -lm -lz -lm -lz -ltiff -lwebp -lzstd -llzma -ljbig -ljpeg -lz -lm
-----------------------------[ ANTICONF ]-------------------------------
Configuration failed to find one of freetype2 libpng libtiff-4. Try installing:
* deb: libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev (Debian, Ubuntu, etc)
* rpm: freetype-devel libpng-devel libtiff-devel libjpeg-turbo-devel (Fedora, CentOS, RHEL)
* csw: libfreetype_dev libpng16_dev libtiff_dev libjpeg_dev (Solaris)
If freetype2 libpng libtiff-4 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a freetype2 libpng libtiff-4.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
In file included from /home/roy/miniconda3/envs/r-4.1/x86_64-conda-linux-gnu/sysroot/usr/include/features.h:361,
from /home/roy/miniconda3/envs/r-4.1/x86_64-conda-linux-gnu/sysroot/usr/include/limits.h:27,
from /home/roy/miniconda3/envs/r-4.1/lib/gcc/x86_64-conda-linux-gnu/9.3.0/include-fixed/limits.h:194,
from /home/roy/miniconda3/envs/r-4.1/lib/gcc/x86_64-conda-linux-gnu/9.3.0/include-fixed/syslimits.h:7,
from /home/roy/miniconda3/envs/r-4.1/lib/gcc/x86_64-conda-linux-gnu/9.3.0/include-fixed/limits.h:34,
from /usr/include/libpng16/pngconf.h:31,
from /usr/include/libpng16/png.h:339,
from <stdin>:2:
/usr/include/x86_64-linux-gnu/sys/cdefs.h:492:49: error: missing binary operator before token "("
492 | #if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5)
| ^
In file included from /home/roy/miniconda3/envs/r-4.1/x86_64-conda-linux-gnu/sysroot/usr/include/stdio.h:932,
from /usr/include/libpng16/pngconf.h:46,
from /usr/include/libpng16/png.h:339,
from <stdin>:2:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:228:17: error: missing binary operator before token "("
228 | #if __GLIBC_USE (DEPRECATED_GETS)
| ^
--------------------------------------------------------------------
ERROR: configuration failed for package ‘ragg’
* removing ‘/home/roy/miniconda3/envs/r-4.1/lib/R/library/ragg’
The downloaded source packages are in
‘/tmp/RtmpL1ZZnL/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("ragg") :
installation of package ‘ragg’ had non-zero exit status
Session info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
#> version R version 4.1.0 (2021-05-18)
#> os Ubuntu 20.04.2 LTS
#> system x86_64, linux-gnu
#> ui X11
#> language en_GB:en
#> collate en_GB.UTF-8
#> ctype en_GB.UTF-8
#> tz Europe/Stockholm
#> date 2021-08-17
This issue happens in a conda environment. The suggested linux libraries are installed (see below, run in the same conda env).
sudo apt-get install -y libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libjpeg-dev is already the newest version (8c-2ubuntu8).
libpng-dev is already the newest version (1.6.37-2).
libfreetype6-dev is already the newest version (2.10.1-2ubuntu0.1).
libtiff5-dev is already the newest version (4.1.0+git191117-2ubuntu0.20.04.1).
0 to upgrade, 0 to newly install, 0 to remove and 26 not to upgrade.
ragg installation outside the conda env works fine. My guess is that when installing from the conda env, it doesn't find the path to something. Any tips?
It looks like something connected to this question answer. I encountered the same issue when was trying to install "ragg" package inside my conda env, and the suggested fix in the log (mentioned by #BlackBear answer) is not the real cause of the issue, the issue's cause is showed below in the log:
-------------------------- [ERROR MESSAGE] ---------------------------
In file included from /home/roy/miniconda3/envs/r-4.1/x86_64-conda-linux-gnu/sysroot/usr/include/features.h:361,
from /home/roy/miniconda3/envs/r-4.1/x86_64-conda-linux-gnu/sysroot/usr/include/limits.h:27,
from /home/roy/miniconda3/envs/r-4.1/lib/gcc/x86_64-conda-linux-gnu/9.3.0/include-fixed/limits.h:194,
from /home/roy/miniconda3/envs/r-4.1/lib/gcc/x86_64-conda-linux-gnu/9.3.0/include-fixed/syslimits.h:7,
from /home/roy/miniconda3/envs/r-4.1/lib/gcc/x86_64-conda-linux-gnu/9.3.0/include-fixed/limits.h:34,
from /usr/include/libpng16/pngconf.h:31,
from /usr/include/libpng16/png.h:339,
from <stdin>:2:
/usr/include/x86_64-linux-gnu/sys/cdefs.h:492:49: error: missing binary operator before token "("
492 | #if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5)
| ^
In file included from /home/roy/miniconda3/envs/r-4.1/x86_64-conda-linux-gnu/sysroot/usr/include/stdio.h:932,
from /usr/include/libpng16/pngconf.h:46,
from /usr/include/libpng16/png.h:339,
from <stdin>:2:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:228:17: error: missing binary operator before token "("
228 | #if __GLIBC_USE (DEPRECATED_GETS)
| ^
--------------------------------------------------------------------
And it is maybe somehow connected to macros definition confusing. I'm not a big specialist in glibc and other things, for me the suggestion from the #MrFlick in comments to the question to install package directly via conda worked (mamba install -c conda-forge r-ragg)
The solution is in the log:
Configuration failed to find one of freetype2 libpng libtiff-4. Try installing:
* deb: libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev (Debian, Ubuntu, etc)
* rpm: freetype-devel libpng-devel libtiff-devel libjpeg-turbo-devel (Fedora, CentOS, RHEL)
* csw: libfreetype_dev libpng16_dev libtiff_dev libjpeg_dev (Solaris)
Install those packages and try again.
I saw the same error. The fix is to install pkg-config to the conda environment:
conda install -c conda-forge pkg-config
Somehow it seems that R c compiler under conda environment can not call system pkg-config correctly.

Correct fftw installation enabling Rcartogram

I would like to instal FFTW to enable the Rcartogram package.
Attempts
homebrew
After installing fftw libraries via homebrew:
brew install fftw --with-fortran --with-mpi --with-openmp --enable-float
The attempt to install the Rcartogram fails with the following error:
>> devtools::install_github("omegahat/Rcartogram")
Downloading GitHub repo omegahat/Rcartogram#master
from URL https://api.github.com/repos/omegahat/Rcartogram/zipball/master
Installing Rcartogram
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ \
--no-save --no-restore --quiet CMD INSTALL \
'/private/var/folders/7x/kwc1y_l96t55_rwlv35mg8xh0000gn/T/Rtmp7nMfM9/devtoolsa9f2458e68c3/omegahat-Rcartogram-715cb93' \
--library='/Users/whereIkeepMyStuff' --install-tests
* installing *source* package ‘Rcartogram’ ...
(...)
Can compile with fftw3.h
checking for fftw_malloc in -lfftw3... no
configure: error: "cannot link to libfftw3"
ERROR: configuration failed for package ‘Rcartogram’
* removing (...)
Error: Command failed (1)
make install
As a second approach I tried the guidelines available here and install FFTW using the following syntax:
wget http://www.fftw.org/fftw-3.3.6-pl1.tar.gz
tar -xvzf fftw-3.3.6-pl1.tar.gz
cd fftw-3.3.6-pl1
./configure --prefix=/usr/local/fftw-3.6.6 --enable-threads \
--enable-float --enable-shared \
CC="gcc -arch i386 -arch x86_64" CXX="g++ -arch i386 -arch x86_64" \
CPP="gcc -E" CXXCPP="g++ -E" F77=gfortran
make
sudo make install
sudo ln -s /usr/local/fftw-3.6.6 /usr/local/fftw
This fails as follows:
>> devtools::install_github("omegahat/Rcartogram")
(...)
* installing *source* package ‘Rcartogram’ ...
checking for pkg-config... /usr/local/bin/pkg-config
Package fftw3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `fftw3.pc'
to the PKG_CONFIG_PATH environment variable
No package 'fftw3' found
Package fftw3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `fftw3.pc'
to the PKG_CONFIG_PATH environment variable
No package 'fftw3' found
Looking for fftw3 files in /usr/local
Cannot find fftw.h
ERROR: configuration failed for package ‘Rcartogram’
Configuration
OS
sw_vers -productVersion
10.12.2
R
R --version
R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin13.4.0 (64-bit)
How can install FFTW so I could use the Rcartogram package?
Cleaning
After failed attempts I would clean:
homebrew
brew uninstall fftw
shell
sudo make uninstall
sudo rm -rv /usr/local/fftw*

RCurl installation error

I have R 3.2.0 in redhat.
I am trying to install RCurl, but get the following error
myUTF8.c: In function \u2018StringValue\u2019:
myUTF8.c:284: warning: passing argument 1 of \u2018Rf_mkCharLenCE\u2019 from incompatible pointer type
gcc -std=gnu99 -shared -L/home/gowthan/Downloads/R-3.2.0/lib -L/usr/local/lib64 -o RCurl.so base64.o curl.o curlInit.o curl_base64.o enums.o json.o memoryManagement.o myUTF8.o -L/local/p4clients/pkgbuild-5R4zB/workspace/build/Curl/Curl-7.18.1.155.6782/RHEL5_64/DEV.STD.PTHREAD/build/private/curl/install/lib -lcurl -L/opt/brazil-pkg-cache/packages/Fbopenssl/Fbopenssl-0.0.4.504.7765/RHEL5_64/DEV.STD.PTHREAD/build/lib -lfbopenssl -L/local/p4clients/pkgbuild-5R4zB/workspace/build/Curl/Curl-7.18.1.155.6782/RHEL5_64/DEV.STD.PTHREAD/build/private/tmp/brazil-path/[Openssl]lib.libfarm/lib -L/local/p4clients/pkgbuild-k5Vrj/workspace/build/Libxml2/Libxml2-2.7.8.334.176/RHEL5_64/DEV.STD.PTHREAD/build/private/libxml2/install/lib -lxml2 -lz -lm -L/home/gowthan/Downloads/R-3.2.0/lib -lR
/usr/bin/ld: cannot find -lfbopenssl
collect2: ld returned 1 exit status
make: *** [RCurl.so] Error 1
ERROR: compilation failed for package \u2018RCurl\u2019
* removing \u2018/home/gowthan/Downloads/R-3.2.0/library/RCurl\u2019
The downloaded source packages are in
\u2018/tmp/RtmpLXPsKI/downloaded_packages\u2019
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning messages:
1: In install.packages("RCurl", dep = TRUE) :
installation of package \u2018XML\u2019 had non-zero exit status
2: In install.packages("RCurl", dep = TRUE) :
installation of package \u2018RCurl\u2019 had non-zero exit status
The build is failing and it does not find lfbopenssl. How do I install that?
EDIT:
I already tried : yum -y install libcurl libcurl-devel
Loaded plugins: security
Setting up Install Process
No package libcurl available.
No package libcurl-devel available.
Nothing to do
I already have curl, curl-devl and openssl installed.
There is warning: cannot find -lfbopenssl, so you need to install openssl first: https://www.openssl.org/and then try to perfrom RCurl installation one more time.
Try this code:
sudo apt-get install aptitude
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libxml2-dev
As mentioned here: https://github.com/sagemath/cloud/issues/114
EDIT
on red-hat try this:
yum install openssl
Also remember about configuration of openssl and curl.
The configuration of openssl is described here:
http://dev.antoinesolutions.com/openssl

Resources