feat: implement 3d euler beam fortran kernel
This commit is contained in:
@@ -72,10 +72,23 @@ def quote_path(path: str | Path) -> str:
|
||||
return shell_join([path])
|
||||
|
||||
|
||||
def cmd_executable(env: dict[str, str] | None = None) -> str:
|
||||
env = env or os.environ
|
||||
return env.get("ComSpec") or shutil.which("cmd.exe") or shutil.which("cmd") or "cmd"
|
||||
|
||||
|
||||
def cmd_minimal_path(env: dict[str, str] | None = None) -> str:
|
||||
env = env or os.environ
|
||||
system_root = env.get("SystemRoot") or r"C:\Windows"
|
||||
return f"{system_root}\\System32;{system_root}"
|
||||
|
||||
|
||||
def wrap_command(toolchain: FortranToolchain, args: list[str | Path]) -> str:
|
||||
command = shell_join(args)
|
||||
if toolchain.env_script is None:
|
||||
return command
|
||||
|
||||
env_script = quote_path(toolchain.env_script)
|
||||
return f'cmd /d /s /c "call {env_script} intel64 >nul && {command}"'
|
||||
cmd = quote_path(cmd_executable())
|
||||
path = cmd_minimal_path()
|
||||
return f'{cmd} /d /s /c "set "PATH={path}" && call {env_script} intel64 >nul && {command}"'
|
||||
|
||||
Reference in New Issue
Block a user