For instance, while trying to install the R package curl
as a dependency of usethis
:
* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lcurl
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libcurl was not found. Try installing:
* deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
* rpm: libcurl-devel (Fedora, CentOS, RHEL)
* csw: libcurl_dev (Solaris)
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=...'
R detects that I don't have libcurl installed. At what level is this external dep. specified? I know that external dependencies can be indicated in the DESCRIPTION file, and indeed curl's pkg DESCRIPTION file does contain:
SystemRequirements: libcurl: libcurl-devel (rpm) or libcurl4-openssl-dev (deb).
But is that line what allowed R to detect the missing dependency and print that error? Can't be, right? How could it? So, how is R doing it?
Type “install. packages(“gplots”)” and then press the Enter/Return key. If you have already loaded a package from a server in the R session, then R will automatically install the package. If not, R will automatically prompt you to choose a mirror.
If you are using a Windows PC, there are two ways you can check whether R is already installed on your computer: Check if there is an “R” icon on the desktop of the computer that you are using. If so, double-click on the “R” icon to start R.
A dependency is a code that your package needs to run. Dependencies are managed by two files. The DESCRIPTION manages dependencies at the package level; i.e. what packages needs to be installed for your package to work. R has a rich set of ways to describe different types of dependencies.
Briefly:
SystemRequirements
in DESCRIPTION
brew
or apt
. That is pretty good, but it also does not work at the CRAN source level.configure
to test if resources are present, and to abort with clear errors if not.configure
is here.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With