a setSolver Method problem

Asked by Lou Jichao

Dear all,
I try to change the setSolverMethod option in the diffusion.py of User's example.Use this command:
There is a problem:
'Cannot use DIRECT solver method, the running escript was not compiled with a direct solver enabled'
What's the reason?
Is it a problem of my escript installation or the example itself?
And how to solve it?
Best regards,

Question information

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

Hi Lou,

It looks at though you have compiled escript without a direct solver, which is why escript has returned this error message.

At present, escript supports three direct solvers, Umfpack (part of Suitesparse), the Intel Math Kernel Library (MKL) and Trilinos. In order to get this working, you will need to recompile escript and with at least one of these libraries enabled.

I am happy to step you through this process. What operating system are you currently using?

- Adam

Revision history for this message
Lou Jichao (ljc-1) said :

Hi Adam
Thank you for your answer. My system is Ubuntu 16.04LTS

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

Hi Lou,

You can install Suitesparse on Ubuntu by typing:

sudo apt-get update
sudo apt-get install libsuitesparse-dev

Once this has completed, navigate to the folder containing the escript source code and run the command:

scons options_file=scons/templates/stretch_options umfpack=True

This will compile and install escript on your computer with umfpack. Once this has completed, the program will print some output to the screen with a list of the enabled features and there should be a line that says "Direct solver: YES (umfpack)" which will confirm that escript has a direct solver enabled.

- Adam

Revision history for this message
Lou Jichao (ljc-1) said :

I have install Suitesparse successfully. But when I run the command:
'scons options_file=scons/templates/stretch_options.py umfpack=True'
it has this problem:
'scons: Reading SConscript files ...
Building with the following additional flags from debian: [['cpp_flags', '-Wdate-time -D_FORTIFY_SOURCE=2'], ['cxx_extra', '-g -O2 -fstack-protector-strong -Wformat -Werror=format-security'], ['ld_extra', '-Wl,-Bsymbolic-functions -Wl,-z,relro']]
Using options in scons/templates/stretch_options.py.
sh: 1: svnversion: not found
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-py27... (cached) yes
Checking for C++ header file numpy/ndarrayobject.h... (cached) yes
Checking for C++ library netcdf_c++4... (cached) yes
Checking for C++ library boost_iostreams... yes
Chmod("utest.sh", 0755)
Generated utest.sh.
Chmod("itest.sh", 0755)
Generated itest.sh.
Chmod("/home/ljc/escript/src/bin/run-escript", 0755)
Delete(["lib/pythonMPI", "lib/pythonMPIredirect"])
scons: done reading SConscript files.
scons: Building targets ...
Compiling build/posix/escriptcore/src/AbstractContinuousDomain.os
Compiling build/posix/escriptcore/src/AbstractDomain.os
Compiling build/posix/escriptcore/src/AbstractReducer.os
Compiling build/posix/escriptcore/src/AbstractSystemMatrix.os
Compiling build/posix/escriptcore/src/AbstractTransportProblem.os
Compiling build/posix/escriptcore/src/ArrayOps.os
Compiling build/posix/escriptcore/src/BinaryDataReadyOps.os
Compiling build/posix/escriptcore/src/Data.os
Compiling build/posix/escriptcore/src/DataAbstract.os
Compiling build/posix/escriptcore/src/DataConstant.os
escriptcore/src/DataConstant.cpp: In member function 'virtual void escript::DataConstant::dump(std::__cxx11::string) const':
escriptcore/src/DataConstant.cpp:642:18: error: 'class netCDF::NcFile' has no member named 'open'
         dataFile.open(newFileName.c_str(), NcFile::FileMode::replace, NcFile:
scons: *** [build/posix/escriptcore/src/DataConstant.os] Error 1
scons: building terminated because of errors.

*** Config Summary (see config.log and <prefix>/lib/buildvars for details) ***
Escript revision -2
  Install prefix: /home/ljc/escript/src
          Python: /usr/bin/python (Version 2.7.12)
           boost: /usr (Version 1.58.0)
           numpy: YES (with headers)
            gmsh: YES, MPI-ENABLED
            gzip: YES
  Solver library: paso
   Direct solver: NONE
         domains: dudley, finley, ripley, speckley
          netcdf: YES (4 + 3)
           weipa: YES
          openmp: YES
            gdal: YES
          pyproj: YES
           scipy: YES
           sympy: YES

  DISABLED features: boomeramg cppunit cuda debug lapack mkl mpi papi parmetis silo trilinos umfpack visit
  Treating warnings as errors

ERROR: build stopped due to errors'

But i have successfully install escript by
'scons -j1 options_file=scons/templates/xenial_options.py'

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

Please try

scons options_file=scons/templates/xenial_options umfpack=True netcdf=False

Revision history for this message
Lou Jichao (ljc-1) said :

Thanks Adam Ellery, that solved my question.