Установка "choroplethr" в Ubuntu - PullRequest
0 голосов
/ 23 ноября 2018

Я пытаюсь установить "choroplethr."

Я прочитал следующие похожие ошибки:

Их рекомендация - установить то, что я уже установил.У меня libudunits2 установлен в стандартном месте, с:

$ sudo apt-get install libudunits2-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libudunits2-dev is already the newest version (2.2.26-1).

Я вижу заголовки:

$ ll /usr/include/ | grep unit
-rw-r--r--   1 root root  39998 Jan  5  2018 udunits2.h
-rw-r--r--   1 root root   5195 Jan  5  2018 udunits.h

Однако при установке я получаю эту ошибку:

$ R
R version 3.5.1 (2018-07-02) -- "Feather Spray"

> install.package("choroplethr", dep=T)
...
configure: error: in `/tmp/RtmpWC06JV/R.INSTALL7cbb4928db67/units':
configure: error: 
--------------------------------------------------------------------------------
  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.
--------------------------------------------------------------------------------

Я сделал эти настройки, но

install.packages("udunits2", configure.args = '--with-udunits2-include=/usr/include/udunits2')

-----Error: libudunits2.a not found-----
     If the udunits2 library is installed in a non-standard location,
     use --configure-args='--with-udunits2-lib=/usr/local/lib' for example,
     or --configure-args='--with-udunits2-include=/usr/include/udunits2'
     replacing paths with appropriate values for your installation.
     You can alternatively use the UDUNITS2_INCLUDE and UDUNITS2_LIB
     environment variables.
     If udunits2 is not installed, please install it.
     It is required for this package.

Чего мне не хватает?Этот пакет только для OSX?

1 Ответ

0 голосов
/ 23 ноября 2018

Для Ubuntu с R 3.5 вы можете использовать c2d4u3.5 PPA , предоставляемый теми же людьми, которые приносят вам пакеты R Ubuntu на CRAN, cf https://cran.r -project.org / bin/linux/ubuntu/README.html и http://dirk.eddelbuettel.com/blog/2017/12/22/:

sudo add-apt-repository ppa:marutter/c2d4u3.5
sudo apt-get update

После этого вы можете установить бинарные пакеты для большинства пакетов CRAN:

sudo apt-get install r-cran-choroplethr

Это должно работать для всехпакеты, упомянутые в представлениях задач CRAN.

Кроме того, я попытался воспроизвести ваши проблемы с установкой, используя docker:

FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
 && apt-get install --yes --no-install-recommends gnupg ca-certificates \
 && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 \
 && echo "deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/" >> /etc/apt/sources.list \
 && apt-get update \
 && apt-get install  --yes --no-install-recommends r-base-dev libudunits2-dev \
 && Rscript -e 'install.packages(c("units", "udunits2"))'

Однако образ был собран без проблем.

...