Skip to content

Releases: cyberark/ByteCodeLLM

First Release

20 Nov 07:12
Compare
Choose a tag to compare

Guide to Compile Binaries for ByteCodeLLM

This guide provides step-by-step instructions to compile and run ByteCodeLLM binaries for Linux, Windows, and macOS platforms.

Prerequisites

  1. Install Dependencies: Before proceeding, install all the dependencies required for the project.

  2. Install PyInstaller: Ensure that PyInstaller is installed to compile the binaries:

    pip install pyinstaller
  3. Clone this repository:

git clone https://github.com/cyberark/ByteCodeLLM
  1. Follow the pycdc instructions to compile pycdc and pycdas.

Step 1: Create a .spec File and place it in the same directory of the executable

I added down below a .spec file for example that you will need to change the path to you llama package explicit.

Before running PyInstaller, make the following changes to the .spec file:

  • Windows: Add the path to the llama.dll file. The path must be explicit and correct. Example:

    binaries=[('C:\path\to\llama.dll', 'llama_cpp\lib')]
  • Linux: Add the full path to the libllama.so file. Example:

    binaries=[('/full/path/to/libllama.so', ''llama_cpp/lib'')]
  • macOS: Add the full path to the libllama.dylib file. Example:

    binaries=[('/full/path/to/libllama.dylib', 'llama_cpp/lib'.')]

Finally: This will create the binary in the dist folder:

pyinstaller ByteCodeLLM.spec

Step 3: Configurations

After building the binary:

  1. Move or copy the config.py script into the dist folder where the binary is located.
  2. The config.py is also added here (Important change the path to the relative pycdc, pycdas executables).

Step 4: Running the Binary

Once the binary is compiled and the configuration file is in place, you can run the binary. Below is an example command for executing the binary:

Windows:

dist\ByteCodeLLM.exe --path path\to\file --output output_path --type type(pyc)

Linux:

./dist/ByteCodeLLM --path /path/to/file --output /output/path --type type(pyc)

macOS:

./dist/ByteCodeLLM --path /path/to/file --output /output/path --type type(pyc)

Replace path\to\file and output_path with your actual input file path and desired output directory.


By following this guide, you should be able to compile and run ByteCodeLLM binaries for Linux, Windows, and macOS systems successfully. If you encounter any issues, double-check the paths and ensure all dependencies are installed.