udunits2 R 安装:找不到 udunits2.h

2024-05-28

我正在尝试在 R 中安装 udunits2 以满足对ggforce包裹。但是,安装程序在检查 udunits2 时始终失败。我已经尝试过中的说明this https://stackoverflow.com/questions/47059517/how-install-r-package-udunits2-in-ubuntu/47059608#47059608(udunits 2 devel安装如图here https://i.stack.imgur.com/aH6O5.png.) and this https://stackoverflow.com/a/42580809/9303877线程,它产生相同的结果 https://i.stack.imgur.com/aogMN.png试图install.packages('udunits2').

我只需安装 udunits2-dev 就可以在我的 Mint 机器上运行它,但是我对 Fedora 还很陌生,不确定是什么原因造成的。

系统信息:

Fedora 28,R-3.4.4

EDIT

尝试使用安装时出现错误输出install.packages("udunits2", configure.args = "--with-udunits2-lib=/usr/bin/udunits2"):

* installing *source* package ‘udunits2’ ...
** package ‘udunits2’ successfully unpacked and MD5 sums checked
checking for gcc... gcc -m64
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 -m64 accepts -g... yes
checking for gcc -m64 option to accept ISO C89... none needed
checking for XML_ParserCreate in -lexpat... yes
checking how to run the C preprocessor... gcc -m64 -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/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... yes
-----Error: udunits2.h 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.

在 Fedora 上,头文件安装在/usr/include/udunits2,参见这Github问题 https://github.com/pacificclimate/Rudunits2/issues/14。那里提供的解决方案:

sudo yum install udunits2-devel

其次是:

install.packages("udunits2",configure.args='--with-udunits2-include=/usr/include/udunits2/')
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

udunits2 R 安装:找不到 udunits2.h 的相关文章

随机推荐