Unidata / UDUNITS-2

API and utility for arithmetic manipulation of units of physical quantities
http://www.unidata.ucar.edu/software/udunits
Other
62 stars 36 forks source link

Unable to install on Manjaro Linux (Arch based) #65

Closed OscarSouth closed 6 years ago

OscarSouth commented 6 years ago

when attempting to install with the pacaur command or pamac GUI tool:

Preparing...

Building udunits...
Cloning into 'udunits'...
remote: Counting objects: 29, done.        
remote: Compressing objects: 100% (25/25), done.        
remote: Total 29 (delta 4), reused 29 (delta 4)        
Unpacking objects: 100% (29/29), done.
==> Making package: udunits 2.2.26-1 (Mon 18 Jun 2018 12:23:47 BST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Downloading udunits-2.2.26.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:05:02 --:--:--     0
curl: (56) response reading failed
==> ERROR: Failure while downloading ftp://ftp.unidata.ucar.edu/pub/udunits/udunits-2.2.26.tar.gz
    Aborting...

When attempting to install from the tar.gz file:

[oscarsouth@OS-ARC ~]$ pacaur -U $HOME/Downloads/udunits-2.2.26.tar.gz
loading packages...
error: missing package metadata in /home/oscarsouth/Downloads/udunits-2.2.26.tar.gz
error: '/home/oscarsouth/Downloads/udunits-2.2.26.tar.gz': invalid or corrupted package

Is there any way to install this on my system? There are a number or R packages I need which require udunits2 as a dependency.

Thanks, Oscar

semmerson commented 6 years ago

The pacaurutility is, apparently, no longer maintained and might have been broken by recent updates to a dependency.

Have you tried the installation steps described here?

OscarSouth commented 6 years ago

Thanks for the quick reply. I did spot that, was hoping to avoid compiling from source but I really need that dependency so will go and give that a try, Thanks!

ocefpaf commented 6 years ago

@OscarSouth take a look at conda and the 3rd party channel conda-forge. We do have udunits2 and even some R libraries that dependents on it, including r-udunits2 and r-rnetcdf.

OscarSouth commented 6 years ago

@ocefpaf ah thanks. I didn’t get a chance to work on this yet and I already have miniconda installed and use conda-forge regularly for Python package management. I’ve avoided using that route for R as I embed R in Haskell programs (inline-r library) and this is easiest with a ‘default’ R interpreter setup. I’ll see if I can install udunits2 from conda-forge to fulfil the system dependency for packages in my R environment.

OscarSouth commented 6 years ago

Thanks for the help so far. Following installing udunits2 from conda-forge, I got some results in R with install.packages("udunits2",configure.args=c('--with-udunits2-lib=$HOME/miniconda3/lib','--with-udunits2-include=$HOME/miniconda3/include')).

It gets past the checks that it was failing at previously, however then fails in a new way:

> install.packages("udunits2",configure.args=c('--with-udunits2-lib=$HOME/miniconda3/lib','--with-udunits2-include=$HOME/miniconda3/include'))
Installing package into ‘/home/oscarsouth/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
trying URL 'https://ftp.heanet.ie/mirrors/cran.r-project.org/src/contrib/udunits2_0.13.tar.gz'
Content type 'application/x-gzip' length 67182 bytes (65 KB)
==================================================
downloaded 65 KB

==============================
User: oscarsouth
Pwd: /home/oscarsouth
==============================
* installing *source* package ‘udunits2’ ...
** package ‘udunits2’ successfully unpacked and MD5 sums checked
checking for gcc... gcc
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 accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for XML_ParserCreate in -lexpat... yes
checking how to run the C preprocessor... gcc -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 -I"/usr/include/R/" -DNDEBUG -I/home/oscarsouth/miniconda3/include  -D_FORTIFY_SOURCE=2   -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt  -c udunits2_R.c -o udunits2_R.o
gcc -shared -L/usr/lib64/R/lib -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -o udunits2.so udunits2_R.o -ludunits2 -lexpat -L/home/oscarsouth/miniconda3/lib -lexpat -ludunits2 -L/usr/lib64/R/lib -lR
installing to /home/oscarsouth/R/x86_64-pc-linux-gnu-library/3.5/udunits2/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
==============================
User: oscarsouth
Pwd: /tmp/RtmpbL6Af6/R.INSTALL11a0428d3f0e/udunits2
==============================
Error: package or namespace load failed for ‘udunits2’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/oscarsouth/R/x86_64-pc-linux-gnu-library/3.5/udunits2/libs/udunits2.so':
  libudunits2.so.0: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/oscarsouth/R/x86_64-pc-linux-gnu-library/3.5/udunits2’

The downloaded source packages are in
    ‘/tmp/RtmptHiXGt/downloaded_packages’
Warning message:
In install.packages("udunits2", configure.args = c("--with-udunits2-lib=$HOME/miniconda3/lib",  :
  installation of package ‘udunits2’ had non-zero exit status

Anyone know if this is a symptom of the same problem or a different problem?

OscarSouth commented 6 years ago

Extra note -- The file it refers to seems to exist:

[oscarsouth@OS-ARC ~]$ find -O3 -L $HOME -name "libudunits2.so.0"
/home/oscarsouth/miniconda3/lib/libudunits2.so.0
/home/oscarsouth/miniconda3/pkgs/udunits2-2.2.26-1/lib/libudunits2.so.0
ocefpaf commented 6 years ago

Any reason to not use the r-udunits2 present in conda-forge too? I don't know about the haskell things you want to do later but if you could somehow used the r from conda for that your life would be easier :smile:

semmerson commented 6 years ago

@OscarSouth

The file it refers to seems to exist: [oscarsouth@OS-ARC ~]$ find -O3 -L $HOME -name "libudunits2.so.0" /home/oscarsouth/miniconda3/lib/libudunits2.so.0 /home/oscarsouth/miniconda3/pkgs/udunits2-2.2.26-1/lib/libudunits2.so.0

Not quite. It couldn't load "udunits2.so" not "libudunits2.so".

Unfortunately, I don't know Conda-Forge from a hole in the ground. Sorry.

OscarSouth commented 6 years ago

@ocefpaf Yeah, I do much prefer working with anaconda in general. I only have the system R to make things work easier with Haskell. If I try and install R packages through anaconda it'll install everything R from the ground up separately from my system interpreter.

If it's of any insight, the following files are present (including the one that R is marking as not being able to access/locate):

[oscarsouth@OS-ARC ~]$ ls /home/oscarsouth/miniconda3/lib/ | grep libudunits2.so
libudunits2.so
libudunits2.so.0
libudunits2.so.0.1.0

All of these files apart from libudunits2.so.0.1.0 are just links to libudunits2.so.0.1.0.

OscarSouth commented 6 years ago

Thanks again for the help all. I compiled udunits2 from source (successful, so this and the conda-forge path are both viable options) and attempted to install again in R. The same error message as above resulted:

Error: package or namespace load failed for ‘udunits2’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/oscarsouth/R/x86_64-pc-linux-gnu-library/3.5/udunits2/libs/udunits2.so':
  libudunits2.so.0: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/oscarsouth/R/x86_64-pc-linux-gnu-library/3.5/udunits2’

Has anyone run into this? I can confirm that the file exists (as a symbolic link to libudunits2.so.0.1.0) in the correct place.

ocefpaf commented 6 years ago

Sorry. I don't know how to help you there :-/

OscarSouth commented 6 years ago

Just a quick note on here -- I recently revisited this and was able to install successfully from AUR, which has solved dependency issues in R and the problem in general.

semmerson commented 6 years ago

@OscarSouth Good to know. Thanks for reporting it.

rafalopespx commented 3 years ago

Hey there, I am having some troubles to install and compile libudunits2 too, @OscarSouth can you show or tell how you resolved it?

I tried everything in this topic, but R can not build or compile the libudunits2

siorenai commented 2 years ago

Hello! Sorry to bump this. It is not confirmed by OP, but the AUR package that solves this dependency probably is "udunits".