File size: 940 Bytes
5177727
7a13824
5177727
7a13824
 
 
 
 
 
5177727
7a13824
5177727
7a13824
 
 
1750dd9
7a13824
5177727
7a13824
 
bbd1ac8
7a13824
 
1750dd9
bbd1ac8
7a13824
 
d3a6a90
bbd1ac8
5177727
d3a6a90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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("apt-get install build-essential gfortran")
    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=SAPPHIRERAPIDS")

    # Step 4: Install OpenBLAS
    print("Installing OpenBLAS...")
    run_command("make install")

if __name__ == "__main__":
    install_openblas()