installation problem on ubuntu 20.04, Unable to link against ['boost_python-mt']

Asked by shguan

when i'm building escript on UBUNTU 20.04.1 LTS, using following steps

`sudo apt-get install python3-dev python3-numpy python3-pyproj python3-gdal
sudo apt-get install python3-sympy python3-matplotlib python3-scipy
sudo apt-get install libnetcdf-cxx-legacy-dev libnetcdf-c++4-dev libnetcdf-dev
sudo apt-get install libboost-random-dev libboost-python-dev libboost-iostreams-dev
sudo apt-get install scons lsb-release libsuitesparse-dev

scons -j1 options_file=scons/templates/`

By the way, 'scons -j1 options_file=scons/templates/' in the installation pdf file shoul be 'scons -j1 options_file=scons/templates/'

    while, error information as following:

/python_escript_5_6.1/src$ scons -j1 options_file=scons/templates/
scons: Reading SConscript files ...
3.8.5 (default, Jul 28 2020, 12:59:40)
[GCC 9.3.0]
Using options in scons/templates/
/bin/sh: 1: svnversion: not found
Checking whether the C++ compiler works... yes
Checking for C++ function gethostname()... yes
Checking for C++ header file byteswap.h... yes
Checking for C++ function SCbswap32()... yes
Checking for C++ header file sys/endian.h... no
Checking for C++ header file libkern/OSByteOrder.h... no
Checking for working complex std::acos()... yes
Checking for C++ header file Python.h... yes
Checking for C++ function Py_Exit()... yes
Checking for C++ library boost_python-mt... no
RuntimeError: Unable to link against ['boost_python-mt'] (paths: /usr/include, /usr/lib):
  File "/home/shguan/python_escript_5_6.1/src/SConstruct", line 513:
  File "/home/shguan/python_escript_5_6.1/src/site_scons/", line 266:
    boost_inc_path,boost_lib_path=findLibWithHeader(env, env['boost_libs'], 'boost/python.hpp', env['boost_prefix'], lang='c++')
  File "/home/shguan/python_escript_5_6.1/src/site_scons/", line 84:
    raise RuntimeError('Unable to link against %s (paths: %s, %s)'%(libs,inc_path,lib_path))

    could you please help me out!

    thanks for your consideration!

Question information

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

Hi shguan,

It appears that the latest version of Ubuntu has changed the name of one of the library files and as a result escript is having some trouble locating it. You may need to tell escript explicitly what the new files is named.

Could you please try running

scons -j1 options_files=scons/templates/ boost_libs='boost_python38'

- Adam

Revision history for this message
shguan (shguan) said :

Hi Ellery,

`scons -j1 options_file=scons/templates/ boost_libs='boost_python38' ` works!

So your team can have the installation file updated!

Thank you!

best wishes,

Revision history for this message
shguan (shguan) said :

By the way, path of the src file and lib file directory should be appended to the environment, as follows:

## escript
export PYTHONPATH=$PYTHONPATH:/path/to/escript/src
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/escript/src/lib

then, enjoy!

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

Hi shugan,

You can run
run-escript -e
to print out the export statements.

Note that you may also need to append your bashrc file with the line
export PATH=/path/to/escript/bin:$PATH

- Adam