
* Vegetarian Filet o Fish model * fix.. atc.. * test cluster_speed_limit * fix.. cluster_speed_limit.. 2 * fix.. clusterspeedlimit3 * cruise speed to roadlimit speed * fix.. * fix.. eng * deltaUp/Down for lanechange * fix.. atc desire... * fix.. * ff * ff * fix.. * fix.. eng * fix engsound * Update desire_helper.py * fix.. connect... * fix curve_min speed * Revert "fix curve_min speed" This reverts commit fcc9c2eb14eb3504abef3e420db93e8882e56f37. * Reapply "fix curve_min speed" This reverts commit 2d2bba476c58a7b4e13bac3c3ad0e4694c95515d. * fix.. auto speed up.. roadlimit * fix.. atc auto lanechange... * Update desire_helper.py * Update cruise.py * debug atc... * fix.. waze alert offset.. * fix.. * test atc.. * fix.. * fix.. atc * atc test.. * fix.. atc * fix.. atc2 * fix.. atc3 * KerryGold Model. latsmooth_sec = 0.0 * lat smooth seconds 0.13 * fix comment * fix.. auto cruise, and speed unit * change lanemode switching. * erase mazda lkas button.
26 lines
1.5 KiB
Python
26 lines
1.5 KiB
Python
import ctypes, ctypes.util, os, sys, subprocess
|
|
from tinygrad.helpers import DEBUG, OSX, getenv
|
|
|
|
if sys.platform == 'win32':
|
|
# Windows llvm distribution doesn't seem to add itself to PATH or anywhere else where it can be easily retrieved from.
|
|
# winget also doesn't have something like `brew --prefix llvm` so just hardcode default installation path with an option to override
|
|
LLVM_PATH = getenv('LLVM_PATH', 'C:\\Program Files\\LLVM\\bin\\LLVM-C.dll')
|
|
if not os.path.exists(LLVM_PATH):
|
|
raise FileNotFoundError('LLVM not found, you can install it with `winget install LLVM.LLVM` or point at a custom dll with LLVM_PATH')
|
|
elif OSX:
|
|
# Will raise FileNotFoundError if brew is not installed
|
|
# `brew --prefix` will return even if formula is not installed
|
|
if not os.path.exists(brew_prefix:=subprocess.check_output(['brew', '--prefix', 'llvm@20']).decode().strip()):
|
|
raise FileNotFoundError('LLVM not found, you can install it with `brew install llvm@20`')
|
|
LLVM_PATH: str|None = os.path.join(brew_prefix, 'lib', 'libLLVM.dylib')
|
|
else:
|
|
LLVM_PATH = ctypes.util.find_library('LLVM')
|
|
# use newer LLVM if possible
|
|
for ver in reversed(range(14, 20+1)):
|
|
if LLVM_PATH is not None: break
|
|
LLVM_PATH = ctypes.util.find_library(f'LLVM-{ver}')
|
|
if LLVM_PATH is None:
|
|
raise FileNotFoundError("No LLVM library found on the system. Install it via your distro's package manager and ensure it's findable as 'LLVM'")
|
|
|
|
if DEBUG>=3: print(f'Using LLVM at {repr(LLVM_PATH)}')
|