scallop-lang / scallop

Framework and Language for Neurosymbolic Programming.
https://www.scallop-lang.org
MIT License
201 stars 8 forks source link

Failed to install Scallopy #8

Closed QianLongLongLong closed 1 year ago

QianLongLongLong commented 1 year ago

I tried to install Scallopy, but encountered the following issue:

(clip) ql@dcd222:~/repos/scallop/etc/scallopy$ make
maturin develop --release
๐Ÿน Building a mixed python/rust project
๐Ÿ”— Found pyo3 bindings
๐Ÿ Found CPython 3.9 at /home/ql/anaconda3/envs/clip/bin/python
   Compiling scallop-core v0.1.9 (/home/ql/repos/scallop/core)
    Building [=======================> ] 215/218: scallop-core                                                                 error[E0554]: `#![feature]` may not be used on the stable release channel
 --> core/src/lib.rs:1:1
  |
1 | #![feature(min_specialization)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    Building error[E0554]: `#![feature]` may not be used on the stable release channel
 --> core/src/lib.rs:2:1
  |
2 | #![feature(drain_filter)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^

[=======================> ] 215/218: scallop-core
error[E0554]: `#![feature]` may not be used on the stable release channel
 --> core/src/lib.rs:2:12
  |
2 | #![feature(drain_filter)]
  |            ^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'map_first_last'
   --> core/src/compiler/front/analyzers/type_inference/local.rs:271:67
    |
271 |       .map(|(var, exprs)| (var.clone(), inferred_expr_types[exprs.first().unwrap()].clone()))
    |                                                                   ^^^^^
    |
    = note: see issue #62924 <https://github.com/rust-lang/rust/issues/62924> for more information

error[E0658]: use of unstable library feature 'map_first_last'
  --> core/src/compiler/ram/incremental.rs:23:31
   |
23 |       let (s1, n1) = fringe_1.pop_first().unwrap();
   |                               ^^^^^^^^^
   |
   = note: see issue #62924 <https://github.com/rust-lang/rust/issues/62924> for more information

   error[E0658]: use of unstable library feature 'map_first_last'
  --> core/src/compiler/ram/incremental.rs:24:31
   |
24 |       let (s2, n2) = fringe_2.pop_first().unwrap();
   |                               ^^^^^^^^^
   |
   = note: see issue #62924 <https://github.com/rust-lang/rust/issues/62924> for more information

 error[E0658]: use of unstable library feature 'map_first_last'
  --> core/src/compiler/ram/incremental.rs:91:31
   |
91 |       let (s1, n1) = fringe_1.pop_first().unwrap();
   |                               ^^^^^^^^^
   |
   = note: see issue #62924 <https://github.com/rust-lang/rust/issues/62924> for more information

    Buildingerror[E0658]: use of unstable library feature 'map_first_last'
  --> core/src/compiler/ram/incremental.rs:92:31
   |
92 |       let (s2, n2) = fringe_2.pop_first().unwrap();
   |                               ^^^^^^^^^
   |
   = note: see issue #62924 <https://github.com/rust-lang/rust/issues/62924> for more information

error[E0658]: use of unstable library feature 'map_first_last'
  --> core/src/runtime/provenance/common/disjunction.rs:22:29
   |
22 |     let j_last = self.facts.last().unwrap(); // Note: disj.len >= 2
   |                             ^^^^
   |
   = note: see issue #62924 <https://github.com/rust-lang/rust/issues/62924> for more information

   error[E0658]: use of unstable library feature 'map_first_last'
  --> core/src/runtime/provenance/common/disjunction.rs:23:30
   |
23 |     let j_first = self.facts.first().unwrap(); // Note: disj.len >= 2
   |                              ^^^^^
   |
   = note: see issue #62924 <https://github.com/rust-lang/rust/issues/62924> for more information

  error[E0658]: use of unstable library feature 'map_first_last'
  --> core/src/runtime/provenance/common/disjunction.rs:24:24
   |
24 |     let f_last = facts.last().unwrap(); // Note: facts.len >= 2
   |                        ^^^^
   |
   = note: see issue #62924 <https://github.com/rust-lang/rust/issues/62924> for more information

    Buildingerror[E0658]: use of unstable library feature 'map_first_last'
  --> core/src/runtime/provenance/common/disjunction.rs:25:25
   |
25 |     let f_first = facts.first().unwrap(); // Note: facts.len >= 2
   |                         ^^^^^
   |
   = note: see issue #62924 <https://github.com/rust-lang/rust/issues/62924> for more information

    error: aborting due to 12 previous errors

Building
Some errors have detailed explanations: E0554, E0658.

For more information about an error, try `rustc --explain E0554`.

error: could not compile `scallop-core` due to 13 previous errors
๐Ÿ’ฅ 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.9-64bit" PYO3_PYTHON="/home/ql/anaconda3/envs/clip/bin/python" PYTHON_SYS_EXECUTABLE="/home/ql/anaconda3/envs/clip/bin/python" "cargo" "rustc" "--release" "--manifest-path" "/home/ql/repos/scallop/etc/scallopy/Cargo.toml" "--message-format" "json" "--lib"`
make: *** [makefile:2: all] Error 1

I tried both a stable version and a nightly version of rustc, however it still failed.

Liby99 commented 1 year ago

You would need to enable the nightly channel of the rust tool chain. You can do so by typing rustup default nightly in your command line. After this, the project should be compiled correctly.

QianLongLongLong commented 1 year ago

You would need to enable the nightly channel of the rust tool chain. You can do so by typing rustup default nightly in your command line. After this, the project should be compiled correctly.

I have tried "rustup default nightly" and then "make", or "rustup run nightly make", however it still reports the same error.

Liby99 commented 1 year ago

Thing is, from the error message I see error[E0554]: #![feature] may not be used on the stable release channel: it says the current channel is "stable". If it still throws the same error then I would assume that the channel is not being set correctly. Have you tried running rustup --version and confirmed that the active version of rustc is indeed nightly?

QianLongLongLong commented 1 year ago

I run rustup --version and it outputs

info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.71.0-nightly (f5559e338 2023-04-24)`

However if I run rustc --version it still says rustc 1.65.0

don't know how to switch to the nightly version to run install๐Ÿ˜ญ

Liby99 commented 1 year ago

One quick but dirty solution I can imagine is reinstalling (i.e. uninstall and install again) rust. When installing on command line, there is an option to choose not to do the default (stable) installation. Instead, you can specify the version, say 1.71.0-nightly. I suggest you make sure that there is no two different versions of rust on your system at the same time ๐Ÿ˜…

QianLongLongLong commented 1 year ago

Tried to uninstall the original rustc stable, and the installation successed! Thanks a lot!