我只是浪费了一整天的时间试图弄清楚如何安装 udunits2 软件包以便能够安装units 软件包以便能够安装ggforce 和ggraph 软件包。
我尝试在 Ubuntu 16.04 和 R >= 3.3 上安装它,因为 ggforce 是在 R 3.3 下构建的。
我在这里遵循了这些说明:https://github.com/edzer/units/issues/1 https://github.com/edzer/units/issues/1
尽管我的机器上安装了 libudunits-2.0 和 udunits (因为 sudo apt-get install udunits2 找不到 udunits2 软件包),并且当我尝试在 R 中时,我的 $PATH 上的 libudunits-2 和 udunits 位置的 PATH安装 udunits2、units 或 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 库中。
然后,如果我输入library(udunits2, lib.loc =“my library dir”),我会收到一条错误消息,指出它尚未安装。因此,当我 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 软件包,请帮助我!