-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
units not working due to missing udunits C libraries #1
Comments
To be fair, the udunits2 R package does specifically declare a SystemRequirements which, by definition, has to be dealt with outside of the R packaging environment. |
The problem is that this is left to the user, and many R users don't know what to do. Add a README.md to the Rudunits2 project, link from here? Where can windows binaries of udunits be found? |
It may be just easiest to bundle libudunits2 with the |
Why would windows users need to install from source? |
Oh, it does on my system, too. @ultinomics mentioned that "t doesn't actually work out-of-the-box"... |
I have added windows builds on rwinlib/udunits and also created a PR on the R package which automatically uses these builds when building the package from source on Windows: pacificclimate/Rudunits2#7 |
This is because on windows CRAN packages, external dependencies (SysRequirements) are linked statically to the shared library in the package. It seems this is also the case on mac -- @ultinomics installed from source. Thanks for the pointer to rwinlib! |
just for the record, on mac and to complete the nice @ultinomics's answer
|
Is there a prospect for a near-term resolution of this? I'd like to add to my package a dependency on ggforce, which depends on units 0.4, but then the udunits issue breaks my travis builds. |
Not sure if I understand your issue: have you seen this? Or are you trying a MacOSX flavor of travis? |
Yes, and both osx and linux. Compare this: https://travis-ci.org/elbamos/largeVis/jobs/183274802 (OSX build works), with this https://travis-ci.org/elbamos/largeVis/jobs/183274804 (everything identical but using R-devel, build fails). (A similar issue may be arising with Ubuntu and 64-bit builds, but I'm not yet sufficiently confident in the issue to report it. I'll know tonight.) |
Well, it's your call that you want to do a macosx travis for r-devel, for which cran does not have binaries available: it means that you'll have to install udunits2 for this platform from source too. Although that is no problem at all in itself, IMHO you're overdoing your eagerness to check everything you can with this target: is it worth the effort? |
Hah! Well, cran requires it, and I've had so many issues of compilation problems on different platforms (my package makes extensive use of c++11, openmp, 64-but libraries etc.), that I feel a need to be thorough. I'm also checking with valgrind... id much rather find out from cran than get a moderately judgmental email from the cran maintainers.
Not sure I understand why this would require a different installation of udunits. I'm installing the library with brew and the R package from source in both cases.
… On Dec 12, 2016, at 11:07 AM, Edzer Pebesma ***@***.***> wrote:
Well, it's your call that you want to do a macosx travis for r-devel, for which cran does not have binaries available: it means that you'll have to install udunits2 for this platform from source too. Although that is no problem at all in itself, IMHO you're overdoing your eagerness to check everything you can with this target: is it worth the effort?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
No, CRAN requires you test with r-devel, it doesn't specify on which platform. CRAN binary packages for MacOSX come with statically linked libraries, meaning the udunits2 C library is part of the udunits2 R package, and ignored by the R package. I don't think that your first travis build mentioned above installs source packages: extension .tgz indicates binary MacOSX packages, source pkgs have .tar.gz extension. |
There are no CRAN binary package for
to the osx/r-devel entry in your travis build matrix. |
I have the brew line in there already for all OS X builds - it's still throwing that error.
… On Dec 12, 2016, at 11:22 AM, Jeroen Ooms ***@***.***> wrote:
There are no CRAN binary package for r-devel so on these targets you need to build from source and hence need to ensure that the system dependencies are available. Just add a line brew_packages: udunits to the osx/r-devel entry in your travis build matrix.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
The error messages you see on the travis output, as well as the message in this issue just above your first one here are all pretty full with instructions on how to solve this. Also, your issue is really with udunits2, not with this package. |
I'm trying to install this package and am it's failing, telling me
I tried to install it with:
Although, I also set the suggested I installed the |
Package |
Thanks, Edzer. Applying the same |
I just spent half a day on this! Thanks @ginolhac for the solution. It would be nice to see this somewhere on the sfr package README after |
the same issue has also been discussed here |
For those users who are working on a cluster and don't have root access, the following worked for me. Hope it helps someone! From within R: homedir <- Sys.getenv("HOME")
udunits_dir <- file.path(Sys.getenv("HOME"), "udunits")
system(paste0("mkdir ", udunits_dir))
system(paste0("wget --directory-prefix=", udunits_dir, " ftp://ftp.unidata.ucar.edu/pub/udunits/udunits-2.2.26.tar.gz"))
owd <- getwd()
setwd(udunits_dir)
system("tar xzvf udunits-2.2.26.tar.gz")
setwd(file.path(udunits_dir, "udunits-2.2.26"))
system(paste0("./configure --prefix=", udunits_dir, "/local"))
system("make")
system("make install")
setwd(owd)
Sys.setenv(LD_LIBRARY_PATH=paste0(Sys.getenv("LD_LIBRARY_PATH"), ":", udunits_dir, "/local/lib"))
install.packages("udunits2",
type = "source",
configure.args = c(paste0("--with-udunits2-include=", udunits_dir, "/local/include"),
paste0("--with-udunits2-lib=", udunits_dir, "/local/lib")),
repos = "http://cran.rstudio.com")
dyn.load(paste0(udunits_dir, "/local/lib/libudunits2.so.0"))
devtools::install_github("r-quantities/units",
args=paste0("--configure-args=\"--with-udunits2-lib=", udunits_dir,
"/local/lib --with-udunits2-include=", udunits_dir, "/local/include\"")) You will then need to add: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH":"$HOME"/udunits/local/lib" to your |
Thank you for your solution. It worked and I was able to install "udunits2", and "units". However, as you do not mention "ClassInt", installing it, is throwing an error.I have Xcode installed on my mac. Thank you.
|
@sagar-m This has nothing to do with |
@jeroen that was an excellent suggestion. I do have R for mac, but because I use Anaconda for spyder (python), and they have R studio, thus I was using it. I was able to download sf (binary), and "ClassInt" (source) using R for mac. Thank you very much. |
Wanted to mention that on CentOS after doing the yum install Seems to have worked. |
I followed instructions of @dantonnoriega (thanks!) and I seem to have succesfully installed Any suggestions on this specific error? |
Could you give the output of |
Sure!
locale: attached base packages: other attached packages: loaded via a namespace (and not attached): |
Please update to the latest sf version, and retry. |
Thanks, it took a bit but it worked (YAY!). Here's the trick: configure: error: gdal-config not found or not executable. Then I followed this suggestion and did (https://stackoverflow.com/questions/34333624/trouble-installing-rgdal/37829420) - in R: and I was able to update both |
Hi, following instructions above in this thread I was able to install udunits2 and udunits2 R package, but not units package. it works, I got:
and the package gets correctly installed. But the exact same line with the units package instead of the udunits2 will still get me a udunits2 error:
I cannot understand why it does not work with units, the files are present and the paths are correct, otherwise udunit2 R package would not get installed each time I try... |
Can you give us more details?
|
Thanks, I could reproduce this. With the fix on github, you can install with > devtools::install_github("r-quantities/units", args='--configure-args="--with-udunits2-lib=/opt/lib --with-udunits2-include=/opt/include"') |
Thanks a lot, it worked! Just out of curiosity, what was the problem? |
this line was missing, so although you'd set the include dir, the test wouldn't use it. |
@edzer when version containing this fix will be deployed on CRAN? |
I hope within a month. |
@edzer I'm still having troubles even with the dev package, any idea on how to fix this?
|
This has nothing to do with the units package, but with you wanting to load dynamically linked libraries from a custom path without telling your system. Read into setting the environment variable LD_LIBRARY_PATH, or motify /etc/ld.so.conf and using ldconfig. In this case, starting R with
may work. |
Ah, yes, thank you! |
install.packages("rgeos", repos="http://R-Forge.R-project.org", type="source", configure.args='/usr/local/Cellar/geos/3.7.0/bin/geos-config') |
@classtag : what does this have to do with anything? The units package does not depend on rgeos in any way. For R-spatial packages in general write to R-sig-geo after subscribing. A guess is that you are misusing
|
The package
units
depends on the packagesudunits2
. However, while theudunits2
package seems to successfully install after runninginstall.packages('udunits2')
, it doesn't actually work out-of-the-box. You can see this when you try to install it from from source.I received the following error when I tried to install
udunits2
from source...Hence, what we need are these libraries.
Here is how I solved it on my mac using Homebrew.
While I used Homebrew, it appears you can download the libraries here. I did not do it this way, but I'm assuming that if you do this successfully, then you should be able to do steps 2 and 3.
udunits2
from source...units
(I installed the development version).Or
DONE
The text was updated successfully, but these errors were encountered: