From 87aca98c089f1c74c132527ea23b539b78a7cdf3 Mon Sep 17 00:00:00 2001 From: Nathan Hoos Date: Wed, 8 May 2024 08:03:47 -0500 Subject: [PATCH] Update README.md --- README.md | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 75 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 61300e7..5f1450a 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,83 @@ By using Logit sampling and a Finite State Machine (FSM), Function Sampler guide ## Installation -To install the `function-sampler` library, use the following command: +Before installing the `function-sampler` library, you need to first ensure that the Rust programming language is installed on your system. Follow the installation instructions for your platform below, then continue to install the library from source. + +### Install Rust + +
+Windows + +1. Download and run the Rust installer from [rustup.rs](https://rustup.rs/). +2. Follow the prompts to install Rust. This will also install `cargo`, Rust's package manager and build system. +3. After installation, open a new command prompt and verify the installation by running: + + ```bash + rustc --version + ``` + +4. Add Rust to your system PATH manually if it's not done automatically by the installer. Usually, Rust is installed under `%USERPROFILE%\.cargo\bin`. +5. If Rust is installed correctly, you should see the version number, commit hash, and commit date. +
+ +
+macOS + +1. You can install Rust using the following command in your terminal: + + ```bash + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh + ``` + +2. Follow the instructions on the screen to complete the installation. +3. After the installation is complete, restart your terminal and verify the installation by running: + + ```bash + rustc --version + ``` + +4. Rust installs its binaries in `~/.cargo/bin`. You may need to add this directory to your PATH using: + + ```bash + echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bash_profile + ``` + +5. If Rust is installed correctly, you should see the version number, commit hash, and commit date. +
+ +
+Linux + +1. Use the following command in your terminal to install Rust: + + ```bash + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh + ``` + +2. Follow the on-screen instructions to complete the installation process. +3. After completing the installation, source the Rust environment script: + + ```bash + source $HOME/.cargo/env + ``` + +5. Verify the installation by running: + + ```bash + rustc --version + ``` + +6. If Rust is installed correctly, you should see the version number, commit hash, and commit date. +
+ +### Install `function-sampler` from Source + +*Note*: Currently, until I can get the CI for PyPI sorted out, install from source is necessary. ```bash -pip install function-sampler +git clone https://github.com/unaidedelf8777/function-sampler.git +cd function-sampler +python setup.py install ``` ## Usage