File size: 929 Bytes
5177727
7a13824
5177727
7a13824
 
 
 
 
 
5177727
7a13824
5177727
7a13824
 
 
 
5177727
7a13824
 
bbd1ac8
7a13824
 
d40095f
bbd1ac8
7a13824
 
d3a6a90
bbd1ac8
5177727
d60a7f3
a56b12b
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("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()