Path: blob/master/ invest-robot-contest_TinkoffBotTwitch-main/venv/lib/python3.8/site-packages/numpy/distutils/intelccompiler.py
7757 views
import platform12from distutils.unixccompiler import UnixCCompiler3from numpy.distutils.exec_command import find_executable4from numpy.distutils.ccompiler import simple_version_match5if platform.system() == 'Windows':6from numpy.distutils.msvc9compiler import MSVCCompiler789class IntelCCompiler(UnixCCompiler):10"""A modified Intel compiler compatible with a GCC-built Python."""11compiler_type = 'intel'12cc_exe = 'icc'13cc_args = 'fPIC'1415def __init__(self, verbose=0, dry_run=0, force=0):16UnixCCompiler.__init__(self, verbose, dry_run, force)1718v = self.get_version()19mpopt = 'openmp' if v and v < '15' else 'qopenmp'20self.cc_exe = ('icc -fPIC -fp-model strict -O3 '21'-fomit-frame-pointer -{}').format(mpopt)22compiler = self.cc_exe2324if platform.system() == 'Darwin':25shared_flag = '-Wl,-undefined,dynamic_lookup'26else:27shared_flag = '-shared'28self.set_executables(compiler=compiler,29compiler_so=compiler,30compiler_cxx=compiler,31archiver='xiar' + ' cru',32linker_exe=compiler + ' -shared-intel',33linker_so=compiler + ' ' + shared_flag +34' -shared-intel')353637class IntelItaniumCCompiler(IntelCCompiler):38compiler_type = 'intele'3940# On Itanium, the Intel Compiler used to be called ecc, let's search for41# it (now it's also icc, so ecc is last in the search).42for cc_exe in map(find_executable, ['icc', 'ecc']):43if cc_exe:44break454647class IntelEM64TCCompiler(UnixCCompiler):48"""49A modified Intel x86_64 compiler compatible with a 64bit GCC-built Python.50"""51compiler_type = 'intelem'52cc_exe = 'icc -m64'53cc_args = '-fPIC'5455def __init__(self, verbose=0, dry_run=0, force=0):56UnixCCompiler.__init__(self, verbose, dry_run, force)5758v = self.get_version()59mpopt = 'openmp' if v and v < '15' else 'qopenmp'60self.cc_exe = ('icc -std=c99 -m64 -fPIC -fp-model strict -O3 '61'-fomit-frame-pointer -{}').format(mpopt)62compiler = self.cc_exe6364if platform.system() == 'Darwin':65shared_flag = '-Wl,-undefined,dynamic_lookup'66else:67shared_flag = '-shared'68self.set_executables(compiler=compiler,69compiler_so=compiler,70compiler_cxx=compiler,71archiver='xiar' + ' cru',72linker_exe=compiler + ' -shared-intel',73linker_so=compiler + ' ' + shared_flag +74' -shared-intel')757677if platform.system() == 'Windows':78class IntelCCompilerW(MSVCCompiler):79"""80A modified Intel compiler compatible with an MSVC-built Python.81"""82compiler_type = 'intelw'83compiler_cxx = 'icl'8485def __init__(self, verbose=0, dry_run=0, force=0):86MSVCCompiler.__init__(self, verbose, dry_run, force)87version_match = simple_version_match(start=r'Intel\(R\).*?32,')88self.__version = version_match8990def initialize(self, plat_name=None):91MSVCCompiler.initialize(self, plat_name)92self.cc = self.find_exe('icl.exe')93self.lib = self.find_exe('xilib')94self.linker = self.find_exe('xilink')95self.compile_options = ['/nologo', '/O3', '/MD', '/W3',96'/Qstd=c99']97self.compile_options_debug = ['/nologo', '/Od', '/MDd', '/W3',98'/Qstd=c99', '/Z7', '/D_DEBUG']99100class IntelEM64TCCompilerW(IntelCCompilerW):101"""102A modified Intel x86_64 compiler compatible with103a 64bit MSVC-built Python.104"""105compiler_type = 'intelemw'106107def __init__(self, verbose=0, dry_run=0, force=0):108MSVCCompiler.__init__(self, verbose, dry_run, force)109version_match = simple_version_match(start=r'Intel\(R\).*?64,')110self.__version = version_match111112113