yade container image 20.04 can't run on centos

Asked by quanm qiu on 2021-03-26

Two virtual machines were build, one installed ubuntu 20.04, the other installed centos 7.9.

go 1.16.2 and singularity 3.7 were both installed in the two systems.

Make a def file named yade.def:

BootStrap: docker
From: registry.gitlab.com/yade-dev/docker-prod:ubuntu20.04

Then build a singularity container:

sudo singularity build yade.sif yade.def


singularity exec yade.sif yade -n --test

On the ubuntu system, all test passed.

But on the centos system, a error occured:
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: libQt5Core.so.5: cannot open shared object file: No such file or directory

Would you mind to find reasons of the error ? Why the same container run differently on the two systems ?

Question information

English Edit question
Yade Edit question
No assignee Edit question
Last query:
Last reply:

Thank you for reporting.
I'm afraid it is a question for singularity/docker/centos devs, more than yade devs.

Do you mean that building the sif from docker-prod:ubuntu20.04 is done inside a docker:centos?
How does it go if you try to run tests directly with docker-prod:ubuntu20.04 inside the docker:centos (without singularity in between)?
If you get same error then it would eliminate singularity as a source of the problem.
Also I'm curious about why you used "sudo" for the singularity build command.

quanm qiu (quanm) said : #2

Thanks for your reply.

I installed a host with centos 7.9 ISO image. Within the centos host, run :

docker run -it registry.gitlab.com/yade-dev/docker-prod:ubuntu20.04

Unable to find image 'registry.gitlab.com/yade-dev/docker-prod:ubuntu20.04' locally
Trying to pull repository registry.gitlab.com/yade-dev/docker-prod ...
ubuntu20.04: Pulling from registry.gitlab.com/yade-dev/docker-prod
04a5f4cda3ee: Pull complete
ff496a88c8ed: Pull complete
0ce83f459fe7: Pull complete
cd27bc7d342d: Pull complete
74e2837b3322: Pull complete
Digest: sha256:4bb44087cd65f763423cd36a2d2da14e7340ed24d4ed55bfd57e1e0cfa1b5f22
Status: Downloaded newer image for registry.gitlab.com/yade-dev/docker-prod:ubuntu20.04

root@af9bf95508e2:/# yade --test
Using python version: 3.8.5 (default, Jan 27 2021, 15:41:15)
[GCC 9.3.0]
Traceback (most recent call last):
  File "/usr/bin/yade", line 103, in <module>
    import yade.tests
  File "/usr/lib/x86_64-linux-gnu/yade/py/yade/__init__.py", line 75, in <module>
    from yade import boot
ImportError: libQt5Core.so.5: cannot open shared object file: No such file or directory

I got the same problem when using docker directly. So it's not singularity's problem.

Should I ask a question in the docker's forum or singularity's forum?

By the way, singularity need root privilege when building a image.


quanm qiu (quanm) said : #3

Finally, I found source of the problem is kernel version.

The kernel needs to be at least 3.15 "Qt 5.10 uses the renameat2 system call which is only available since kernel 3.15"

See: https://bbs.archlinux.org/viewtopic.php?id=232682

After upgrade centos kernel version from 3.10 to 5.11, the error "error while loading shared libraries: libQt5Core.so.5: cannot open shared object file: No such file or directory" disappeared.

But I can't upgrade kernel version of the Supercomputer. I have to use another dirty solution, add a command to the singularity image .def file:

strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5

See: https://superuser.com/questions/1347723/arch-on-wsl-libqt5core-so-5-not-found-despite-being-installed

Then the problem solved.

Wow! Thanks for solution. It might help others.

Another solution should be to use an older linux version [1]. They all have updated version if you use "yadedaily " instead of "yade".


[1] https://gitlab.com/yade-dev/docker-prod/container_registry/1766901

Can you help with this problem?

Provide an answer of your own, or ask quanm qiu for more information if necessary.

To post a message you must log in.