About installing Escript in Ubuntu 16.04

Asked by Zheng

Hi all,

I am running into a problem when installing python-escript 5.5 under the environment of Ubuntu 16.04 and python 3.5.

Following the Installation guide in Section 5.3.2 about installing in Ubuntu system, I used the command:

scons -j1 options_file=scons/xenial_py3_options.py

However, I got the following error message:

customer@node01:~/Downloads/python-escript_5.5$ scons -j1 options_file=scons/xenial_py3_options.py
scons: Reading SConscript files ...
3.5.2 (default, Oct 7 2020, 17:19:02)
[GCC 5.4.0 20160609]
Using options in scons/xenial_py3_options.py.
/bin/sh: svnversion: command not found
Using svn revision information from file. Got revision = 6948
Checking whether the C++ compiler works... (cached) yes
Checking for C++ function gethostname()... (cached) yes
Checking for C++ header file byteswap.h... (cached) yes
Checking for C++ function SCbswap32()... (cached) yes
Checking for C++ header file sys/endian.h... (cached) no
Checking for C++ header file libkern/OSByteOrder.h... (cached) no
Checking for working complex std::acos()... (cached) yes
Checking for C++ header file Python.h... yes
Checking for C++ function Py_Exit()... yes
Checking for C++ library boost_python-py35... yes
Checking for C++ header file numpy/ndarrayobject.h... yes
TypeError: a bytes-like object is required, not 'str':
  File "/home/customer/Downloads/python-escript_5.5/SConstruct", line 513:
    env=checkOptionalLibraries(env)
  File "/home/customer/Downloads/python-escript_5.5/site_scons/dependencies.py", line 756:
    if p.returncode == 0 and 'libmpi' in gmshlibs:

What would be the possible reason for such error? Any clues are greatly appreciated.

Best,
Zheng

Question information

Language:
English Edit question
Status:
Solved
For:
esys-escript Edit question
Assignee:
No assignee Edit question
Solved by:
Adam Ellery
Solved:
Last query:
Last reply:
Revision history for this message
Adam Ellery (aellery) said :
#1

Hi Zheng,

I have had some trouble reproducing this bug in Ubuntu Xenial, but I believe that you may be able to fix your issue by changing line 756 of site_scons/dependencies.py to read:

if p.returncode == 0 and 'libmpi' in gmshlibs.decode('utf-8'):

I have made changes to esys-escript so that this issue should not arise in the next release (5.7).

Best regards,

Adam

Revision history for this message
Zheng (zhengdem) said :
#2

Hi Adam,

Thanks very much for your response. This modification indeed solved this problem. May I ask another question in this post?

After installation, I got the following messages as below:

customer@node01:~/Downloads/python-escript_5.5$ scons -j1 options_file=scons/xenial_py3_options.py
scons: Reading SConscript files ...
3.5.2 (default, Oct 7 2020, 17:19:02)
[GCC 5.4.0 20160609]
Using options in scons/xenial_py3_options.py.
/bin/sh: svnversion: command not found
Using svn revision information from file. Got revision = 6948
Checking whether the C++ compiler works... (cached) yes
Checking for C++ function gethostname()... (cached) yes
Checking for C++ header file byteswap.h... (cached) yes
Checking for C++ function SCbswap32()... (cached) yes
Checking for C++ header file sys/endian.h... (cached) no
Checking for C++ header file libkern/OSByteOrder.h... (cached) no
Checking for working complex std::acos()... (cached) yes
Checking for C++ header file Python.h... (cached) yes
Checking for C++ function Py_Exit()... (cached) yes
Checking for C++ library boost_python-py35... (cached) yes
Checking for C++ header file numpy/ndarrayobject.h... (cached) yes
Checking for C++ library netcdf_c++... (cached) yes
Checking for C++ library umfpack... (cached) yes
Checking for C++ library boost_iostreams... (cached) no
Chmod("utest.sh", 0755)
Generated utest.sh.
Chmod("itest.sh", 0755)
Generated itest.sh.
Chmod("/home/customer/Downloads/python-escript_5.5/bin/run-escript", 0755)
Delete(["lib/pythonMPI", "lib/pythonMPIredirect"])
Delete("bin/escript-overlord")
scons: done reading SConscript files.
scons: Building targets ...
/home/customer/Downloads/python-escript_5.5/bin/run-escript /home/customer/Downloads/python-escript_5.5/build/scripts/release_sanity.py
scons: done building targets.

*** Config Summary (see config.log and <prefix>/lib/buildvars for details) ***
Escript revision 6948

  Install prefix: /home/customer/Downloads/python-escript_5.5
          Python: python3 (Version 3.5.2)
           boost: /usr (Version 1.58.0)
     boost numpy: NO
        trilinos: NO
           numpy: YES (with headers)
            gmsh: YES, MPI-ENABLED
  Solver library: paso
   Direct solver: YES (umfpack)
         domains: dudley, finley, ripley, speckley
          netcdf: YES (3)
           weipa: YES
          openmp: YES
            gdal: YES
          pyproj: YES
           scipy: YES
           sympy: YES
         umfpack: YES

  DISABLED features: cppunit debug gzip lapack mkl mpi parmetis silo trilinos visit
  Treating warnings as errors

SUCCESS: build complete

Here I found the 'boost numpy' is not installed. I am not sure whether there would be some problems for the later usage. So I ran one of my simulations by restarting a former stress and strain data from *.nc files (also generated using Escript coupled with Yade). However, I got the following error:

customer@node01:~/Yade/cases/SlopeFailure_try$ yade -n GIM_seepage.py
Welcome to Yade 20200613-3983~91b2a7a~xenial1
Using python version: 3.5.2 (default, Oct 7 2020, 17:19:02)
[GCC 5.4.0 20160609]
TCP python prompt on localhost:9024, auth cookie `scdeuy'
XMLRPC info provider on http://localhost:21024
/usr/lib/python3/dist-packages/IPython/utils/path.py:310: UserWarning: IPython dir '/home/customer/.ipython' is not a writable location, using a temp directory.
  " using a temp directory."%ipdir)
Running script GIM_seepage.py
Traceback (most recent call last):
  File "/usr/bin/yade", line 342, in runScript
    execfile(script,globals())
  File "/usr/lib/python3/dist-packages/past/builtins/misc.py", line 82, in execfile
    exec_(code, myglobals, mylocals)
  File "GIM_seepage.py", line 50, in <module>
    prob = MultiScale(restart=True,dir='./result_dry/checkpoint/',time=10,domain=mydomain,pore0=pore,perm=perm,kf=kf,dt=dt,ng=numg,np=nump,useMPI=mpi,rtol=1.e-2,verbose=True)
  File "/home/customer/Yade/cases/SlopeFailure_try/FEMxDEM/msFEMup.py", line 107, in __init__
    self.__stress=escript.load(dir+'stress_10.nc')
Boost.Python.ArgumentError: Python argument types in
    esys.escriptcore.escriptcpp.load(str)
did not match C++ signature:
    load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > fileName, escript::AbstractDomain domain)
[[ ^L clears screen, ^U kills line. F8 plot. ]]

What might be the possible reason for such error? I have recompiled Escript but got the same error. Could you please give me any clues?

Thanks and best regards,

Zheng

Revision history for this message
Best Adam Ellery (aellery) said :
#3

Hi Zheng,

I believe your error probably has something to do with the arguments being passed on to the load function in your script (line 107 of msFEMup.py). It may be a syntax error or an argument being passed on that is of the wrong type.

Adam

Revision history for this message
Zheng (zhengdem) said :
#4

Thanks Adam Ellery, that solved my question.