Skip to content

Commit 037bfe5

Browse files
authored
Merge pull request #5 from codellm-devkit/feat/rs-docs
doc: add rust install instructions
2 parents 881dbfb + e2e5bba commit 037bfe5

File tree

1 file changed

+42
-20
lines changed

1 file changed

+42
-20
lines changed

docs/installing.md

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,15 @@ The Python SDK can be installed directly from
3333

3434
## Programming Language Specific Dependencies
3535

36-
3736
`CLDK` supports program analysis for multiple languages and requires additional dependencies to support specific languages. The following table lists the additional dependencies required for each language:
3837

3938
=== "Python Analysis"
4039

4140
For Python analysis as well as to use the CLDK Python SDK, you will need to install the Python programming language with version 3.11 or later. We recommend using a package manager like [pyenv](https://github.com/pyenv/pyenv) to install and manage Python dependencies.
4241

4342
=== "Java Analysis"
44-
45-
For Java analysis, CLDK relies on a companion project called [`codeanalyzer`](https://github.com/ibm/codenet-minerva-code-analyzer). `codeanalyzer` is a java project and you will therefore need to install the Java Development Kit (JDK) with java version 11 or later.
43+
44+
For Java analysis, CLDK relies on a companion project called [`codeanalyzer`](https://github.com/ibm/codenet-minerva-code-analyzer). `codeanalyzer` is a java project and you will therefore need to install the Java Development Kit (JDK) with java version 11 or later.
4645

4746
You can use a package manager like [SDKMAN](https://sdkman.io/) to install the JDK. First, install SDKMAN by running the following command:
4847

@@ -83,7 +82,7 @@ The Python SDK can be installed directly from
8382
- Set Java 11 as the current (or default) Java version:
8483

8584
```bash
86-
sdk use java 11.0.25-sem
85+
sdk use java 11.0.25-sem
8786
# If want to default to java 11 for all sessions, use the following command instead:
8887
# sdk default java 11.0.25-sem
8988
```
@@ -95,7 +94,7 @@ The Python SDK can be installed directly from
9594
```
9695

9796
This should output the version of the installed Java.
98-
97+
9998
```bash
10099
openjdk 11.0.25 2024-10-15
101100
IBM Semeru Runtime Open Edition 11.0.25.0 (build 11.0.25+9)
@@ -131,7 +130,6 @@ The Python SDK can be installed directly from
131130
```
132131
This should output the version of the installed Maven.
133132

134-
135133
=== "C/C++ Analysis"
136134

137135
CLDK uses LLVM and Clang Python bindings to analyze C/C++ code. The project requires specific versions:
@@ -147,14 +145,14 @@ The Python SDK can be installed directly from
147145
```shell
148146
brew install llvm@18
149147
```
150-
148+
151149
- Add LLVM to your PATH (add this to your ~/.zshrc or ~/.bash_profile)
152150
```shell
153151
export PATH="/usr/local/opt/llvm@18/bin:$PATH"
154152
export LDFLAGS="-L/usr/local/opt/llvm@18/lib"
155153
export CPPFLAGS="-I/usr/local/opt/llvm@18/include"
156154
```
157-
155+
158156
- Verify installation
159157
```shell
160158
clang --version
@@ -176,13 +174,13 @@ The Python SDK can be installed directly from
176174
sudo ./llvm.sh 18
177175
sudo apt-get install llvm-18 llvm-18-dev clang-18 libclang-18-dev
178176
```
179-
177+
180178
- Create symlinks (optional but recommended)
181179
```shell
182180
sudo ln -s /usr/bin/clang-18 /usr/bin/clang
183181
sudo ln -s /usr/bin/llvm-config-18 /usr/bin/llvm-config
184182
```
185-
183+
186184
- Verify installation
187185
```shell
188186
clang --version
@@ -206,13 +204,13 @@ The Python SDK can be installed directly from
206204
sudo yum install epel-release
207205
sudo yum install llvm18 llvm18-devel clang18 clang18-devel
208206
```
209-
207+
210208
- Create symlinks (optional but recommended)
211209
```shell
212210
sudo ln -s /usr/bin/clang-18 /usr/bin/clang
213211
sudo ln -s /usr/bin/llvm-config-18 /usr/bin/llvm-config
214212
```
215-
213+
216214
- Verify installation
217215
```shell
218216
clang --version
@@ -226,6 +224,32 @@ The Python SDK can be installed directly from
226224
Configuration file: /etc/clang18/x86_64-redhat-linux-gnu-clang.cfg
227225
```
228226

227+
=== "Rust Installation"
228+
229+
Rustup is the recommended tool for installing Rust and managing its toolchains. It simplifies the process of keeping Rust up to date and allows switching between different Rust versions and toolchains seamlessly.
230+
231+
- **Install Rustup**
232+
Run the following command in your terminal:
233+
```shell
234+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
235+
```
236+
Follow the on-screen instructions to complete the installation.
237+
238+
- **Configure Your Environment**
239+
Add Rust to your PATH by appending this line to your shell init script:
240+
```shell
241+
source $HOME/.cargo/env
242+
```
243+
244+
- **Verify Installation**
245+
Confirm that Rust is installed correctly by checking the version:
246+
```shell
247+
rustc --version
248+
```
249+
Expected output (version may vary):
250+
```shell
251+
rustc 1.70.0 (90c541806 2023-05-31)
252+
```
229253

230254
## Additional Development Tools
231255

@@ -240,7 +264,7 @@ Some operating systems may require additional development tools:
240264
```
241265

242266
- Additionally, you may need to install the following packages using Homebrew:
243-
267+
244268
```shell
245269
brew install openssl readline sqlite3 xz zlib tcl-tk libffi
246270
```
@@ -258,19 +282,17 @@ Some operating systems may require additional development tools:
258282
=== "Red Hat-based Systems (Fedora/CentOS/RHEL)"
259283

260284
- Install the required development tools using the following command:
261-
285+
262286
```shell
263287
sudo dnf group install c-development development-tools gcc make \
264-
patch zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel\
288+
patch zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel\
265289
openssl-devel tk-devel libffi-devel xz-devel
266290
```
267291

268-
269-
270292
## Supported Python Versions
271293

272294
`CLDK` is compatible with Python versions 3.11 and later. The following table lists the supported Python versions and the corresponding `CLDK` versions:
273295

274-
| :fontawesome-brands-python: Python Version | :cldk-logo-white: Compatible `cldk` Versions |
275-
|-------------------------------------------------------------------|--------------------------------------------|
276-
| 3.11 | ≥0.4.0 |
296+
| :fontawesome-brands-python: Python Version | :cldk-logo-white: Compatible `cldk` Versions |
297+
| ------------------------------------------ | -------------------------------------------- |
298+
| 3.11 | ≥0.4.0 |

0 commit comments

Comments
 (0)