[Yade-users] [Question #696327]: FEMxDEM saveGauss.py has python2 file() function

2021-03-31 Thread quanm qiu
New question #696327 on Yade:
https://answers.launchpad.net/yade/+question/696327

I'm building custom image from 
registry.gitlab.com/yade-dev/docker-prod:ubuntu20.04.

Some python3-xxx packages were installed into a container image.

When I run FEMxDEM example, I got some warnings and a error related to python 
version:

/usr/lib/x86_64-linux-gnu/yade/py/yade/FEMxDEM/yadeimport.py:54: 
DeprecationWarning: invalid escape sequence \-
  par.add_argument('--cores',help='Set number of OpenMP threads (as 
\-\-threads) and in addition set affinity of threads to the cores given. Please 
provide a string with comma-separated core-ids.',dest='cores',type=str)
/usr/lib/x86_64-linux-gnu/yade/py/yade/FEMxDEM/yadeimport.py:215: 
DeprecationWarning: invalid escape sequence \#
  prompt_in1='Yade [\#]: ',
/usr/lib/x86_64-linux-gnu/yade/py/yade/FEMxDEM/yadeimport.py:216: 
DeprecationWarning: invalid escape sequence \D
  prompt_in2=' .\D.: ',
/usr/lib/x86_64-linux-gnu/yade/py/yade/FEMxDEM/yadeimport.py:217: 
DeprecationWarning: invalid escape sequence \#
  prompt_out=" ->  [\#]: ",
/usr/lib/x86_64-linux-gnu/yade/py/yade/FEMxDEM/yadeimport.py:224: 
DeprecationWarning: invalid escape sequence \e
  +(['"\e[24~": "\C-Uyade.qt.Controller();\C-M"','"\e[23~": 
"\C-Uyade.qt.View();\C-M"','"\e[21~": "\C-Uyade.qt.Controller(), 
yade.qt.View();\C-M"','"\e[20~": "\C-Uyade.qt.Generator();\C-M"'] if 
(gui!='none') else []) #F12,F11,F10,F9
/usr/lib/x86_64-linux-gnu/yade/py/yade/FEMxDEM/yadeimport.py:224: 
DeprecationWarning: invalid escape sequence \e
  +(['"\e[24~": "\C-Uyade.qt.Controller();\C-M"','"\e[23~": 
"\C-Uyade.qt.View();\C-M"','"\e[21~": "\C-Uyade.qt.Controller(), 
yade.qt.View();\C-M"','"\e[20~": "\C-Uyade.qt.Generator();\C-M"'] if 
(gui!='none') else []) #F12,F11,F10,F9
/usr/lib/x86_64-linux-gnu/yade/py/yade/FEMxDEM/yadeimport.py:224: 
DeprecationWarning: invalid escape sequence \e
  +(['"\e[24~": "\C-Uyade.qt.Controller();\C-M"','"\e[23~": 
"\C-Uyade.qt.View();\C-M"','"\e[21~": "\C-Uyade.qt.Controller(), 
yade.qt.View();\C-M"','"\e[20~": "\C-Uyade.qt.Generator();\C-M"'] if 
(gui!='none') else []) #F12,F11,F10,F9
/usr/lib/x86_64-linux-gnu/yade/py/yade/FEMxDEM/yadeimport.py:224: 
DeprecationWarning: invalid escape sequence \e
  +(['"\e[24~": "\C-Uyade.qt.Controller();\C-M"','"\e[23~": 
"\C-Uyade.qt.View();\C-M"','"\e[21~": "\C-Uyade.qt.Controller(), 
yade.qt.View();\C-M"','"\e[20~": "\C-Uyade.qt.Generator();\C-M"'] if 
(gui!='none') else []) #F12,F11,F10,F9
/usr/lib/x86_64-linux-gnu/yade/py/yade/FEMxDEM/yadeimport.py:225: 
DeprecationWarning: invalid escape sequence \e
  +['"\e[19~": "\C-Uimport yade.plot; yade.plot.plot();\C-M"', #F8
/usr/lib/x86_64-linux-gnu/yade/py/yade/FEMxDEM/yadeimport.py:226: 
DeprecationWarning: invalid escape sequence \e
  '"\e[A": history-search-backward', '"\e[B": history-search-forward', # 
incremental history forward/backward
/usr/lib/x86_64-linux-gnu/yade/py/yade/FEMxDEM/yadeimport.py:226: 
DeprecationWarning: invalid escape sequence \e
  '"\e[A": history-search-backward', '"\e[B": history-search-forward', # 
incremental history forward/backward
Warning: no X rendering available (see 
https://bbs.archlinux.org/viewtopic.php?id=13189)
Kokkos::OpenMP::initialize WARNING: OMP_PROC_BIND environment variable not set
  In general, for best performance with OpenMP 4.0 or better set 
OMP_PROC_BIND=spread and OMP_PLACES=threads
  For best performance with OpenMP 3.1 set OMP_PROC_BIND=true
  For unit testing set OMP_PROC_BIND=false
Not converged after 0 iteration(s)! Relative error: 1.00e+00
Not converged after 1 iteration(s)! Relative error: 3.711288e-02
Not converged after 2 iteration(s)! Relative error: 2.028988e-02
Convergence reached after 3 iteration(s)! Relative error: 8.690760e-03
Traceback (most recent call last):
  File "/usr/bin/yade", line 336, in runScript
execfile(script,globals())
  File "/usr/lib/python3/dist-packages/past/builtins/misc.py", line 87, in 
execfile
exec_(code, myglobals, mylocals)
  File "./biaxialSmooth.py", line 94, in 

saveGauss2D(name='./result/gauss/time_'+str(t)+'.dat',strain=strain,stress=stress,fabric=fabric)
  File "/usr/lib/x86_64-linux-gnu/yade/py/yade/FEMxDEM/saveGauss.py", line 8, 
in saveGauss2D
fout = file(name,'w')
NameError: name 'file' is not defined

Because the file() builtin function is removed in Python 3.  Does it means I 
can install only python2.7 into the container image if I want to use FEMxDEM?



-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #696260]: yade container image 20.04 can't run on centos

2021-03-30 Thread quanm qiu
Question #696260 on Yade changed:
https://answers.launchpad.net/yade/+question/696260

quanm qiu posted a new comment:
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.

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #696260]: yade container image 20.04 can't run on centos

2021-03-27 Thread quanm qiu
Question #696260 on Yade changed:
https://answers.launchpad.net/yade/+question/696260

quanm qiu posted a new comment:
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 
import yade.tests
  File "/usr/lib/x86_64-linux-gnu/yade/py/yade/__init__.py", line 75, in 

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.

Thanks.

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


[Yade-users] [Question #696260]: yade container image 20.04 can't run on centos

2021-03-26 Thread quanm qiu
New question #696260 on Yade:
https://answers.launchpad.net/yade/+question/696260

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

Run:

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 
import yade
  File "/usr/lib/x86_64-linux-gnu/yade/py/yade/__init__.py", line 75, in 

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 ?


-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp