| 84 | download_file(url, outfile) |
| 85 | |
| 86 | def setup_env(os_name): |
| 87 | print("\nEnvironment Setup") |
| 88 | print("=================\n") |
| 89 | |
| 90 | current_dir = os.getcwd() |
| 91 | lib_dir = os.path.join(current_dir, "third_party", "lib") |
| 92 | |
| 93 | if os_name == "macOS": |
| 94 | print(" Before running the program, run the following command or add it to your shell profile:") |
| 95 | print(f" export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:{lib_dir}") |
| 96 | |
| 97 | with open("source", "w") as f: |
| 98 | f.write(f"export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:{lib_dir}\n") |
| 99 | if os_name == "Linux": |
| 100 | print(" Before running the program, run the following command or add it to your shell profile:") |
| 101 | print(f" export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:{lib_dir}") |
| 102 | |
| 103 | with open("source", "w") as f: |
| 104 | f.write(f"export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:{lib_dir}\n") |
| 105 | |
| 106 | def main(): |
| 107 | os_name = get_os_name() |