libopenblas problem after updating to Ubuntu 20

Asked by Jérôme Duriez

Hi,

After updating from Ubuntu 18 to Ubuntu 20, I'm facing the following error at YADE (packaged versions) startup:

jerome.duriez@XXX:~$ yade
Welcome to Yade 2020.01a
Using python version: 3.8.10 (default, Jun 2 2021, 10:49:15)
[GCC 9.4.0]
Traceback (most recent call last):
  File "/usr/bin/yade", line 144, in <module>
    import yade
  File "/usr/lib/x86_64-linux-gnu/yade/py/yade/__init__.py", line 75, in <module>
    from yade import boot
ImportError: libopenblas.so.0: cannot open shared object file: No such file or directory

Same with yadedaily:

Welcome to Yade 20210903-5886~505649f~focal1
[...]
ImportError: libopenblas.so.0: cannot open shared object file: No such file or directory

Apt update-upgrade give me:

jerome.duriez@XXX:~$ sudo apt update && sudo apt upgrade yade yadedaily
Hit:1 http://www.yade-dem.org/packages focal InRelease
Hit:2 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:3 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Get:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Hit:6 http://archive.canonical.com/ubuntu focal InRelease
Get:7 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Fetched 214 kB in 1s (285 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'http://www.yade-dem.org/packages focal InRelease' doesn't support architecture 'i386'
Reading package lists... Done
Building dependency tree
Reading state information... Done
yade is already the newest version (2020.01a-6build2).
yadedaily is already the newest version (20210903-5886~505649f~focal1-1).
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Would you know how to solve this problem ? Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jérôme Duriez
Solved:
Last query:
Last reply:
Revision history for this message
Robert Caulk (rcaulk) said :
#1

Hey Jérôme,

Can you verify that you installed libopenblas-dev and libsuitesparse-dev with apt-get?

Cheers,

Robert

Revision history for this message
Jérôme Duriez (jduriez) said :
#2

It looks like yes (and, if not, there would be something missing in the packaging procedure, no ?)

jerome.duriez@XX:~$ apt policy libopenblas-dev libsuitesparse-dev
libopenblas-dev:
  Installed: 0.3.8+ds-1ubuntu0.20.04.1
  Candidate: 0.3.8+ds-1ubuntu0.20.04.1
  Version table:
 *** 0.3.8+ds-1ubuntu0.20.04.1 500
        500 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages
        100 /var/lib/dpkg/status
     0.3.8+ds-1 500
        500 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
libsuitesparse-dev:
  Installed: 1:5.7.1+dfsg-2
  Candidate: 1:5.7.1+dfsg-2
  Version table:
 *** 1:5.7.1+dfsg-2 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
        100 /var/lib/dpkg/status

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

For verification, what is the output of the commands

ls -l /usr/lib/x86_64-linux-gnu/openblas*/libopenblas.*
dpkg -l | grep openblas

Revision history for this message
Jérôme Duriez (jduriez) said :
#4

jerome.duriez@XX:~$ ls -l /usr/lib/x86_64-linux-gnu/openblas*/libopenblas.*
lrwxrwxrwx 1 root root 21 juin 2 2020 /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblas.a -> libopenblasp-r0.3.8.a
lrwxrwxrwx 1 root root 22 juin 2 2020 /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblas.so -> libopenblasp-r0.3.8.so
lrwxrwxrwx 1 root root 22 juin 2 2020 /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblas.so.0 -> libopenblasp-r0.3.8.so

jerome.duriez@XX:~$ dpkg -l | grep openblas
ii libopenblas-dev:amd64 0.3.8+ds-1ubuntu0.20.04.1 amd64 Optimized BLAS (linear algebra) library (dev, meta)
ii libopenblas-pthread-dev:amd64 0.3.8+ds-1ubuntu0.20.04.1 amd64 Optimized BLAS (linear algebra) library (dev, pthread)
ii libopenblas0:amd64 0.3.8+ds-1ubuntu0.20.04.1 amd64 Optimized BLAS (linear algebra) library (meta)
ii libopenblas0-pthread:amd64 0.3.8+ds-1ubuntu0.20.04.1 amd64 Optimized BLAS (linear algebra) library (shared lib, pthread)

Note also a plain /usr/lib/x86_64-linux-gnu/libopenblas.so:

jerome.duriez@XX:~$ locate *openblas* | grep libopenblas.so
/etc/alternatives/libopenblas.so-x86_64-linux-gnu
/etc/alternatives/libopenblas.so.0-x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libopenblas.so
/usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblas.so
/usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblas.so.0
/var/lib/dpkg/alternatives/libopenblas.so-x86_64-linux-gnu
/var/lib/dpkg/alternatives/libopenblas.so.0-x86_64-linux-gnu

Revision history for this message
Manfred Hampl (m-hampl) said :
#5

What is the output of

ls -l /usr/lib/x86_64-linux-gnu/libopenblas.so
ldd /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblas.so.0

Revision history for this message
Manfred Hampl (m-hampl) said :
#6

There should also be a
/usr/lib/x86_64-linux-gnu/libopenblas.so.0

Try
sudo apt install --reinstall libopenblas0-pthread

Revision history for this message
Anton Gladky (gladky-anton) said :
#7

It is very strange. Could you please check, whether maybe LD_LIBRARY_PATH is set in your environment?

echo $LD_LIBRARY_PATH

And please check, how libyade is linked:

ldd /usr/lib/x86_64-linux-gnu/yade/libyade.so | grep -i openblas

>>> libopenblas.so.0 => /lib/x86_64-linux-gnu/libopenblas.so.0 (0x00007f409ddb0000)

I have just installed yade in Ubuntu 20.04 docker-container and it works as it should. Please also show all your environmental variables:

env

Revision history for this message
Jérôme Duriez (jduriez) said :
#8

Regarding #5
*************

jerome.duriez@XX:~$ ls -l /usr/lib/x86_64-linux-gnu/libopenblas.so
lrwxrwxrwx 1 root root 49 sept. 6 15:04 /usr/lib/x86_64-linux-gnu/libopenblas.so -> /etc/alternatives/libopenblas.so-x86_64-linux-gnu
jerome.duriez@XX~$ ldd /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblas.so.0
 linux-vdso.so.1 (0x00007ffe9d9e0000)
 libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f796a435000)
 libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f796a412000)
 libgfortran.so.5 => /usr/lib/x86_64-linux-gnu/libgfortran.so.5 (0x00007f796a14a000)
 libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7969f58000)
 /lib64/ld-linux-x86-64.so.2 (0x00007f796c759000)
 libquadmath.so.0 => /usr/lib/x86_64-linux-gnu/libquadmath.so.0 (0x00007f7969f0e000)
 libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f7969ef3000)

Regarding #6
*************

I do not have the .so.0 there:
jerome.duriez@XX:~$ ls /usr/lib/x86_64-linux-gnu/libopenblas.so.0
ls: cannot access '/usr/lib/x86_64-linux-gnu/libopenblas.so.0': No such file or directory

(will try the reinstall just after)

Regarding #7
*************

THAT *PATH variable is not set:
jerome.duriez@XX:~$ echo $LD_LIBRARY_PATH
# empty line returned, comment is mine

And indeed a problem in libyade linkage:
jerome.duriez@XX:~$ ldd /usr/lib/x86_64-linux-gnu/yade/libyade.so | grep -i openblas
 libopenblas.so.0 => not found

(Note that things work on other Ubuntu 20 machines here, so it is probably just a config problem on that one but help is much appreciated, thank you)

Revision history for this message
Jérôme Duriez (jduriez) said :
#9

sudo apt install --reinstall libopenblas0-pthread did the trick !

I got back /usr/lib/x86_64-linux-gnu/libopenblas.so.0, and the expected ldd output of #7 (note that $LD_LIBRARY_PATH is still empty / not defined though)

yade* packages now start correctly, thanks everyone for fixing my machine.
(Do not hesitate to tell me if you know where this could come from..)

Revision history for this message
Anton Gladky (gladky-anton) said :
#10

OK, I am glad that the problem is fixed. But I do not really know, why it libopenblas0 package was not installed on your system.

From here [1]: libyade strictly depends on libopenblas0, so it HAS to be installed by the package manager.
From here [2] libopenblas0 can be provided by libopenblas0-pthread, libopenblas0-openmp or libopenblas0-serial and all of them are providing libopenblas0.so....

No idea, what was wrong there.

[1] https://packages.debian.org/unstable/libyade
[2] https://packages.debian.org/sid/libopenblas0

Anton