Problem installing PyFR

Dear All,

I am new to PyFR. I tried to install it on a cluster from source code. I tried to install using the following command:
python setup.py install --user

I get the following line then:

running install /XXX/Core/python-build-bundle/2023a/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.

Installing continues anyway and I have the following line at the end:

Finished processing dependencies for pyfr==1.15.0

I wonder if that means installation was successful. However, when trying to run the “2d-inc-cylinder” using the command provided in the user-guide, I get the following error:

Traceback (most recent call last):
  File "/home/syavash/.local/bin/pyfr", line 33, in <module>
    sys.exit(load_entry_point('pyfr==1.15.0', 'console_scripts', 'pyfr')())
  File "/home/syavash/.local/bin/pyfr", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/cvmfs/soft.computecanada.ca/easybuild/software/2020/avx2/Core/python/3.9.6/lib/python3.9/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/XXX/Core/python/3.9.6/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "/home/syavash/.local/lib/python3.9/site-packages/pyfr-1.15.0-py3.9.egg/pyfr/__main__.py", line 14, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "/home/syavash/.local/lib/python3.9/site-packages/pyfr-1.15.0-py3.9.egg/pyfr/plugins/__init__.py", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 982, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 925, in _find_spec
  File "<frozen importlib._bootstrap_external>", line 1414, in find_spec
  File "<frozen importlib._bootstrap_external>", line 1388, in _get_spec
  File "<frozen importlib._bootstrap_external>", line 1369, in _legacy_get_spec
  File "<frozen importlib._bootstrap>", line 423, in spec_from_loader
  File "<frozen importlib._bootstrap_external>", line 716, in spec_from_file_location
  File "<frozen zipimport>", line 191, in get_filename
  File "<frozen zipimport>", line 713, in _get_module_code
  File "<frozen zipimport>", line 647, in _compile_source
  File "/home/syavash/.local/lib/python3.9/site-packages/pyfr-1.15.0-py3.9.egg/pyfr/plugins/ascent.py", line 71
    match value:
          ^
SyntaxError: invalid syntax

Would anyone kindly provide some hint here? I have no clue about the source of problem.

Kind regards
syavash

As per the user guide, PyFR requires Python 3.10 or later. You are using Python 3.9.

Regards, Freddie.

Thanks Freddie,

I switched to python 3.10, but still getting an error:

Traceback (most recent call last):
  File "/home/syavash/.local/bin/pyfr", line 33, in <module>
    sys.exit(load_entry_point('pyfr==1.15.0', 'console_scripts', 'pyfr')())
  File "/home/syavash/.local/bin/pyfr", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/XXX/Core/python/3.10.2/lib/python3.10/importlib/metadata/__init__.py", line 162, in load
    module = import_module(match.group('module'))
  File "/XXX/Core/python/3.10.2/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/syavash/.local/lib/python3.10/site-packages/pyfr-1.15.0-py3.10.egg/pyfr/__main__.py", line 14, in <module>
  File "/home/syavash/.local/lib/python3.10/site-packages/pyfr-1.15.0-py3.10.egg/pyfr/plugins/__init__.py", line 10, in <module>
  File "/home/syavash/.local/lib/python3.10/site-packages/pyfr-1.15.0-py3.10.egg/pyfr/plugins/sampler.py", line 2, in <module>
  File "/home/syavash/.local/lib/python3.10/site-packages/Rtree-1.0.1-py3.10-linux-x86_64.egg/rtree/__init__.py", line 9, in <module>
    from .index import Index, Rtree  # noqa
  File "/home/syavash/.local/lib/python3.10/site-packages/Rtree-1.0.1-py3.10-linux-x86_64.egg/rtree/index.py", line 17, in <module>
    from . import core
  File "/home/syavash/.local/lib/python3.10/site-packages/Rtree-1.0.1-py3.10-linux-x86_64.egg/rtree/core.py", line 74, in <module>
    rt = finder.load()
  File "/home/syavash/.local/lib/python3.10/site-packages/Rtree-1.0.1-py3.10-linux-x86_64.egg/rtree/finder.py", line 118, in load
    raise OSError("Could not load libspatialindex_c library")
OSError: Could not load libspatialindex_c library

Unfortunately I can’t attach the install log file here. I appreciate your kind help.

Kind regards
syavash

As per the (development head) user guide PyFR depends on the rtree module. You will need to have this installed and working before you can run PyFR. You can test it as:

import rtree

If you are having issues with the module, please follow up with their developers/open a bug report as appropriate.

Regards, Freddie.

I tried your tip and I am getting the same error, meaning that rtree indeed is the source of problem.

I guess there is more to it. I tried different versions of python (3.10, 3.11) and downloaded libspatialindex but couldn’t manage to install rtree via easy_install. Strangely, it’s fixed on python 3.7 and I wasn’t able to change it.
I also tried to install it using pip. It was successful but I get a similar error once importing rtree:

KeyError: 'EBROOTLIBSPATIALINDEX'

I checked inside the “site-packages” directory and rtree is there!
Just wanted to know, is this a common issue, to deal with rtree when installing PyFR?

Kind regards
syavash

I have had no issues installing it via pip on either Linux or macOS. You may want to open an issue with the developers of rtree to see if they can provide any additional information.

Regards, Freddie.

I see.
Fortunately, libspatialindex was available as a module on the cluster and it saved me! Anyway, thanks for your help.
I could fix the rtree error, now my question is how I can run 2d-inc-cylinder example in serial? My cluster is not providing GCC 12.0 so I won’t have OMP as backend.

Kind regards
syavash

P.S: I tried cuda as backed but I am getting some error. I guess I would have to make a request for GPU core beforehand.

An OpenMP 5.0 capable compiler is required for the C/OpenMP backend. This is required even if you only want to run on a single core.

Ask your administrator to provide a more recent compiler.

Regards, Freddie.

I wouldn’t think it could be a problem. The latest version is 11.3.0.
But can I run in parallel (MPI) w/o OMP?

No. The compiler has no idea how many threads you are going to be running with and hence support is needed even if you only intend to run with a single OpenMP thread.

Regards, Freddie.