@@ -422,6 +422,14 @@ def configure_system(host: RemoteHost, *,
422
422
423
423
host .run_cmd ("pip3 install dataclasses typing-extensions" )
424
424
425
+ # Install and switch to gcc-10 on Ubuntu-20.04. This is required to support
426
+ # SVE instruction set for newer aarch64 architectures
427
+ if not host .using_docker () and host .ami == ubuntu20_04_ami and compiler == 'gcc-10' :
428
+ host .run_cmd ("sudo apt-get install -y g++-10 gfortran-10" )
429
+ host .run_cmd ("sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100" )
430
+ host .run_cmd ("sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100" )
431
+ host .run_cmd ("sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-10 100" )
432
+
425
433
426
434
def start_build (host : RemoteHost , * ,
427
435
branch = "master" ,
@@ -446,9 +454,9 @@ def start_build(host: RemoteHost, *,
446
454
# HACK: pypa gforntran.a is compiled without PIC, which leads to the following error
447
455
# libgfortran.a(error.o)(.text._gfortrani_st_printf+0x34): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `__stack_chk_guard@@GLIBC_2.17'
448
456
# Workaround by copying gfortran library from the host
449
- host .run_ssh_cmd ("sudo apt-get install -y gfortran-8 " )
450
- host .run_cmd ("mkdir -p /usr/lib/gcc/aarch64-linux-gnu/8 " )
451
- host .run_ssh_cmd (["docker" , "cp" , "/usr/lib/gcc/aarch64-linux-gnu/8 /libgfortran.a" ,
457
+ host .run_ssh_cmd ("sudo apt-get install -y gfortran-10 " )
458
+ host .run_cmd ("mkdir -p /usr/lib/gcc/aarch64-linux-gnu/10 " )
459
+ host .run_ssh_cmd (["docker" , "cp" , "/usr/lib/gcc/aarch64-linux-gnu/10 /libgfortran.a" ,
452
460
f"{ host .container_id } :/opt/rh/devtoolset-10/root/usr/lib/gcc/aarch64-redhat-linux/10/"
453
461
])
454
462
@@ -615,7 +623,7 @@ def parse_arguments():
615
623
parser .add_argument ("--instance-type" , type = str , default = "t4g.2xlarge" )
616
624
parser .add_argument ("--branch" , type = str , default = "master" )
617
625
parser .add_argument ("--use-docker" , action = "store_true" )
618
- parser .add_argument ("--compiler" , type = str , choices = ['gcc-7' , 'gcc-8' , 'gcc-9' , 'clang' ], default = "gcc-8" )
626
+ parser .add_argument ("--compiler" , type = str , choices = ['gcc-7' , 'gcc-8' , 'gcc-9' , 'gcc-10' , ' clang' ], default = "gcc-8" )
619
627
parser .add_argument ("--use-torch-from-pypi" , action = "store_true" )
620
628
return parser .parse_args ()
621
629
0 commit comments