本文整理汇总了Python中Cython.Distutils.build_ext.build_extensions方法的典型用法代码示例。如果您正苦于以下问题:Python build_ext.build_extensions方法的具体用法?Python build_ext.build_extensions怎么用?Python build_ext.build_extensions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cython.Distutils.build_ext
的用法示例。
在下文中一共展示了build_ext.build_extensions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: build_extensions
# 需要导入模块: from Cython.Distutils import build_ext [as 别名]
# 或者: from Cython.Distutils.build_ext import build_extensions [as 别名]
def build_extensions(self):
compiler = self.compiler.compiler_type
if compiler == 'msvc': # visual studio
for e in self.extensions:
e.extra_compile_args += ['/O2', '/openmp']
else:
for e in self.extensions:
e.extra_compile_args += ['-O3', '-march=native', '-fopenmp']
e.extra_link_args += ['-fopenmp']
if e.language == "c++":
e.extra_compile_args += ['-std=c++11']
### Remove this code if you have a mac with gcc or clang + openmp
if platform[:3] == "dar":
for e in self.extensions:
e.extra_compile_args = [arg for arg in e.extra_compile_args if arg != '-fopenmp']
e.extra_link_args = [arg for arg in e.extra_link_args if arg != '-fopenmp']
build_ext.build_extensions(self)
示例2: build_extensions
# 需要导入模块: from Cython.Distutils import build_ext [as 别名]
# 或者: from Cython.Distutils.build_ext import build_extensions [as 别名]
def build_extensions(self):
customize_compiler_for_nvcc(self.compiler)
build_ext.build_extensions(self)
示例3: build_extensions
# 需要导入模块: from Cython.Distutils import build_ext [as 别名]
# 或者: from Cython.Distutils.build_ext import build_extensions [as 别名]
def build_extensions(self):
build_ext.build_extensions(self)