general:rust
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
general:rust [2022/03/11 20:19] – sunkan | general:rust [2023/01/06 11:55] – sunkan | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Rust install from tar.gz ====== | ||
+ | * Unpack rust-1.XX.X-< | ||
+ | * Run install.sh --prefix=/ | ||
+ | * Make symlinks in / | ||
+ | * Create / | ||
+ | * Run ldconfig | ||
+ | |||
+ | * Unpack rustc-1.XX.X-src.tar.gz (after checking gpg signature) | ||
+ | * mkdir -p / | ||
+ | * cp -dR --preserve=timestamps rustc-1.XX.X-src/ | ||
+ | |||
+ | ====== Add WASM support ====== | ||
+ | Found good info here [[https:// | ||
+ | |||
+ | < | ||
+ | $ wget https:// | ||
+ | $ wget https:// | ||
+ | $ gpg --verify rust-std-1.66.0-wasm32-unknown-unknown.tar.xz.asc | ||
+ | |||
+ | $ tar xvaf rust-std-1.66.0-wasm32-unknown-unknown.tar.xz | ||
+ | |||
+ | $ rustc --print sysroot | ||
+ | / | ||
+ | |||
+ | # cd rust-std-1.66.0-wasm32-unknown-unknown/ | ||
+ | # cp --preserve=timestamps -R rust-std-wasm32-unknown-unknown/ | ||
+ | </ | ||
+ | |||
+ | ====== Compiling Rust code with MSVC ====== | ||
+ | * Start Rust 1.63 (MSVC) Shell for 32-bit or 64-bit | ||
+ | * Run the following command to setup the MSVC environment | ||
+ | |||
+ | 32-bit | ||
+ | < | ||
+ | " | ||
+ | </ | ||
+ | |||
+ | 64-bit | ||
+ | < | ||
+ | " | ||
+ | </ | ||
+ | |||
+ | |||
====== Rust error handling ====== | ====== Rust error handling ====== | ||
Use # | Use # | ||
Line 4: | Line 47: | ||
[[https:// | [[https:// | ||
+ | ====== Using C libraries ====== | ||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | ====== Rust guides ====== | ||
+ | [[http:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | ====== Rust memory ====== | ||
+ | [[https:// | ||
+ | |||
+ | ====== Perf and Rust ====== | ||
+ | From [[https:// | ||
+ | The basic perf command is this: | ||
+ | |||
+ | < | ||
+ | perf record -F99 --call-graph dwarf XXX | ||
+ | </ | ||
+ | |||
+ | The -F99 tells perf to sample at 99 Hz, which avoids generating too much data for longer runs (why 99 Hz you ask? It is often chosen because it is unlikely to be in lockstep with other periodic activity). The --call-graph dwarf tells perf to get call-graph information from debuginfo, which is accurate. The XXX is the command you want to profile. So, for example, you might do: | ||
general/rust.txt · Last modified: 2023/02/21 11:05 by sunkan