hsuwill000's picture
Update app.py
d60a7f3 verified
raw
history blame
929 Bytes
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():
# Step 1: Clone the OpenBLAS repository
print("Cloning the OpenBLAS repository...")
run_command("git clone https://github.com/OpenMathLib/OpenBLAS.git")
# Step 2: Change to the OpenBLAS directory
os.chdir("OpenBLAS")
# Step 3: Build OpenBLAS
print("Building OpenBLAS...")
run_command("make TARGET=SKYLAKEX NUM_THREADS=20 BINARY=64")
# Step 4: Install OpenBLAS
print("Installing OpenBLAS...")
run_command("make install")
if __name__ == "__main__":
os.system("gfortran")
#install_openblas()