Build the tiktoken static library.
()
| 9 | from pathlib import Path |
| 10 | |
| 11 | def build_tiktoken_lib(): |
| 12 | """Build the tiktoken static library.""" |
| 13 | try: |
| 14 | subprocess.check_call(["make", "-C", "src/tiktoken"], |
| 15 | stdout=subprocess.PIPE, |
| 16 | stderr=subprocess.PIPE) |
| 17 | print("✓ tiktoken library built successfully") |
| 18 | return True |
| 19 | except subprocess.CalledProcessError as e: |
| 20 | print(f"✗ Failed to build tiktoken library: {e}") |
| 21 | return False |
| 22 | except FileNotFoundError: |
| 23 | print("✗ make command not found. Please install build tools.") |
| 24 | return False |
| 25 | |
| 26 | def main(): |
| 27 | """Main build function.""" |