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):