pacificclimate / rudunits2 Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v2.0
License: GNU General Public License v2.0
Hi, I am not able to install udunits2 package for R. "sudo apt-get install libudunits2-dev" as suggested in this link (stackoverflow.com/questions/42287164/…) does not work on mac. And none of the other comments worked.
Ultimate goal is to install “sf” in R; the error I get: …anaconda3/bin/x86_64-apple-darwin13.4.0-gfortran: No such file or directory. I think the dependency is on ‘units’, and ‘classInt’, which depend upon udunits2. Any help would be deeply appreciated. Have been struggling for last 1 day. Link.
mukim:anaconda3 sherrymukim$ R CMD INSTALL sf_0.6-0.tar.gz --configure-args='-with-gdal-config=/Library/Frameworks/GDAL.framework/Versions/2.1/unix/bin/gdal-config -with-geos-config=/Library/Frameworks/GEOS.framework/Versions/3/unix/bin/geos-config'
* installing to library ‘/Users/sherrymukim/anaconda3/lib/R/library’
ERROR: dependencies ‘units’, ‘classInt’ are not available for package ‘sf’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/sf’
From Kurt Hornik:
Dear maintainers,
This concerns CRAN packages maintained by one of you, see the long list
at the end of this message.These packages document package metadata (specifically, package
versions) in their *-package Rd file(s) which have gotten out of sync
with the actual package metadata in the DESCRIPTION file.Most likely, these Rd files were generated by older versions of
utils::promptPackage() (maybe via utils::package.skeleton()), which
generated package documentation shells/skeletons with copies of the
current package metadata. This was not a good idea, as inevitably such
copies go out of sync with their master values. The R 3.2.0 release
(3 years ago) didA number of macros have been added in the new 'share/Rd' directory for
use in package overview help pages, and promptPackage() now makes use
of them.(so that package documentation shells/skeletons generated with current
versions of utils::promptPackage() use Rd macro references to the
package metadata values instead of making copies).Can you please bring package Rd files "up to date"? The simplest may be
using a current utils::promptPackage() to re-generate the
shell/skeleton, and merge with the content of the current package Rd
file. (In case the updated package Rd file would more or less only
duplicate the package metadata, feel free to drop the package Rd file
from your package sources.)
R/windows/load.R contains an .onLoad function which unconditionally sets the UDUNITS2_XML_PATH environment variable, so ignores any user specified value. I don't know why this was done, and I don't know whether it's specific to Windows (as suggested by the directory name), but it makes it difficult to specify a database with custom units.
Workaround:
# Load but don't attach library
loadNamespace("udunits2")
Sys.setenv(UDUNITS2_XML_PATH = "udunits/udunits2.xml")
# Attach library, read database using new value of UDUNITS2_XML_PATH
library(udunits2)
this crashes my R session:
ud.convert(c(1,2,3), NULL, "meter")
devtools::session_info()
Session info -----------------------------------------------------------------------------------------------------------------------
setting value
version R version 3.5.0 (2018-04-23)
system x86_64, darwin15.6.0
ui RStudio (1.1.456)
language (EN)
collate en_US.UTF-8
tz America/Los_Angeles
date 2018-08-10
Packages ---------------------------------------------------------------------------------------------------------------------------
package * version date source
assertthat 0.2.0 2017-04-11 CRAN (R 3.5.0)
backports 1.1.2 2017-12-13 CRAN (R 3.5.0)
base * 3.5.0 2018-04-24 local
base64enc 0.1-3 2015-07-28 CRAN (R 3.5.0)
bindr 0.1.1 2018-03-13 CRAN (R 3.5.0)
bindrcpp 0.2.2 2018-03-29 CRAN (R 3.5.0)
commonmark 1.5 2018-04-28 cran (@1.5)
compiler 3.5.0 2018-04-24 local
curl 3.2 2018-03-28 CRAN (R 3.5.0)
dataone 2.1.1 2018-08-10 Github (DataONEorg/rdataone@b753626)
datapack 1.3.1 2017-08-29 cran (@1.3.1)
datasets * 3.5.0 2018-04-24 local
devtools 1.13.5 2018-02-18 CRAN (R 3.5.0)
digest 0.6.15 2018-01-28 CRAN (R 3.5.0)
dplyr * 0.7.6 2018-06-29 cran (@0.7.6)
eml2 0.1.0 2018-08-10 Github (cboettig/eml2@d95a1b1)
emld 0.0.0.9900 2018-08-10 Github (cboettig/emld@ad03f83)
evaluate 0.10.1 2017-06-24 CRAN (R 3.5.0)
glue 1.3.0 2018-07-31 Github (tidyverse/glue@a292148)
graphics * 3.5.0 2018-04-24 local
grDevices * 3.5.0 2018-04-24 local
hash 2.2.6 2013-02-21 cran (@2.2.6)
hms 0.4.2 2018-03-10 CRAN (R 3.5.0)
htmltools 0.3.6 2017-04-28 CRAN (R 3.5.0)
httr 1.3.1 2017-08-20 CRAN (R 3.5.0)
jqr 1.0.0 2017-09-28 cran (@1.0.0)
jsonld 2.0 2018-05-03 cran (@2.0)
jsonlite 1.5 2017-06-01 CRAN (R 3.5.0)
knitr 1.20 2018-02-20 CRAN (R 3.5.0)
lazyeval 0.2.1 2017-10-29 CRAN (R 3.5.0)
lubridate 1.7.4 2018-04-11 CRAN (R 3.5.0)
magrittr 1.5 2014-11-22 CRAN (R 3.5.0)
memoise 1.1.0 2017-04-21 CRAN (R 3.5.0)
metajam * 1.0 2018-08-10 Github (NCEAS/metajam@087a297)
methods * 3.5.0 2018-04-24 local
parsedate 1.1.3 2017-03-02 cran (@1.1.3)
pillar 1.2.3 2018-05-25 CRAN (R 3.5.0)
pkgconfig 2.0.1 2017-03-21 CRAN (R 3.5.0)
plyr 1.8.4 2016-06-08 CRAN (R 3.5.0)
purrr * 0.2.5 2018-05-29 CRAN (R 3.5.0)
R6 2.2.2 2017-06-17 CRAN (R 3.5.0)
Rcpp 0.12.17 2018-05-18 CRAN (R 3.5.0)
readr * 1.1.1 2017-05-16 CRAN (R 3.5.0)
redland 1.0.17-9 2016-12-15 cran (@1.0.17-)
rlang 0.2.1 2018-05-30 CRAN (R 3.5.0)
rmarkdown 1.10 2018-06-11 CRAN (R 3.5.0)
roxygen2 6.0.1 2017-02-06 cran (@6.0.1)
rprojroot 1.3-2 2018-01-03 CRAN (R 3.5.0)
stats * 3.5.0 2018-04-24 local
stringi 1.2.3 2018-06-12 CRAN (R 3.5.0)
stringr * 1.3.1 2018-05-10 CRAN (R 3.5.0)
tibble 1.4.2 2018-01-22 CRAN (R 3.5.0)
tidyr 0.8.1 2018-05-18 CRAN (R 3.5.0)
tidyselect 0.2.4 2018-02-26 CRAN (R 3.5.0)
tools 3.5.0 2018-04-24 local
udunits2 * 0.13 2016-11-17 CRAN (R 3.5.0)
utils * 3.5.0 2018-04-24 local
uuid 0.1-2 2015-07-28 CRAN (R 3.5.0)
V8 1.5 2017-04-25 cran (@1.5)
withr 2.1.2 2018-03-15 CRAN (R 3.5.0)
XML 3.98-1.13 2018-08-01 cran (@3.98-1.)
xml2 1.2.0 2018-01-24 CRAN (R 3.5.0)
yaml 2.2.0 2018-07-25 cran (@2.2.0)
I just stumbled over an implementation of ud.conver()
that caused me some trouble. The function ignores a change in units in the u1
argument. I have posted a detailed explanation here. Can this be changed? Unfortunately I don't know any C to propose a change.
Hi,
I have an issue with respect to compiling the R udunits2 package when the udunits2 library is not installed to a default location. UDUNITS2_LIB
seems not to be considered during some steps of the contest procedure.
This function call
install.packages('udunits2_0.13.tar.gz', configure.vars="UDUNITS2_INCLUDE=path_to_include UDUNITS2_LIB=path_to_lib")
leads to an error:
...
checking udunits2.h usability... yes
checking udunits2.h presence... yes
checking for udunits2.h... yes
checking for ut_read_xml in -ludunits2... no
-----Error: libudunits2.a not found-----
...
Instead
install.packages('udunits2_0.13.tar.gz', configure.vars="UDUNITS2_INCLUDE=path_to_include UDUNITS2_LIB=path_to_lib LIBS=-Lpath_to_lib")
solves the issue:
...
checking udunits2.h usability... yes
checking udunits2.h presence... yes
checking for udunits2.h... yes
checking for ut_read_xml in -ludunits2... yes
...
Thus, -L${UDUNITS2_LIB}
seems not to be set properly or too late. The same issue occurs when I provide --with-udunits2-lib=...
.
My system:
I had a brief look into the configure.ac and tried to find out the problem (and provide a pull request) but did not find it. Since the header files were found, UDUNITS2_INCLUDE seems to be used. Strange that UDUNITS2_LIB is not used properly.
edit:
Cheers,
Daniel
> library(udunits2)
> ud.get.symbol("inch")
[1] ""
> ud.get.symbol("meter")
[1] "m"
Why does ud.get.symbol()
return ""
most of the time (it seems for all but the base units)?
@jameshiebert, is this repos / package still maintained? Last CRAN update was Nov 2016.
I'm asking because Issue #25 causes lots of extra work to end-users but also sysadms around the world. There should be a simple fix to it and if deployed and uploaded to CRAN there will be lots of hours and frustration saved every day.
If not maintained, maybe there are others who are willing to take over the maintenance of this package?
The following outputs -1.11022302462516e-16
instead of 0
:
udunits2::ud.convert(1, "in", "in") - 1
This leads to cairo_pdf
saving images with size 71 pt x 71 pt
rather than 72 pt x 72 pt
according to pdfinfo
, which is quite visible in exactly aligned images.
I wonder if trivial conversions (in -> in
, for example) could be skipped to maintain accuracy.
I work with data which uses concentration in both mass and molar units (like ng/mL and nmol/L). I'd like to enable conversion between the mass and molar units. While it's possible to add a .xml units file before loading the library, keeping track of all the files would be complex.
What do you think of adding a two functions to the library like:
ud.map.unit("g", 350, "mole")
ud.reload.system()
Where the first command would add a mapping from mass units to molar units with a conversion of 350 g = 1 mole. And, the second command would reload the unit system to the system default (removing any mapped units).
Have been having trouble getting udunits2 installed on a computing cluster. Initally was getting the "libudunits2.a not found" error but solved that using the code from here https://github.com/pacificclimate/Rudunits2/issues/20#issuecomment-343664557. I'm now getting this error:
`* installing source package ‘udunits2’ ...
** package ‘udunits2’ successfully unpacked and MD5 sums checked
checking for gcc... gcc -m64 -std=gnu99
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 -std=gnu99 accepts -g... yes
checking for gcc -m64 -std=gnu99 option to accept ISO C89... none needed
checking for XML_ParserCreate in -lexpat... yes
checking how to run the C preprocessor... gcc -m64 -std=gnu99 -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... yes
checking udunits2.h presence... yes
checking for udunits2.h... yes
checking for ut_read_xml in -ludunits2... yes
configure: creating ./config.status
config.status: creating src/Makevars
** libs
gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -I/rds/general/user/nskene/home/udunits/local/include -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c udunits2_R.c -o udunits2_R.o
gcc -m64 -std=gnu99 -shared -L/usr/lib64/R/lib -Wl,-z,relro -o udunits2.so udunits2_R.o -ludunits2 -lexpat -L/rds/general/user/nskene/home/udunits/local/lib -lexpat -ludunits2 -L/usr/lib64/R/lib -lR
installing to /rdsgpfs/general/user/nskene/home/R/x86_64-redhat-linux-gnu-library/3.5/udunits2/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
converting help for package ‘udunits2’
finding HTML links ... done
ud.are.convertible html
ud.convert html
ud.get.name html
ud.have.unit.system html
ud.is.parseable html
ud.set.encoding html
udunits2-package html
** building package indices
** testing if installed package can be loaded
Error: package or namespace load failed for ‘udunits2’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/rdsgpfs/general/user/nskene/home/R/x86_64-redhat-linux-gnu-library/3.5/udunits2/libs/udunits2.so':
libimf.so: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
The downloaded source packages are in
‘/rdsgpfs/general/ephemeral/user/nskene/ephemeral/RtmpF7f5j8/downloaded_packages’
Warning message:
In install.packages("udunits2", type = "source", configure.args = c(paste0("--with-udunits2-include=", :
installation of package ‘udunits2’ had non-zero exit status`
Would really appreciate any suggestions on how to get it to find libimf.so! Thanks
Hi,
We are having trouble installing udunits2 on R 3.3.2 using linux and using Rstudio server pro. The message we get is the package is unavailable for this version of R. Is this a known issue? I don't have this issue on my local windows computer using the same version of R. Any assistance would be very helpful.
Thanks,
Aaron
On RHEL6.3 with udunits2 installed to my home directory, I currently need to manually load libudunits2.so.0
:
library(udunits2)
#> Error: package or namespace load failed for ‘udunits2’ in dyn.load(file, DLLpath = DLLpath, ...):
#> unable to load shared object '/home/kendon.bell/R/x86_64-pc-linux-gnu-library/3.4/udunits2/libs/udunits2.so':
#> libudunits2.so.0: cannot open shared object file: No such file or directory
homedir <- Sys.getenv("HOME")
udunits_dir <- file.path(Sys.getenv("HOME"), "udunits") # installed here
dyn.load(paste0(udunits_dir, "/local/lib/libudunits2.so.0"))
library(udunits2)
#> udunits system database read from /home/kendon.bell/udunits/local/share/udunits/udunits2.xml
What environment variable do I need to set for udunits2 to find libudunits2.so.0
? Thanks for any help
ud.covert uses rep()
to construct the return value before filling it in. Unfortunately, rep()
fails for vector sizes > 2^32 or 4GB. ud.convert
should be changed to use rep_len
(which is unaffected) or to not use rep at all.
This is related to #14 , that should have been fixed by #19.
I can't install the package if udunits2
is not inside the /usr/include
directory. The header file is in /usr/include/udunits
that thanks to #19, it should be searched in.
However, install.packages("udunits2")
fails with this error
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.
It works if I use install.packages("udunits2",configure.args='--with-udunits2-include=/usr/include/udunits2/')
but it does not work if I use environment variable UDUNITS2_INCLUDE
export UDUNITS2_INCLUDE=/usr/include/udunits2
Rscript -e 'install.packages("udunits")'
I have tried few ways to configure environment variable, and I can't make it to work.
Also, /usr/include/udunits2
should have searched
Lines 13 to 23 in 282e732
Is this working for someone ? Should I dig deeper on what is going on ?
Thank you for your advice.
For the context, I need to work with environment variable for a use case with packrat
that cannot handle option configure.args='--with-udunits2-include=/usr/include/udunits2/'
On Fedora 25, the distro package udunits2-devel installs udunits2.h
to /usr/include/udunits2
. It would be most useful if the configure routine could also look in this location rather than having to remember to use configure.args
when installing package via install.packges()
.
I am getting an error during installation of uduntis2 under R 3.4.1. An undefined symbol: ut_ignore
in file ‘udunits2/libs/udunits2.so’: Found no calls to: ‘R_registerRoutines’, ‘R_useDynamicSymbols’
install.packages("udunits2")
Installing package into ‘/home/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
trying URL 'https://cran.uni-muenster.de/src/contrib/udunits2_0.13.tar.gz'
Content type 'application/x-gzip' length 67182 bytes (65 KB)
==================================================
downloaded 65 KB
* installing *source* package ‘udunits2’ ...
** package ‘udunits2’ successfully unpacked and MD5 sums checked
checking for gcc... gcc -std=gnu99
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 -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking for XML_ParserCreate in -lexpat... yes
checking how to run the C preprocessor... gcc -std=gnu99 -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... yes
checking udunits2.h presence... yes
checking for udunits2.h... yes
checking for ut_read_xml in -ludunits2... yes
configure: creating ./config.status
config.status: creating src/Makevars
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.4.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c udunits2_R.c -o udunits2_R.o
gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-z,relro -o udunits2.so udunits2_R.o -fopenmp -lgomp -L/usr/lib/R/lib -lR
installing to /home/R/x86_64-pc-linux-gnu-library/3.4/udunits2/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error: package or namespace load failed for ‘udunits2’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/R/x86_64-pc-linux-gnu-library/3.4/udunits2/libs/udunits2.so':
/home/R/x86_64-pc-linux-gnu-library/3.4/udunits2/libs/udunits2.so: undefined symbol: ut_ignore
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/R/x86_64-pc-linux-gnu-library/3.4/udunits2’
The downloaded source packages are in
‘/tmp/RtmprikgzO/downloaded_packages’
Warning message:
In install.packages("udunits2") :
installation of package ‘udunits2’ had non-zero exit status
sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux buster/sid
Matrix products: default
BLAS: /usr/lib/openblas-base/libblas.so.3
LAPACK: /usr/lib/libopenblasp-r0.2.20.so
locale:
[1] LC_CTYPE=en_GB.utf8 LC_NUMERIC=C
[3] LC_TIME=en_GB.utf8 LC_COLLATE=en_GB.utf8
[5] LC_MONETARY=en_GB.utf8 LC_MESSAGES=en_GB.utf8
[7] LC_PAPER=en_GB.utf8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.utf8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.4.1
Posting as an image since GH seems to mangle it differently.
Not sure the best way to fix this. cross posted from r-quantities/units#73
Hi, I have a package on CRAN than depends on udunits2 and was following it's orphaned status. I came here and saw that there were new commits so I didn't worry too much but I now need to update my package and wanted to know if there's a rough timeframe for when the package will be updated. Do you need any help?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.