Trying to use 2 versions of R on the same Ubuntu server with Intel MKL: "libimf.so: cannot open shared object file: No such file or directory"

I have R 3.5.3 compiled with Intel MKL 2019.2.187 successfully on a server with RStudio Server Pro. Everything works fine! We needed to add an older version of R (3.4.2) to stay consistent with our in-house packages. When I load any package, I get this error:

Error: package or namespace load failed for ‘data.table’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/../libs/datatable.so':
  libimf.so: cannot open shared object file: No such file or directory

I have another server with R 3.4.2 and Intel MKL 2017.4.196 and I get no such error. This makes sense because the libimf.so file exists within the MKL folders. That file doesn't exist in the newer version.

At first this made me think it was just a version difference - the newest release doesn't have the same files, although I don't know what is informing that error message - if it's R or if it's the package looking for that (likely R, right?).

I thought installing the 2017.4.196 would help, but I've had trouble finding it and I'm worried how it would interact with the currently installed 2019.2.187 (I should stress that 3.5.3 with 2019.2.187 works, 3.42 with 2019.2.187 does not).

I'm pretty new to compiling with MKL so I'm worried that I am going down the wrong path. I can't find a lot on that error message, especially lately or related to R, so I'm hoping someone here can give me a clue. I'm happy to provide any other details if needed. Thanks a lot!

1 Like

I guess this can be closed. It appears to be that you can't use packages that were not only compiled with a different version of R, but a different version of Intel MKLs. The packages were installed with an older version of both. I re-installed with the latest, in-use versions on my Ubuntu RStudio server and I no longer get that error. Just in case someone else runs into this.

1 Like

This is a good find! What a package binary is compiled against definitely makes a difference in how it works / what libraries it expects to have while running. Thanks for sharing your experience!