From 61191f4fdef381e6c3a9a496a7ab33c5af3f2ad8 Mon Sep 17 00:00:00 2001 From: Spencer Kim Date: Tue, 29 Jun 2021 13:28:35 -0700 Subject: [PATCH] placeholder PiperOrigin-RevId: 382153430 --- perfkitbenchmarker/linux_packages/openblas.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/perfkitbenchmarker/linux_packages/openblas.py b/perfkitbenchmarker/linux_packages/openblas.py index 530cbd7e5b..cea4f7836a 100644 --- a/perfkitbenchmarker/linux_packages/openblas.py +++ b/perfkitbenchmarker/linux_packages/openblas.py @@ -14,6 +14,8 @@ """Module containing OpenBLAS installation and cleanup functions.""" +import logging +from perfkitbenchmarker import errors from perfkitbenchmarker import linux_packages OPENBLAS_DIR = '%s/OpenBLAS' % linux_packages.INSTALL_DIR @@ -27,7 +29,15 @@ def _Install(vm): vm.Install('fortran') vm.RemoteCommand('git clone {0} {1}'.format(GIT_REPO, OPENBLAS_DIR)) vm.RemoteCommand('cd {0} && git checkout {1}'.format(OPENBLAS_DIR, GIT_TAG)) - vm.RemoteCommand('cd {0} && make USE_THREAD=0'.format(OPENBLAS_DIR)) + try: + vm.RemoteCommand('cd {0} && make USE_THREAD=0'.format(OPENBLAS_DIR)) + except errors.VirtualMachine.RemoteCommandError as error: + if 'detecting cpu failed' in str(error).lower(): + logging.info('Attempting to recompile OpenBLAS with TARGET=SKYLAKEX') + vm.RemoteCommand( + 'cd {0} && make TARGET=SKYLAKEX USE_THREAD=0'.format(OPENBLAS_DIR)) + else: + raise error def YumInstall(vm):