LutzGross / esys-escript.github.io

Other
29 stars 13 forks source link

problem installing eScript on ubuntu 22.04.1 LTS #85

Closed lolsenkettle closed 1 year ago

lolsenkettle commented 1 year ago

I am trying to install escript on my laptop running ubuntu 22.04.1 LTS using an options file: hostname(my laptop's)_options.py copied from focal_options.py. I also ran the commands recommended for Ubuntu 20.04 LTS Focal Fossa.

However when I run scons -j4 options_file=scons//lolsenkettle-ThinkPad-L390_options.py scons: Reading SConscript files ... 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0] Using options in scons/lolsenkettle-ThinkPad-L390_options.py. /bin/sh: 1: git: not found Got git revision
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

:4: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives :4: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead Checking for C++ header file Python.h... yes Checking for C++ function Py_Exit()... yes Checking for C++ library boost_python310... no RuntimeError: Unable to link against ['boost_python310', 'boost_numpy310', 'boost_random'] (paths: /usr/include, /usr/lib/x86_64-linux-gnu/): File "/home/lolsenkettle/Louise Swinburne/Papers Resources/Resources/eScript documentation/Escript 5.10/esys-escript.github.io-5.10/SConstruct", line 581: env=checkBoost(env) File "/home/lolsenkettle/Louise Swinburne/Papers Resources/Resources/eScript documentation/Escript 5.10/esys-escript.github.io-5.10/site_scons/dependencies.py", line 283: boost_inc_path,boost_lib_path=findLibWithHeader(env, env['boost_libs'], 'boost/python.hpp', env['boost_prefix'], lang='c++') File "/home/lolsenkettle/Louise Swinburne/Papers Resources/Resources/eScript documentation/Escript 5.10/esys-escript.github.io-5.10/site_scons/site_init.py", line 84: raise RuntimeError('Unable to link against %s (paths: %s, %s)'%(libs,inc_path,lib_path)) Could you let me know what to change in my (myhostname)_options file below: # Development 2012-2013 by School of Earth Sciences # Development from 2014 by Centre for Geoscience Computing (GeoComp) # Development from 2019 by School of Earth and Environmental Sciences # ############################################################################## # This is a template configuration file for escript on Debian/GNU Linux. # Refer to README_FIRST for usage instructions. escript_opts_version = 203 #openmp = True umfpack = True umfpack_prefix = ['/usr/include/suitesparse', '/usr/lib'] umfpack_libs = ['umfpack', 'blas', 'amd'] pythoncmd="/usr/bin/python3" import subprocess p=subprocess.run([pythoncmd,'-V'], capture_output=True, text=True) subversion=p.stdout.split(' ')[1].split('.')[1] pythonlibname = 'python3.%s'%subversion pythonlibpath = '/usr/lib/x86_64-linux-gnu/' pythonincpath = '/usr/include/python3.%s'%subversion boost_libs=['boost_python3%s'%subversion,'boost_numpy3%s'%subversion,'boost_random'] boost_prefix=['/usr/include','/usr/lib/x86_64-linux-gnu/']
aellery commented 1 year ago

Hi lolsenkettle,

If you put these options into your options file it should compile without any issues.

escript_opts_version=304 pythonlibname='python3.10' pythonlibpath='/usr/lib/x86_64-linux-gnu/' pythonincpath='/usr/include/python3.10' boost_prefix=['/usr/include','/usr/lib/x86_64-linux-gnu/'] boost_libs='boost_python310' umfpack = True umfpack_prefix = ['/usr/include/suitesparse', '/usr/lib'] werror=0

This will only build a basic version of escript. Are there any features that you need to enable for your project?

Adam

lolsenkettle commented 1 year ago

Thanks for the response. I am attaching my options file.

The install started with those options in my option file. However it exited with this error: Python: /usr/bin/python3 (Version 3.10.6) boost: ['/usr/include', '/usr/lib/x86_64-linux-gnu/'] (Version 1.74.0) boost numpy: NO trilinos: NO numpy: YES (with headers) gmsh: YES gzip: YES Solver library: paso Direct solver: YES (umfpack) domains: dudley, finley, ripley, speckley netcdf: NO weipa: YES pyproj: YES scipy: YES umfpack: YES

DISABLED features: cppunit debug gdal lapack mkl mpi mumps openmp parmetis silo sympy trilinos visit NOT treating warnings as errors

WARNING: Cannot import gdal. Inversions will not honour WKT coordinate system information. WARNING: escript does not support sympy version 1.2 and higher. Found 1.9

ERROR: build stopped due to errors

aellery commented 1 year ago

Can you please add the line

pythoncmd='/usr/bin/python3'

to your options file and try again? If this does not work, can you please post the contents of the file config.log into a pastebin and send me the link?

lolsenkettle commented 1 year ago

That didn't work either so I will try and send you the contents of the config.log file in this pastebin: https://paste.ubuntu.com/p/s8rZrMq2nt/

aellery commented 1 year ago

Unfortunately, the config.log doesn't tell me what the error was. Could you please paste the compiler output into a pastebin as well? (i.e. the output from the terminal after you run scons)

lolsenkettle commented 1 year ago

Hi Adam, the output is here: https://paste.ubuntu.com/p/Vfx6FpXQQK/

Thanks, Louise

lolsenkettle commented 1 year ago

Here is my options file: https://paste.ubuntu.com/p/QcDGVfZ7cD/

aellery commented 1 year ago

Thank you. I'm running it now in a docker container. Give me five minutes.

aellery commented 1 year ago

In a Ubuntu container on docker, it compiles successfully provided that all the required packages are installed. Can you please run

sudo apt install libsuitesparse-dev libpython3-dev libboost-all-dev python3-numpy python3-scipy python3-sympy

and try again? If that fails can you please post the compiler output (the text just before * Config Summary ** ) in a pastebin so that I can see what broke?

lolsenkettle commented 1 year ago

I installed the apps above and reran the scons file again. However this is the error output below.

https://paste.ubuntu.com/p/gbDJHzJFBN/

aellery commented 1 year ago

It looks like it compiled without error but then scons could not copy the files over because it misread the location of your home directory (due to a space in the address). This is a bug, which I will fix for the next release.

I suggest installing to a directory that does not have spaces in the full path to the address such as /home/lolsenkettle/escript

You can do this by running

scons prefix=/home/lolsenkettle/escript

lolsenkettle commented 1 year ago

Thanks that worked!