in build_aarch64_wheel.py [0:0]
def build_torchtext(host: RemoteHost, *,
branch: str = "master",
use_conda: bool = True,
git_clone_flags: str = "") -> str:
print('Checking out TorchText repo')
git_clone_flags += " --recurse-submodules"
build_version = checkout_repo(host,
branch=branch,
url="https://github.com/pytorch/text",
git_clone_flags=git_clone_flags,
mapping={
"v1.9.0": ("0.10.0", "rc1"),
"v1.10.0": ("0.11.0", "rc2"),
"v1.10.1": ("0.11.1", "rc1"),
"v1.10.2": ("0.11.2", "rc1"),
"v1.11.0": ("0.12.0", "rc1"),
})
print('Building TorchText wheel')
build_vars = ""
if branch == 'nightly':
version = host.check_output(["if [ -f text/version.txt ]; then cat text/version.txt; fi"]).strip()
build_date = host.check_output("cd pytorch ; git log --pretty=format:%s -1").strip().split()[0].replace("-", "")
build_vars += f"BUILD_VERSION={version}.dev{build_date}"
elif build_version is not None:
build_vars += f"BUILD_VERSION={build_version}"
if host.using_docker():
build_vars += " CMAKE_SHARED_LINKER_FLAGS=-Wl,-z,max-page-size=0x10000"
host.run_cmd(f"cd text; {build_vars} python3 setup.py bdist_wheel")
wheel_name = host.list_dir("text/dist")[0]
embed_libgomp(host, use_conda, os.path.join('text', 'dist', wheel_name))
print('Copying TorchText wheel')
host.download_wheel(os.path.join('text', 'dist', wheel_name))
return wheel_name