pacificclimate / Rudunits2

GNU General Public License v2.0
26 stars 10 forks source link

libimf.so: cannot open shared object file: No such file or directory #27

Closed NathanSkene closed 5 years ago

NathanSkene commented 5 years ago

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

NathanSkene commented 5 years ago

Just solved this. Bit of a convoluted solution, but it might help someone in the future.

libimf.so is from intel openmpi.

Had a look for which intel modules are available on server:

module load intel-suite/2017.6 find /apps/intel/ -name libimf.so

Found that it was located in many folders, one of which was 'libimf.so'

Loaded R as follows:

LD_LIBRARY_PATH="/usr/lib64/R/lib:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/lib/amd64/server:/apps/udunits/2.2.24/lib:/rds/general/user/nskene/home/udunits/local/lib:/apps/intel/2016.3/compilers_and_libraries_2016/linux/lib/intel64/" R

Then the install worked.

Probably not the most elegant solution, but it worked.