安装units R软件包时找不到udunits2.h

时间:2018-08-21 19:20:07

标签: r gcc compilation header-files r-package

我已经安装了udunits2 R软件包,但是即使我使用units包含正确的标题和库,configure.arg R软件包仍然失败:

$ ls /path/apps/udunits/2.2.26/x86_64-linux-2.6-rhel6/include/
converter.h  udunits2.h  udunits.h

$ ls /path/apps/udunits/2.2.26/x86_64-linux-2.6-rhel6/lib/
libudunits2.a   libudunits2.so    libudunits2.so.0.1.0
libudunits2.la  libudunits2.so.0

从软件包安装中登录:

> library(udunits2)
udunits system database read

configure.args = c(
  '--with-udunits2-lib=/path/apps/udunits/2.2.26/x86_64-linux-2.6-rhel6/lib/',
  '--with-udunits2-include=/path/apps/udunits/2.2.26/x86_64-linux-2.6-rhel6/include/'
)

> install_packages("units", reps, configure.args = configure.args)

* installing *source* package ‘units’ ...
** package ‘units’ successfully unpacked and MD5 sums checked
configure: units: 0.6-0
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 g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -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 for stdbool.h that conforms to C99... no
checking for _Bool... no
checking for error_at_line... yes
checking for gcc... gcc
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 udunits2.h usability... no
checking udunits2.h presence... no
checking for udunits2.h... no
checking udunits2/udunits2.h usability... no
checking udunits2/udunits2.h presence... no
checking for udunits2/udunits2.h... no
checking for ut_read_xml in -ludunits2... yes
configure: error: in `/tmp/RtmpPvLQ81/R.INSTALL1c932925e979/units':
configure: 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, 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 for your
  installation. You can alternatively use the UDUNITS2_INCLUDE and UDUNITS2_LIBS
  environment variables.

  If udunits2 is not installed, please install it.
  It is required for this package.
------------------------------------------

文件udunits2.h在路径中:

$ls /path/apps/udunits/2.2.26/x86_64-linux-2.6-rhel6/include/:
converter.h  udunits2.h  udunits.h 

设置环境变量也无济于事:

export UDUNITS2_INCLUDE="/path/apps/udunits/2.2.26/x86_64-linux-2.6-rhel6/include"
export UDUNITS2_LIB="/apps/udunits/2.2.26/x86_64-linux-2.6-rhel6/lib"

有什么想法会导致units无法安装?

0 个答案:

没有答案