# Binaries compilation errors, error\[E0432\], error\[E0599\]

**URL:** <https://forum.autonomys.xyz/t/binaries-compilation-errors-error-e0432-error-e0599/2229>\
**Category:** Support\
**Created:** [December 8, 2023, 10:43am UTC](https://forum.autonomys.xyz/t/binaries-compilation-errors-error-e0432-error-e0599/2229 "2023-12-08T10:43:53Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rabinovitch](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/rabinovitch/32/99_2.png) [@Rabinovitch](https://forum.autonomys.xyz/u/Rabinovitch)\
**Post date:** [December 8, 2023, 10:43am UTC](https://forum.autonomys.xyz/t/binaries-compilation-errors-error-e0432-error-e0599/2229/1 "2023-12-08T10:43:54Z")

</div>

## Issue Report

### Environment

- **Operating System:** Ubuntu 22.04.3 LTS, 5.15.0-88-generic, x86\_64
- **Advanced CLI:** gemini-3g-2023-dec-01
- rustc 1.76.0-nightly (503e12932 2023-12-07)

### Problem

On one of my servers I can’t build binaries from source:

```auto
error[E0432]: unresolved import `core::simd::SimdUint`
  --> crates/subspace-proof-of-space/src/chiapos/table.rs:16:24
   |
16 | use core::simd::{Simd, SimdUint};
   | ^^^^^^^^ no `SimdUint` in `simd`
   |
   = help: consider importing one of these items instead:
           core::simd::prelude::SimdUint
           std::simd::prelude::SimdUint

   Compiling subspace-archiving v0.1.0 (/home/admfc/subspace/crates/subspace-archiving)
error[E0599]: no method named `cast` found for struct `Simd` in the current scope
   --> crates/subspace-proof-of-space/src/chiapos/table.rs:249:22
    |
249 | let ys = (pre_ys.cast() & pre_ys_mask) | (pre_exts & pre_exts_mask);
    | ^^^^ method not found in `Simd<u64, COMPUTE_F1_SIMD_FACTOR>`
   --> /rustc/503e129328080e924c0ddfca6abf4c2812580102/library/core/src/../../portable-simd/crates/core_simd/src/simd/num/uint.rs:17:8
    |
    = note: the method is available for `Simd<u64, COMPUTE_F1_SIMD_FACTOR>` here
    |
    = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
    |
1 + use std::simd::num::SimdUint;
    |

Some errors have detailed explanations: E0432, E0599.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `subspace-proof-of-space` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...

```

Everything is fine on a couple dozen other servers. Neither subspace-node nor subspace-farmer is being built.

---

<div class="post-metadata">

**Author:** ![nazar-pc](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/nazar-pc/32/6_2.png) [@nazar-pc](https://forum.autonomys.xyz/u/nazar-pc)\
**Post date:** [December 8, 2023, 1:51pm UTC](https://forum.autonomys.xyz/t/binaries-compilation-errors-error-e0432-error-e0599/2229/2 "2023-12-08T13:51:05Z")

</div>

How do you compile it exactly?

Because if you just do `cargo build` it will not use Rust version that you provided, but rather one defined in `rust-toolchain.toml`, which code compiles with just fine. It is not guaranteed that code will compile with older/newer versions of the compiler because we use nightly-only features.

---

<div class="post-metadata">

**Author:** ![Rabinovitch](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/rabinovitch/32/99_2.png) [@Rabinovitch](https://forum.autonomys.xyz/u/Rabinovitch)\
**Post date:** [December 8, 2023, 2:48pm UTC](https://forum.autonomys.xyz/t/binaries-compilation-errors-error-e0432-error-e0599/2229/3 "2023-12-08T14:48:25Z")

</div>

```auto
git clone https://github.com/subspace/subspace.git && cd subspace && git checkout gemini-3g-2023-dec-01
export RUSTFLAGS="-C target-cpu=native -C opt-level=3" && export CFLAGS="-march=native" && export CXXFLSGS="$CFLAGS"
rustup update
cargo build --profile production --bin subspace-farmer --bin subspace-node

```

How to compile correctly?

---

<div class="post-metadata">

**Author:** ![nazar-pc](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/nazar-pc/32/6_2.png) [@nazar-pc](https://forum.autonomys.xyz/u/nazar-pc)\
**Post date:** [December 8, 2023, 3:04pm UTC](https://forum.autonomys.xyz/t/binaries-compilation-errors-error-e0432-error-e0599/2229/4 "2023-12-08T15:04:44Z")

</div>

Looks a bit random. I don’t think you need to specify optimization level (it is like that for production already) or C/C++ flags (not sure why you have them there). Also `native` is not always the most performant, but will not hurt generally. Even if you don’t specify any of those environment variables, you should get efficient and performant build (though I would recommend `main` branch before the next release due to [Fix AES-NI enablement by default, including when building container images by nazar-pc · Pull Request #2291 · subspace/subspace · GitHub](https://github.com/subspace/subspace/pull/2291))…

The command itself seems correct and should pick up `rust-toolchain.toml` if you installed Rust itself through [https://rustup.rs/](https://rustup.rs/) and not OS’s package manager, that can have customized Rust toolchain with various “features”.

---

<div class="post-metadata">

**Author:** ![Rabinovitch](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/rabinovitch/32/99_2.png) [@Rabinovitch](https://forum.autonomys.xyz/u/Rabinovitch)\
**Post date:** [December 8, 2023, 3:08pm UTC](https://forum.autonomys.xyz/t/binaries-compilation-errors-error-e0432-error-e0599/2229/5 "2023-12-08T15:08:45Z")

</div>

I always install Rust using `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh` command.

> Looks a bit random.

My friends suggested it to me… 🤷‍♂️

---

<div class="post-metadata">

**Author:** ![nazar-pc](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/nazar-pc/32/6_2.png) [@nazar-pc](https://forum.autonomys.xyz/u/nazar-pc)\
**Post date:** [December 8, 2023, 6:05pm UTC](https://forum.autonomys.xyz/t/binaries-compilation-errors-error-e0432-error-e0599/2229/6 "2023-12-08T18:05:33Z")

</div>

Is `rust-toolchain.toml` present after you clone the repo? Something is clearly off, but from what you wrote I don’t see what it is.

---

<div class="post-metadata">

**Author:** ![Rabinovitch](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/rabinovitch/32/99_2.png) [@Rabinovitch](https://forum.autonomys.xyz/u/Rabinovitch)\
**Post date:** [December 8, 2023, 8:52pm UTC](https://forum.autonomys.xyz/t/binaries-compilation-errors-error-e0432-error-e0599/2229/7 "2023-12-08T20:52:34Z")

</div>

![image](https://canada1.discourse-cdn.com/flex011/uploads/subspace/original/2X/c/c667d92998b3a551625fccfc006a0e4eab024208.png)  
It is.

---

<div class="post-metadata">

**Author:** ![nazar-pc](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/nazar-pc/32/6_2.png) [@nazar-pc](https://forum.autonomys.xyz/u/nazar-pc)\
**Post date:** [December 8, 2023, 9:13pm UTC](https://forum.autonomys.xyz/t/binaries-compilation-errors-error-e0432-error-e0599/2229/8 "2023-12-08T21:13:53Z")

</div>

Okay, can you run `rustc --version` in the project directory to see which compiler version it picked up?

---

<div class="post-metadata">

**Author:** ![Rabinovitch](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/rabinovitch/32/99_2.png) [@Rabinovitch](https://forum.autonomys.xyz/u/Rabinovitch)\
**Post date:** [December 9, 2023, 6:10am UTC](https://forum.autonomys.xyz/t/binaries-compilation-errors-error-e0432-error-e0599/2229/9 "2023-12-09T06:10:43Z")

</div>

![image](https://canada1.discourse-cdn.com/flex011/uploads/subspace/original/2X/f/f53dba87ea4bb8694528e75beee31864e25aea3d.png)

---

<div class="post-metadata">

**Author:** ![nazar-pc](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/nazar-pc/32/6_2.png) [@nazar-pc](https://forum.autonomys.xyz/u/nazar-pc)\
**Post date:** [December 9, 2023, 2:34pm UTC](https://forum.autonomys.xyz/t/binaries-compilation-errors-error-e0432-error-e0599/2229/10 "2023-12-09T14:34:10Z")

</div>

Hm, that is not what it should be. For some reason it doesn’t select correct version.  
What does `which rustc` say?

---

<div class="post-metadata">

**Author:** ![Rabinovitch](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/rabinovitch/32/99_2.png) [@Rabinovitch](https://forum.autonomys.xyz/u/Rabinovitch)\
**Post date:** [December 9, 2023, 4:14pm UTC](https://forum.autonomys.xyz/t/binaries-compilation-errors-error-e0432-error-e0599/2229/11 "2023-12-09T16:14:38Z")

</div>

![image](https://canada1.discourse-cdn.com/flex011/uploads/subspace/original/2X/9/9f027ea9548cc0100a607fb450abf828a6b596c6.png)  
On each such checking I compare the results with another similar server where everything is OK… The results are:  
 ![image](https://canada1.discourse-cdn.com/flex011/uploads/subspace/original/2X/c/c53d4231c00aae7ddb4589963d57dcba871c0b3d.png)

---

<div class="post-metadata">

**Author:** ![Rabinovitch](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/rabinovitch/32/99_2.png) [@Rabinovitch](https://forum.autonomys.xyz/u/Rabinovitch)\
**Post date:** [December 9, 2023, 7:04pm UTC](https://forum.autonomys.xyz/t/binaries-compilation-errors-error-e0432-error-e0599/2229/12 "2023-12-09T19:04:59Z")

</div>

> [@nazar-pc](#):
>
> Looks a bit random.

> [@Few optimizations for nodes and farmers](https://forum.autonomys.xyz/t/few-optimizations-for-nodes-and-farmers/877):
>
> From my own experience, I have identified for myself a number of optimizations and tips that can help you. Most of the above was tested by me in practice. I’m open to additions, corrections and etc… Note, this article is largely designed for Linux users, since I myself am one. Keep it in mind while reading this. 1. Using an external journal on the SSD for the file system on HDD. In the real world (out of benchmarks), I’ve only tested this on XFS, and it improves performance significantly. …

Please see #8 🤷‍♂️

---

<div class="post-metadata">

**Author:** ![nazar-pc](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/nazar-pc/32/6_2.png) [@nazar-pc](https://forum.autonomys.xyz/u/nazar-pc)\
**Post date:** [December 9, 2023, 11:33pm UTC](https://forum.autonomys.xyz/t/binaries-compilation-errors-error-e0432-error-e0599/2229/13 "2023-12-09T23:33:20Z")

</div>

Try installing stable rustup and everything else then. We ship `rust-toolchain.toml` with the project and it will automatically download correct version of the toolchain if it is not already present, no need to install nightly and there is a chance they had some regression that broke `rust-toolchain.toml` support.

---

<div class="post-metadata">

**Author:** ![nazar-pc](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/nazar-pc/32/6_2.png) [@nazar-pc](https://forum.autonomys.xyz/u/nazar-pc)\
**Post date:** [December 9, 2023, 11:35pm UTC](https://forum.autonomys.xyz/t/binaries-compilation-errors-error-e0432-error-e0599/2229/14 "2023-12-09T23:35:26Z")

</div>

> [@Rabinovitch](#):
>
> Please see #8 🤷‍♂️

The way Rust tooling works it will usually automatically pick Rust compilation options and will translate them into C/C++ flags downstream. So if you specify target CPU as `native`, it will be `native` for C/C++ and `-O3` is already default for release builds in Rust, so specifying it explicitly is unnecessary.

And I’m also wondering if you see any difference from recompiling things in the first place, I’d imagine difference with official Skylake builds to be minimum to none.

---

<div class="post-metadata">

**Author:** ![Rabinovitch](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/rabinovitch/32/99_2.png) [@Rabinovitch](https://forum.autonomys.xyz/u/Rabinovitch)\
**Post date:** [December 10, 2023, 5:59am UTC](https://forum.autonomys.xyz/t/binaries-compilation-errors-error-e0432-error-e0599/2229/15 "2023-12-10T05:59:45Z")

</div>

> [@nazar-pc](#):
>
> Try installing stable rustup and everything else then.

```auto
   Compiling scale-info v2.9.0
   Compiling subspace-core-primitives v0.1.0 (/home/admfc/subspace/crates/subspace-core-primitives)
   Compiling sp-arithmetic v16.0.0 (https://github.com/subspace/polkadot-sdk?rev=892bf8e938c6bd2b893d3827d1093cd81baa59a1#892bf8e9)
   Compiling jsonrpsee-core v0.16.3
   Compiling hyper-rustls v0.24.1
error[E0554]: `#![feature]` may not be used on the stable release channel
  --> crates/subspace-core-primitives/src/lib.rs:21:1
   |
21 | / #![feature(
22 | | array_chunks,
23 | | const_option,
24 | | const_trait_impl,
... |
29 | | step_trait
30 | | )]
   | |__^

error[E0554]: `#![feature]` may not be used on the stable release channel
  --> crates/subspace-core-primitives/src/lib.rs:22:5
   |
22 | array_chunks,
   | ^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
  --> crates/subspace-core-primitives/src/lib.rs:23:5
   |
23 | const_option,
   | ^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
  --> crates/subspace-core-primitives/src/lib.rs:26:5
   |
26 | new_uninit,
   | ^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
  --> crates/subspace-core-primitives/src/lib.rs:27:5
   |
27 | portable_simd,
   | ^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
  --> crates/subspace-core-primitives/src/lib.rs:28:5
   |
28 | slice_flatten,
   | ^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
  --> crates/subspace-core-primitives/src/lib.rs:29:5
   |
29 | step_trait
   | ^^^^^^^^^^

For more information about this error, try `rustc --explain E0554`.
error: could not compile `subspace-core-primitives` (lib) due to 7 previous errors
warning: build failed, waiting for other jobs to finish...

```

I have performed a complete reload of the subspace repository.  
 ![image](https://canada1.discourse-cdn.com/flex011/uploads/subspace/original/2X/0/05f1ab3169f20ce2b638e740479948db47001f11.png)

---

<div class="post-metadata">

**Author:** ![nazar-pc](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/nazar-pc/32/6_2.png) [@nazar-pc](https://forum.autonomys.xyz/u/nazar-pc)\
**Post date:** [December 10, 2023, 7:19am UTC](https://forum.autonomys.xyz/t/binaries-compilation-errors-error-e0432-error-e0599/2229/16 "2023-12-10T07:19:55Z")

</div>

Can you attach `rustup show` output? And please do so as text rather than screenshots.

Also in case you ever ran `rustup override set` to set a specific version, do `rustup override unset` to remove it.

---

<div class="post-metadata">

**Author:** ![Rabinovitch](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/rabinovitch/32/99_2.png) [@Rabinovitch](https://forum.autonomys.xyz/u/Rabinovitch)\
**Post date:** [December 10, 2023, 8:15am UTC](https://forum.autonomys.xyz/t/binaries-compilation-errors-error-e0432-error-e0599/2229/17 "2023-12-10T08:15:22Z")

</div>

> [@nazar-pc](#):
>
> `rustup override unset`

Seems that did the trick. 🥳

In my cheat sheet there was only `rustup default stable` command to revert these changes.

---

<div class="post-metadata">

**Author:** ![nazar-pc](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/nazar-pc/32/6_2.png) [@nazar-pc](https://forum.autonomys.xyz/u/nazar-pc)\
**Post date:** [December 10, 2023, 8:39am UTC](https://forum.autonomys.xyz/t/binaries-compilation-errors-error-e0432-error-e0599/2229/18 "2023-12-10T08:39:11Z")

</div>

Well, that doesn’t revert anything, it forces stable version for the directory that overrides `rust-toolchain.toml`. There is no need to set or install any specific version because we intentionally ship `rust-toolchain.toml` for things to “just work” out of the box.
