MCPcopy Index your code
hub / github.com/microsoft/BitNet / compile

Function compile

setup_env.py:203–216  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

201
202
203def 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
218def main():
219 setup_gguf()

Callers 1

mainFunction · 0.85

Calls 2

system_infoFunction · 0.85
run_commandFunction · 0.70

Tested by

no test coverage detected