diff --git a/README.md b/README.md index 1dfc4ae7..d1a5b4d6 100644 --- a/README.md +++ b/README.md @@ -127,3 +127,62 @@ For commercial licensing inquiries, email us: info@fastflowlm.com - Tokenization accelerated with [MLC-ai/tokenizers-cpp](https://github.com/mlc-ai/tokenizers-cpp) - Chat formatting via [Google/minja](https://github.com/google/minja) - Low-level kernels optimized using the powerful [IRON](https://github.com/amd/iron)+[AIE-MLIR](https://github.com/Xilinx/mlir-aie) + +--- + +## 🛠️ Building from Source + +For developers who want to build FastFlowLM from source, we provide CMake presets for a convenient and consistent build experience. + +### Prerequisites + +- Git +- CMake (version 3.22 or higher) +- A C++20 compatible compiler (e.g., GCC, Clang, MSVC) +- Ninja (recommended) + +### Build Instructions + +1. **Clone the repository:** + + ```bash + git clone --recursive https://github.com/FastFlowLM/FastFlowLM.git + cd FastFlowLM/src + ``` + +2. **Configure CMake using presets:** + + - **For Linux:** + + ```bash + cmake --preset linux-default + ``` + + This will configure the build to install to `/opt/fastflowlm`. + + - **For Windows (in a developer command prompt):** + + ```bash + cmake --preset windows-default + ``` + +3. **Build the project:** + + ```bash + cmake --build build + ``` + +4. **Install the project (optional):** + + - **For Linux:** + + ```bash + sudo cmake --install build + ``` + + - **For Windows (with administrator privileges):** + + ```bash + cmake --install build + ``` + diff --git a/debian/rules b/debian/rules index f93b7dad..417f7ad8 100644 --- a/debian/rules +++ b/debian/rules @@ -9,10 +9,7 @@ override_dh_dwz: # dh_dwz is skipped because it causes issues with the binary structure override_dh_auto_configure: - cmake -S src -B build \ - -GNinja \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/opt/fastflowlm + cmake -S src -B build --preset linux-default override_dh_auto_build: cmake --build build diff --git a/src/CMakePresets.json b/src/CMakePresets.json new file mode 100644 index 00000000..d679d968 --- /dev/null +++ b/src/CMakePresets.json @@ -0,0 +1,26 @@ +{ + "version": 3, + "configurePresets": [ + { + "name": "linux-default", + "displayName": "Linux Default", + "description": "Default configuration for Linux", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "CMAKE_INSTALL_PREFIX": "/opt/fastflowlm" + } + }, + { + "name": "windows-default", + "displayName": "Windows Default", + "description": "Default configuration for Windows using Visual Studio", + "generator": "Visual Studio 17 2022", + "binaryDir": "${sourceDir}/build", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + } + ] +}