<s> """<STR_LIT>""" <EOL> import sys <EOL> from distutils . command . build_ext import build_ext <EOL> __all__ = [ '<STR_LIT>' ] <EOL> def openmp_ext ( default = True ) : <EOL> """<STR_LIT>""" <EOL> with_openmp = default <EOL> if '<STR_LIT>' in sys . argv : <EOL> with_openmp = True <EOL> sys . argv . remove ( '<STR_LIT>' ) <EOL> elif '<STR_LIT>' in sys . argv : <EOL> with_openmp = False <EOL> sys . argv . remove ( '<STR_LIT>' ) <EOL> if not with_openmp : <EOL> return build_ext <EOL> compile_opts = { <EOL> '<STR_LIT>' : [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' : [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' : [ '<STR_LIT>' ] , <EOL> } <EOL> link_opts = { <EOL> '<STR_LIT>' : [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' : [ '<STR_LIT>' ] , <EOL> } <EOL> class OpenMPExt ( build_ext ) : <EOL> def build_extensions ( self ) : <EOL> c = self . compiler . compiler_type <EOL> if c in compile_opts : <EOL> for e in self . extensions : <EOL> e . extra_compile_args = compile_opts [ c ] <EOL> if c in link_opts : <EOL> for e in self . extensions : <EOL> e . extra_link_args = link_opts [ c ] <EOL> build_ext . build_extensions ( self ) <EOL> return OpenMPExt </s>
