本文整理匯總了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)