()
| 201 | |
| 202 | |
| 203 | def compile(): |
| 204 | # Check if cmake is installed |
| 205 | cmake_exists = subprocess.run(["cmake", "--version"], capture_output=True) |
| 206 | if cmake_exists.returncode != 0: |
| 207 | logging.error("Cmake is not available. Please install CMake and try again.") |
| 208 | sys.exit(1) |
| 209 | _, arch = system_info() |
| 210 | if arch not in COMPILER_EXTRA_ARGS.keys(): |
| 211 | logging.error(f"Arch {arch} is not supported yet") |
| 212 | exit(0) |
| 213 | logging.info("Compiling the code using CMake.") |
| 214 | run_command(["cmake", "-B", "build", *COMPILER_EXTRA_ARGS[arch], *OS_EXTRA_ARGS.get(platform.system(), []), "-DCMAKE_C_COMPILER=clang", "-DCMAKE_CXX_COMPILER=clang++"], log_step="generate_build_files") |
| 215 | # run_command(["cmake", "--build", "build", "--target", "llama-cli", "--config", "Release"]) |
| 216 | run_command(["cmake", "--build", "build", "--config", "Release"], log_step="compile") |
| 217 | |
| 218 | def main(): |
| 219 | setup_gguf() |
no test coverage detected