Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

udunits2 R install: udunits2.h not found

Tags:

r

I'm trying to install udunits2 in R in order to satisfy the dependency for the ggforce package. However, the installer keeps failing on the check for udunits2. I have tried the instructions in this (udunits 2 devel is installed as shown here.) and this thread, which produces the same result as trying to install.packages('udunits2').

I was able to get it working on my Mint machine by just installing udunits2-dev, however I'm quite new to Fedora, and am not sure what is causing this.

System info:

Fedora 28, R-3.4.4

EDIT

Error output when trying to install using 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.
like image 981
wolff Avatar asked May 16 '18 03:05

wolff


1 Answers

On Fedora the header file is installed in /usr/include/udunits2, c.f. this Github issue. Solution provided there:

sudo yum install udunits2-devel

Followed by:

install.packages("udunits2",configure.args='--with-udunits2-include=/usr/include/udunits2/')
like image 92
Ralf Stubner Avatar answered Oct 24 '22 15:10

Ralf Stubner