Closed MichaelChirico closed 4 years ago
Actually, I've noticed a slight difference in output for this version:
install.packages(
'units',
configure.args = c(
'--with-udunits2-include=/usr/include',
'--with-udunits2-lib=/usr/lib/x86_64-linux-gnu'
)
)
output
configure: units: 0.6-4
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 x86_64-conda_cos6-linux-gnu-c++ -std=gnu++11 accepts -g... yes
checking how to run the C++ preprocessor... x86_64-conda_cos6-linux-gnu-c++ -std=gnu++11 -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... x86_64-conda_cos6-linux-gnu-cc
checking whether we are using the GNU C compiler... yes
checking whether x86_64-conda_cos6-linux-gnu-cc accepts -g... yes
checking for x86_64-conda_cos6-linux-gnu-cc option to accept ISO C89... none needed
checking for XML_ParserCreate in -lexpat... yes
checking udunits2.h usability... no
checking udunits2.h presence... yes
configure: WARNING: udunits2.h: present but cannot be compiled
configure: WARNING: udunits2.h: check for missing prerequisite headers?
configure: WARNING: udunits2.h: see the Autoconf documentation
configure: WARNING: udunits2.h: section "Present But Cannot Be Compiled"
configure: WARNING: udunits2.h: proceeding with the compiler's result
configure: WARNING: ## -------------------------------------------- ##
configure: WARNING: ## Report this to edzer.pebesma@uni-muenster.de ##
configure: WARNING: ## -------------------------------------------- ##
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/RtmplUdnCg/R.INSTALL398a7ede844a/units':
configure: error:
--------------------------------------------------------------------------------
Configuration failed because udunits2.h was not found. Try installing:
* deb: libudunits2-dev (Debian, Ubuntu, ...)
* rpm: udunits2-devel (Fedora, EPEL, ...)
* brew: udunits (OSX)
If udunits2 is already installed in a non-standard location, use:
--configure-args='--with-udunits2-lib=/usr/local/lib'
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.
You can alternatively set UDUNITS2_INCLUDE and UDUNITS2_LIBS manually.
--------------------------------------------------------------------------------
See `config.log' for more details
After installing libudunits2-dev
with apt-get
, you shouldn't use configure.args
. If it doesn't work without, there must be something very strange (and very wrong) with your setup.
Yeap. I see you are using conda. I'm not familiar with conda, but it must be shadowing the system libraries or doing improper things with the paths, because it works with plain Ubuntu.
Ahh, I missed the conda part, thanks. That gives me some ideas. First of which is to delete conda.
Let me play around some more & update in a bit.
Thanks so much @Enchufa2 for the extra pair of eyes.
By rights, since I'm using conda-r
, I should have run:
conda install r-sf
instead of the install.packages('sf')
route. I tried this, but it also failed:
ERROR conda.core.link:_execute(568): An error occurred while installing package 'conda-forge::udunits2-2.2.27.6-h4e0c4b3_1001'.
PermissionError(13, 'Permission denied')
Attempting to roll back.
Rolling back transaction: done
[Errno 13] Permission denied: '/opt/conda/etc/conda/activate.d/udunits2-activate.sh'
However, I don't think there's any issue with units
here, but my own setup.
I have no clue about conda, but if it wants to write in /opt
, you may want to run it under sudo
.
Yep, that would be the next step... sadly I don't have sudo
permissions there, so I have to go through the backdoor & rebuild our Dockerfile.
For the record I have the same problem and was because conda.
I did: conda deactivate
and then install.packages("units")
and works fine.
I ran into this same issue and was able to solve it, so I figured I'd share the solution here. I too was using conda. In my case I have a project using renv to manage packages so I didn't want to install r-units directly. I was able to fix it like this:
First, I installed the udunits2 library using conda:
$ conda install -c conda-forge udunits2
Then, in R, I told renv to find the units includes and libraries inside my miniconda instance:
> config <- c(units="--with-udunits2-lib=/path/to/home/directory/miniconda3/lib --with-udunits2-include=/path/to/home/directory/miniconda3/include")
> options(configure.args=config)
> renv::install("units")
Presumably, you should be able to use install.packages("units", configure.args="<configure args>")
the same way. Or alternatively just install r-units
using conda if you don't care about renv or whatever.
I am also having problem installing the units package on LInux. My error is
Warning in install.packages :
installation of package ‘units’ had non-zero exit status
If there's anyone here that could help me with this, I would really appreciate it
@Namita-Joshi We would need the complete output. Is libudunits2-dev
installed in your system?
I don't have the libudunits2-dev installed on my system, which is probably why I can't install 'units' However, I tried installing libudunits2-dev but I got an error. Please see the attached image
There's something wrong with your installation. Try the suggested commands. You missed sudo
in the last one.
That worked! Managed to install the units package. Thank you!
I'm having a similar issue - I need to install units
on an enterprise cloud environment running Ubuntu 18.04. I don't have the highest permissions and am very new to the Linux world:
2022-12-02T17:16:18.83-0500 [STG/0] OUT R version 4.2.2 (2022-10-31) -- "Innocent and Trusting"
2022-12-02T17:16:18.83-0500 [STG/0] OUT Copyright (C) 2022 The R Foundation for Statistical Computing
2022-12-02T17:16:18.83-0500 [STG/0] OUT Platform: x86_64-pc-linux-gnu (64-bit)
2022-12-02T17:16:18.83-0500 [STG/0] OUT R is free software and comes with ABSOLUTELY NO WARRANTY.
2022-12-02T17:16:18.83-0500 [STG/0] OUT You are welcome to redistribute it under certain conditions.
2022-12-02T17:16:18.83-0500 [STG/0] OUT Type 'license()' or 'licence()' for distribution details.
2022-12-02T17:16:18.83-0500 [STG/0] OUT Natural language support but running in an English locale
2022-12-02T17:16:18.83-0500 [STG/0] OUT R is a collaborative project with many contributors.
2022-12-02T17:16:18.83-0500 [STG/0] OUT Type 'contributors()' for more information and
2022-12-02T17:16:18.83-0500 [STG/0] OUT 'citation()' on how to cite R or R packages in publications.
2022-12-02T17:16:18.83-0500 [STG/0] OUT Type 'demo()' for some demos, 'help()' for on-line help, or
2022-12-02T17:16:18.83-0500 [STG/0] OUT 'help.start()' for an HTML browser interface to help.
2022-12-02T17:16:18.83-0500 [STG/0] OUT Type 'q()' to quit R.
2022-12-02T17:16:18.94-0500 [STG/0] OUT > install.packages(c("./vendor_r/units_0.8-0.tar.gz"), repos=NULL, dependencies=TRUE, Ncpus=2)
2022-12-02T17:16:19.38-0500 [STG/0] OUT * installing *source* package ‘units’ ...
2022-12-02T17:16:19.38-0500 [STG/0] OUT ** package ‘units’ successfully unpacked and MD5 sums checked
2022-12-02T17:16:19.38-0500 [STG/0] OUT ** using staged installation
2022-12-02T17:16:19.58-0500 [STG/0] OUT configure: units: 0.8-0
2022-12-02T17:16:19.85-0500 [STG/0] OUT checking whether the C++ compiler works... yes
2022-12-02T17:16:19.85-0500 [STG/0] OUT checking for C++ compiler default output file name... a.out
2022-12-02T17:16:20.24-0500 [STG/0] OUT checking for suffix of executables...
2022-12-02T17:16:20.32-0500 [STG/0] OUT checking whether we are cross compiling... no
2022-12-02T17:16:20.35-0500 [STG/0] OUT checking for suffix of object files... o
2022-12-02T17:16:20.38-0500 [STG/0] OUT checking whether we are using the GNU C++ compiler... yes
2022-12-02T17:16:20.41-0500 [STG/0] OUT checking whether g++ -std=gnu++14 accepts -g... yes
2022-12-02T17:16:20.45-0500 [STG/0] OUT checking how to run the C++ preprocessor... g++ -std=gnu++14 -E
2022-12-02T17:16:20.49-0500 [STG/0] OUT checking for grep that handles long lines and -e... /bin/grep
2022-12-02T17:16:20.50-0500 [STG/0] OUT checking for egrep... /bin/grep -E
2022-12-02T17:16:20.68-0500 [STG/0] OUT checking for ANSI C header files... yes
2022-12-02T17:16:20.73-0500 [STG/0] OUT checking for sys/types.h... yes
2022-12-02T17:16:20.79-0500 [STG/0] OUT checking for sys/stat.h... yes
2022-12-02T17:16:20.85-0500 [STG/0] OUT checking for stdlib.h... yes
2022-12-02T17:16:20.91-0500 [STG/0] OUT checking for string.h... yes
2022-12-02T17:16:20.98-0500 [STG/0] OUT checking for memory.h... yes
2022-12-02T17:16:21.04-0500 [STG/0] OUT checking for strings.h... yes
2022-12-02T17:16:21.10-0500 [STG/0] OUT checking for inttypes.h... yes
2022-12-02T17:16:21.16-0500 [STG/0] OUT checking for stdint.h... yes
2022-12-02T17:16:21.23-0500 [STG/0] OUT checking for unistd.h... yes
2022-12-02T17:16:21.26-0500 [STG/0] OUT checking for stdbool.h that conforms to C99... no
2022-12-02T17:16:21.32-0500 [STG/0] OUT checking for _Bool... no
2022-12-02T17:16:21.39-0500 [STG/0] OUT checking for error_at_line... yes
2022-12-02T17:16:21.39-0500 [STG/0] OUT checking for gcc... gcc
2022-12-02T17:16:21.45-0500 [STG/0] OUT checking whether we are using the GNU C compiler... yes
2022-12-02T17:16:21.48-0500 [STG/0] OUT checking whether gcc accepts -g... yes
2022-12-02T17:16:21.52-0500 [STG/0] OUT checking for gcc option to accept ISO C89... none needed
2022-12-02T17:16:21.58-0500 [STG/0] OUT checking for XML_ParserCreate in -lexpat... yes
2022-12-02T17:16:21.63-0500 [STG/0] OUT checking udunits2.h usability... no
2022-12-02T17:16:21.65-0500 [STG/0] OUT checking udunits2.h presence... no
2022-12-02T17:16:21.65-0500 [STG/0] OUT checking for udunits2.h... no
2022-12-02T17:16:21.70-0500 [STG/0] OUT checking udunits2/udunits2.h usability... no
2022-12-02T17:16:21.72-0500 [STG/0] OUT checking udunits2/udunits2.h presence... no
2022-12-02T17:16:21.72-0500 [STG/0] OUT checking for udunits2/udunits2.h... no
2022-12-02T17:16:21.78-0500 [STG/0] OUT checking for ut_read_xml in -ludunits2... no
2022-12-02T17:16:21.78-0500 [STG/0] OUT configure: error: in `/tmp/Rtmp6YIjSI/R.INSTALL14a13ff22e5/units':
2022-12-02T17:16:21.78-0500 [STG/0] OUT configure: error:
2022-12-02T17:16:21.78-0500 [STG/0] OUT --------------------------------------------------------------------------------
2022-12-02T17:16:21.78-0500 [STG/0] OUT Configuration failed because libudunits2.so was not found. Try installing:
2022-12-02T17:16:21.78-0500 [STG/0] OUT * deb: libudunits2-dev (Debian, Ubuntu, ...)
2022-12-02T17:16:21.78-0500 [STG/0] OUT * rpm: udunits2-devel (Fedora, EPEL, ...)
2022-12-02T17:16:21.78-0500 [STG/0] OUT * brew: udunits (OSX)
2022-12-02T17:16:21.78-0500 [STG/0] OUT If udunits2 is already installed in a non-standard location, use:
2022-12-02T17:16:21.78-0500 [STG/0] OUT --configure-args='--with-udunits2-lib=/usr/local/lib'
2022-12-02T17:16:21.78-0500 [STG/0] OUT if the library was not found, and/or:
2022-12-02T17:16:21.78-0500 [STG/0] OUT --configure-args='--with-udunits2-include=/usr/include/udunits2'
2022-12-02T17:16:21.78-0500 [STG/0] OUT if the header was not found, replacing paths with appropriate values.
2022-12-02T17:16:21.78-0500 [STG/0] OUT You can alternatively set UDUNITS2_INCLUDE and UDUNITS2_LIBS manually.
2022-12-02T17:16:21.78-0500 [STG/0] OUT --------------------------------------------------------------------------------
2022-12-02T17:16:21.78-0500 [STG/0] OUT See `config.log' for more details
2022-12-02T17:16:21.81-0500 [STG/0] OUT ERROR: configuration failed for package ‘units’
2022-12-02T17:16:21.81-0500 [STG/0] OUT * removing ‘/tmp/contents241212264/deps/0/r/library/units’
2022-12-02T17:16:21.83-0500 [STG/0] OUT Warning message:
2022-12-02T17:16:21.83-0500 [STG/0] OUT In install.packages(c("./vendor_r/units_0.8-0.tar.gz"), repos = NULL, :
2022-12-02T17:16:21.83-0500 [STG/0] OUT installation of package ‘./vendor_r/units_0.8-0.tar.gz’ had non-zero exit status
As the error message points out, you need the udunits2 library, so you'll need to ask an admin with the proper rights to install it, or compile it yourself from source and point to its location following what the error message suggests.
Ok, thank you very much!
I've run into & been able to solve this issue many times on a few different systems, but I'm stuck this time. First, from
sessionInfo()
:When running
install.packages('units')
I get the familiar:(BTW, I'm not sure where that
config.log
is written?)However, I've already successfully installed all the packages as near as I can tell:
Ran successfully. Now, the possibility is that I'm not
include
ing the right location during install, which should be covered by the--configure-args
part of the helpful message. First, I looked forut_read_xml
in my/usr/include
:So it seems the header is in the "normal" place; anyway, I tried:
Both to no avail.
To make sure I was pointing to the right place per my
sudo apt-get install
ation, I ran:Noting that
libudunits2.so
was mentioned by theconfigure
error, I tried to point to this as well:All fail the same way. As one last attempt to see if it's related to permissions, I ran:
It seems
libudunits2.so
is symlinked to a file that has more restricted permissions, but unfortunately I don't have rights to edit this. Is this a red herring? What else can I try to getunits
installed?