|
import subprocess |
|
import os |
|
|
|
def run_command(command, cwd=None): |
|
"""Executes a shell command and prints output""" |
|
result = subprocess.run(command, cwd=cwd, text=True, capture_output=True, shell=True) |
|
if result.returncode != 0: |
|
print(f"Error executing command: {command}") |
|
print(result.stderr) |
|
else: |
|
print(result.stdout) |
|
|
|
def install_openblas(): |
|
|
|
print("Cloning the OpenBLAS repository...") |
|
run_command("git clone https://github.com/OpenMathLib/OpenBLAS.git") |
|
|
|
|
|
os.chdir("OpenBLAS") |
|
|
|
|
|
print("Building OpenBLAS...") |
|
run_command("make TARGET=SKYLAKEX NUM_THREADS=20 BINARY=64") |
|
|
|
|
|
print("Installing OpenBLAS...") |
|
run_command("make install") |
|
|
|
if __name__ == "__main__": |
|
os.system("gfortran") |
|
|