error configuration failed for package units




为R3.3安装udunits2软件包 (2)

我已经在Linux平台(redhat)上的R中安装了 udunits2 软件包而没有Internet连接。

我也有这个问题。

首先,我在( /usr/include/udunits2 )的Linux示例中安装了 udunits2 (不是R包 /usr/include/udunits2 )。

其次,运行此命令有效: install.packages("udunits2_0.13.tar.gz",configure.args='--with-udunits2-include=/usr/include/udunits2')

我希望这次经历可以帮到你。

我只是浪费了一整天试图找出如何安装udunits2包以便能够安装单元包以便能够安装ggforce和ggraph包。

我正在尝试在Ubuntu 16.04上安装它,并且R> = 3.3,因为ggforce是在R 3.3下构建的。

我在这里按照这些说明操作: https://github.com/edzer/units/issues/1https://github.com/edzer/units/issues/1

虽然我的机器上安装了libudunits-2.0和udunits(因为sudo apt-get install udunits2找不到udunits2包),而且我的$ PATH上的libudunits-2和udunits位置的PATH,当我尝试时安装udunits2,单位或ggforce我收到一个错误,说,

--* installing *source* package ‘udunits2’ ...
** package ‘udunits2’ successfully unpacked and MD5 sums checked
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for XML_ParserCreate in -lexpat... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking udunits2.h usability... no
checking udunits2.h presence... no
checking for udunits2.h... no
checking for ut_read_xml in -ludunits2... no
-----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.
     ERROR: configuration failed for package ‘udunits2’
* removing ‘/home/fjay/R/x86_64-pc-linux-gnu-library/3.3/udunits2’
* restoring previous ‘/home/fjay/R/x86_64-pc-linux-gnu-library 
/3.3/udunits2’

The downloaded source packages are in/tmp/Rtmp0syxnJ/downloaded_packages’
Warning message:
In install.packages("udunits2", lib = "/home/fjay/R/x86_64-pc-linux-
 gnu-library/3.3") :
 installation of package ‘udunits2’ had non-zero exit status
>

所以,嗯,它正在寻找udunits2.h和libudunits2.a文件....所以,我从CRAN下载了udunits2,将其解压缩并将其放入我的R库中。 然后,如果我把库(udunits2,lib.loc =“我的库目录”)我得到一个错误,说它没有安装。 所以,当我install.package('udunits2',repo = NULL,libconfig.args =' - with-udunits2-lib = / home / fjay / R / x86_64-pc-linux-gnu-library / 3.3')或install.packages('units',....)或install.packages('ggforce',...)它仍在寻找这些文件......并且,在检查了udunits2包之后,这些文件都没有的udunits2文件夹。

如果有人知道如何安装这个udunits2包请帮助我!


我有同样的问题。 按照 here 的第一个答案你必须安装 -dev 版本的 udunits

sudo apt-get install libudunits2-dev

然后安装 udunits2ggforce 没有任何错误。

编辑:

根据以下评论,对于CentOS7,它应该是:

sudo yum install udunits2-devel

而对于MacOS:

brew install udunits




r