Update distutils for openmp and new version of pip
This commit is contained in:
21
distutils.ext/obidistutils/command/build_exe.py
Executable file → Normal file
21
distutils.ext/obidistutils/command/build_exe.py
Executable file → Normal file
@ -6,12 +6,28 @@ Created on 20 oct. 2012
|
||||
|
||||
import os
|
||||
|
||||
from distutils import sysconfig
|
||||
from distutils.core import Command
|
||||
from distutils.sysconfig import customize_compiler
|
||||
from distutils.sysconfig import customize_compiler as customize_compiler_ori
|
||||
from distutils.errors import DistutilsSetupError
|
||||
from distutils import log
|
||||
from distutils.ccompiler import show_compilers
|
||||
|
||||
def customize_compiler(compiler):
|
||||
customize_compiler_ori(compiler)
|
||||
compilername = compiler.compiler[0]
|
||||
if ("gcc" in compilername or "g++" in compilername):
|
||||
cc_cmd = ' '.join(compiler.compiler + ['-fopenmp'])
|
||||
ccshared= ' '.join(x for x in sysconfig.get_config_vars("ccshared") if x is not None)
|
||||
|
||||
compiler.set_executables(
|
||||
compiler=cc_cmd,
|
||||
compiler_so=cc_cmd + ' ' + ccshared
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
class build_exe(Command):
|
||||
|
||||
description = "build an executable -- Abstract command "
|
||||
@ -80,6 +96,7 @@ class build_exe(Command):
|
||||
else:
|
||||
self.extra_compile_args.append('-m%s' % self.sse)
|
||||
|
||||
|
||||
# XXX same as for build_ext -- what about 'self.define' and
|
||||
# 'self.undef' ?
|
||||
|
||||
@ -96,7 +113,7 @@ class build_exe(Command):
|
||||
dry_run=self.dry_run,
|
||||
force=self.force)
|
||||
customize_compiler(self.compiler)
|
||||
|
||||
|
||||
if self.include_dirs is not None:
|
||||
self.compiler.set_include_dirs(self.include_dirs)
|
||||
if self.define is not None:
|
||||
|
Reference in New Issue
Block a user