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