Skip to content
This repository has been archived by the owner on Jan 28, 2024. It is now read-only.

Cannot install pyfnntw==0.4.1 on Fedora #6

Open
MatteoLacki opened this issue Aug 17, 2023 · 6 comments
Open

Cannot install pyfnntw==0.4.1 on Fedora #6

MatteoLacki opened this issue Aug 17, 2023 · 6 comments

Comments

@MatteoLacki
Copy link

Hello,

Cannot taste the speed, so to say:

$ cargo -V
cargo 1.64.0 (387270bc7 2022-09-16)
$ python3 -V
Python 3.10.11

Error during the installation:

$ pip3 install pyfnntw

Defaulting to user installation because normal site-packages is not writeable
Collecting pyfnntw
  Using cached pyfnntw-0.4.1.tar.gz (69 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pyfnntw
  Building wheel for pyfnntw (pyproject.toml) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /usr/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmpzb2vislq
       cwd: /tmp/pip-install-8i90cdvq/pyfnntw_cd52bbf6d78f4029ae509b1dd8405027
  Complete output (116 lines):
  Running `maturin pep517 build-wheel -i /usr/bin/python3 --compatibility off`
  🔗 Found pyo3 bindings
  🐍 Found CPython 3.10 at /usr/bin/python3
     Compiling autocfg v1.1.0
     Compiling proc-macro2 v1.0.66
     Compiling unicode-ident v1.0.3
     Compiling libc v0.2.132
     Compiling thiserror v1.0.47
     Compiling target-lexicon v0.12.4
     Compiling cfg-if v1.0.0
     Compiling crossbeam-utils v0.8.16
     Compiling scopeguard v1.1.0
     Compiling syn v1.0.99
     Compiling version_check v0.9.4
     Compiling ucd-trie v0.1.6
     Compiling once_cell v1.13.1
     Compiling rayon-core v1.11.0
     Compiling parking_lot_core v0.9.3
     Compiling either v1.9.0
     Compiling const_fn v0.4.9
     Compiling smallvec v1.9.0
     Compiling arrayvec v0.4.12
     Compiling nodrop v0.1.14
     Compiling Inflector v0.11.4
     Compiling rawpointer v0.2.1
     Compiling aliasable v0.1.3
     Compiling itoa v0.4.8
     Compiling indoc v1.0.7
     Compiling unindent v0.1.10
     Compiling sync-unsafe-cell v0.1.1
     Compiling permutation v0.4.1
     Compiling proc-macro-error-attr v1.0.4
     Compiling proc-macro-error v1.0.4
     Compiling memoffset v0.9.0
     Compiling crossbeam-epoch v0.9.15
     Compiling num-traits v0.2.15
     Compiling lock_api v0.4.7
     Compiling num-integer v0.1.45
     Compiling matrixmultiply v0.3.7
     Compiling crossbeam-channel v0.5.8
     Compiling num-format v0.4.0
     Compiling quote v1.0.33
     Compiling pyo3-build-config v0.16.5
     Compiling num_cpus v1.16.0
     Compiling crossbeam-deque v0.8.3
     Compiling syn v2.0.29
     Compiling parking_lot v0.12.1
     Compiling num-complex v0.4.4
     Compiling ordered-float v3.0.0
     Compiling rayon v1.7.0
     Compiling pyo3-ffi v0.16.5
     Compiling pyo3 v0.16.5
     Compiling ndarray v0.15.6
     Compiling pyo3-macros-backend v0.16.5
     Compiling thiserror-impl v1.0.47
     Compiling concat-idents v1.1.5
     Compiling ouroboros_macro v0.15.6
     Compiling pest v2.7.2
     Compiling pyo3-macros v0.16.5
     Compiling ouroboros v0.15.6
     Compiling semver-parser v0.10.2
     Compiling semver v0.11.0
     Compiling rustc_version v0.3.3
     Compiling likely_stable v0.1.2
     Compiling fnntw v0.4.1 (/tmp/pip-install-8i90cdvq/pyfnntw_cd52bbf6d78f4029ae509b1dd8405027/local_dependencies/fnntw)
  error: could not compile `fnntw` due to 5 previous errors
  warning: build failed, waiting for other jobs to finish...
  💥 maturin failed
    Caused by: Failed to build a native library through cargo
    Caused by: Cargo build finished with "exit status: 101": `PYO3_ENVIRONMENT_SIGNATURE="cpython-3.10-64bit" PYO3_PYTHON="/usr/bin/python3" PYTHON_SYS_EXECUTABLE="/usr/bin/python3" "cargo" "rustc" "--release" "--manifest-path" "/tmp/pip-install-8i90cdvq/pyfnntw_cd52bbf6d78f4029ae509b1dd8405027/Cargo.toml" "--message-format" "json" "--lib"`
  error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
    --> local_dependencies/fnntw/src/query.rs:19:33
     |
  19 |             Ok(process_result::<'t, T, D>(
     |                                 ^^
     |
  note: the late bound lifetime parameter is introduced here
    --> local_dependencies/fnntw/src/utils.rs:96:30
     |
  96 | pub(crate) fn process_result<'t, T: Float, const D: usize>(
     |                              ^^


  error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
    --> local_dependencies/fnntw/src/query.rs:24:33
     |
  24 |             Ok(process_result::<'t, T, D>(
     |                                 ^^
     |
  note: the late bound lifetime parameter is introduced here
    --> local_dependencies/fnntw/src/utils.rs:96:30
     |
  96 | pub(crate) fn process_result<'t, T: Float, const D: usize>(
     |                              ^^


  error[E0599]: no method named `ilog2` found for type `usize` in the current scope
     --> local_dependencies/fnntw/src/lib.rs:153:40
      |
  153 |             let height_hint = data_len.ilog2() as usize;
      |                                        ^^^^^ help: there is an associated function with a similar name: `log`


  error[E0599]: no method named `ilog2` found for type `usize` in the current scope
     --> local_dependencies/fnntw/src/lib.rs:474:40
      |
  474 |             let height_hint = data_len.ilog2() as usize;
      |                                        ^^^^^ help: there is an associated function with a similar name: `log`


  error: aborting due to 4 previous errors


  For more information about this error, try `rustc --explain E0599`.

  Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/usr/bin/python3', '--compatibility', 'off'] returned non-zero exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pyfnntw
Failed to build pyfnntw
ERROR: Could not build wheels for pyfnntw, which is required to install pyproject.toml-based projects
[matteo@tuxedo ~]$ pip3 install pyfnntw > out
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /usr/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmpnz61h27j
       cwd: /tmp/pip-install-a8ggre83/pyfnntw_164096346079481d864472fc48146814
  Complete output (116 lines):
  Running `maturin pep517 build-wheel -i /usr/bin/python3 --compatibility off`
  🔗 Found pyo3 bindings
  🐍 Found CPython 3.10 at /usr/bin/python3
     Compiling autocfg v1.1.0
     Compiling proc-macro2 v1.0.66
     Compiling unicode-ident v1.0.3
     Compiling libc v0.2.132
     Compiling cfg-if v1.0.0
     Compiling thiserror v1.0.47
     Compiling target-lexicon v0.12.4
     Compiling crossbeam-utils v0.8.16
     Compiling syn v1.0.99
     Compiling scopeguard v1.1.0
     Compiling version_check v0.9.4
     Compiling ucd-trie v0.1.6
     Compiling once_cell v1.13.1
     Compiling rayon-core v1.11.0
     Compiling parking_lot_core v0.9.3
     Compiling const_fn v0.4.9
     Compiling arrayvec v0.4.12
     Compiling smallvec v1.9.0
     Compiling either v1.9.0
     Compiling rawpointer v0.2.1
     Compiling Inflector v0.11.4
     Compiling nodrop v0.1.14
     Compiling indoc v1.0.7
     Compiling itoa v0.4.8
     Compiling aliasable v0.1.3
     Compiling unindent v0.1.10
     Compiling permutation v0.4.1
     Compiling sync-unsafe-cell v0.1.1
     Compiling proc-macro-error-attr v1.0.4
     Compiling proc-macro-error v1.0.4
     Compiling memoffset v0.9.0
     Compiling num-traits v0.2.15
     Compiling crossbeam-epoch v0.9.15
     Compiling lock_api v0.4.7
     Compiling num-integer v0.1.45
     Compiling matrixmultiply v0.3.7
     Compiling crossbeam-channel v0.5.8
     Compiling num-format v0.4.0
     Compiling quote v1.0.33
     Compiling num_cpus v1.16.0
     Compiling pyo3-build-config v0.16.5
     Compiling syn v2.0.29
     Compiling crossbeam-deque v0.8.3
     Compiling parking_lot v0.12.1
     Compiling num-complex v0.4.4
     Compiling ordered-float v3.0.0
     Compiling rayon v1.7.0
     Compiling pyo3-ffi v0.16.5
     Compiling pyo3 v0.16.5
     Compiling ndarray v0.15.6
     Compiling pyo3-macros-backend v0.16.5
     Compiling thiserror-impl v1.0.47
     Compiling concat-idents v1.1.5
     Compiling ouroboros_macro v0.15.6
     Compiling pest v2.7.2
     Compiling pyo3-macros v0.16.5
     Compiling ouroboros v0.15.6
     Compiling semver-parser v0.10.2
     Compiling semver v0.11.0
     Compiling rustc_version v0.3.3
     Compiling likely_stable v0.1.2
     Compiling fnntw v0.4.1 (/tmp/pip-install-a8ggre83/pyfnntw_164096346079481d864472fc48146814/local_dependencies/fnntw)
  error: could not compile `fnntw` due to 5 previous errors
  warning: build failed, waiting for other jobs to finish...
  💥 maturin failed
    Caused by: Failed to build a native library through cargo
    Caused by: Cargo build finished with "exit status: 101": `PYO3_ENVIRONMENT_SIGNATURE="cpython-3.10-64bit" PYO3_PYTHON="/usr/bin/python3" PYTHON_SYS_EXECUTABLE="/usr/bin/python3" "cargo" "rustc" "--release" "--manifest-path" "/tmp/pip-install-a8ggre83/pyfnntw_164096346079481d864472fc48146814/Cargo.toml" "--message-format" "json" "--lib"`
  error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
    --> local_dependencies/fnntw/src/query.rs:19:33
     |
  19 |             Ok(process_result::<'t, T, D>(
     |                                 ^^
     |
  note: the late bound lifetime parameter is introduced here
    --> local_dependencies/fnntw/src/utils.rs:96:30
     |
  96 | pub(crate) fn process_result<'t, T: Float, const D: usize>(
     |                              ^^


  error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
    --> local_dependencies/fnntw/src/query.rs:24:33
     |
  24 |             Ok(process_result::<'t, T, D>(
     |                                 ^^
     |
  note: the late bound lifetime parameter is introduced here
    --> local_dependencies/fnntw/src/utils.rs:96:30
     |
  96 | pub(crate) fn process_result<'t, T: Float, const D: usize>(
     |                              ^^


  error[E0599]: no method named `ilog2` found for type `usize` in the current scope
     --> local_dependencies/fnntw/src/lib.rs:153:40
      |
  153 |             let height_hint = data_len.ilog2() as usize;
      |                                        ^^^^^ help: there is an associated function with a similar name: `log`


  error[E0599]: no method named `ilog2` found for type `usize` in the current scope
     --> local_dependencies/fnntw/src/lib.rs:474:40
      |
  474 |             let height_hint = data_len.ilog2() as usize;
      |                                        ^^^^^ help: there is an associated function with a similar name: `log`


  error: aborting due to 4 previous errors


  For more information about this error, try `rustc --explain E0599`.

  Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/usr/bin/python3', '--compatibility', 'off'] returned non-zero exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pyfnntw
ERROR: Could not build wheels for pyfnntw, which is required to install pyproject.toml-based projects

Help greatly appreciated!

Best wishes,
Matteo Lacki

@cavemanloverboy
Copy link
Owner

Looks like there are some features used that were introduced after 1.64.

If you can, try upgrading your rust version. I think the latest is 1.71 which is

@cavemanloverboy
Copy link
Owner

cavemanloverboy commented Aug 17, 2023

Also, in case you are interested:

I've developed an even faster in-place library at https://github.com/cavemanloverboy/bosque. Because it is in-place, it's not suitable for all use cases.

It is still a work in progress, but is very fast.

@MatteoLacki
Copy link
Author

OK, rustup update allowed for installation.
Some of the examples are out-of-date:

import pyfnntw

pyfnntw.Tree
AttributeError: module 'pyfnntw' has no attribute 'Tree'

But this works:

import pyfnntw

pyfnntw.Tree64

What is passed to that function except for the data?
There is nothing in the docstring :)

Regarding faster libs: sure, love to test it out, but I need them exposed into python, too.

Best wishes,
Matteo

@MatteoLacki
Copy link
Author

Also, it looks like the Tree64 supports only dim = 2 or dim = 3?

@cavemanloverboy
Copy link
Owner

cavemanloverboy commented Aug 18, 2023

Also, it looks like the Tree64 supports only dim = 2 or dim = 3?

That's correct. This was specialized for real spatial dimensions (particularly with periodic boundary conditions). If you don't need PBCs, I would recommend trying to port kiddo to python. It's a pretty fast not-in-place lib.

What is passed to that function except for the data?

leafsize and, if you are using periodic boundary conditions, the boxsize as an array.

@cavemanloverboy
Copy link
Owner

I did not really expect port this to python when I wrote it. As such, due to const generics in Rust, I had to pick a few dimensions so I just picked 2 and 3. You could, however, download the source code and compile for your use case.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants