예제 #1
0
파일: config.py 프로젝트: Cue/htmltotext
 def _check_compiler(self):
     du_config._check_compiler(self)
     try:
         self.compiler.compiler_so.remove('-Wstrict-prototypes')
         self.compiler.compiler_so.remove('-Wall')
     except (AttributeError, ValueError):
         pass
예제 #2
0
    def _check_compiler(self):
        old_config._check_compiler(self)
        from numpy.distutils.fcompiler import FCompiler, new_fcompiler

        if sys.platform == 'win32' and self.compiler.compiler_type == 'msvc':
            # XXX: hack to circumvent a python 2.6 bug with msvc9compiler:
            # initialize call query_vcvarsall, which throws an IOError, and
            # causes an error along the way without much information. We try to
            # catch it here, hoping it is early enough, and print an helpful
            # message instead of Error: None.
            if not self.compiler.initialized:
                try:
                    self.compiler.initialize()
                except IOError, e:
                    msg = """\
Could not initialize compiler instance: do you have Visual Studio
installed ? If you are trying to build with mingw, please use python setup.py
build -c mingw32 instead ). If you have Visual Studio installed, check it is
correctly installed, and the right version (VS 2008 for python 2.6, VS 2003 for
2.5, etc...). Original exception was: %s, and the Compiler
class was %s
============================================================================""" \
                        % (e, self.compiler.__class__.__name__)
                    print """\
============================================================================"""
                    raise distutils.errors.DistutilsPlatformError(msg)
예제 #3
0
    def _check_compiler (self):
        old_config._check_compiler(self)
        from numpy.distutils.fcompiler import FCompiler, new_fcompiler

        if sys.platform == 'win32' and self.compiler.compiler_type == 'msvc':
            # XXX: hack to circumvent a python 2.6 bug with msvc9compiler:
            # initialize call query_vcvarsall, which throws an IOError, and
            # causes an error along the way without much information. We try to
            # catch it here, hoping it is early enough, and print an helpful
            # message instead of Error: None.
            if not self.compiler.initialized:
                try:
                    self.compiler.initialize()
                except IOError, e:
                    msg = """\
Could not initialize compiler instance: do you have Visual Studio
installed ? If you are trying to build with mingw, please use python setup.py
build -c mingw32 instead ). If you have Visual Studio installed, check it is
correctly installed, and the right version (VS 2008 for python 2.6, VS 2003 for
2.5, etc...). Original exception was: %s, and the Compiler
class was %s
============================================================================""" \
                        % (e, self.compiler.__class__.__name__)
                    print """\
============================================================================"""
                    raise distutils.errors.DistutilsPlatformError(msg)
예제 #4
0
    def _check_compiler(self):
        old_config._check_compiler(self)
        from numpy.distutils.fcompiler import FCompiler, new_fcompiler

        if sys.platform == "win32" and (
            self.compiler.compiler_type in ("msvc", "intelw", "intelemw")
        ):
            # XXX: hack to circumvent a python 2.6 bug with msvc9compiler:
            # initialize call query_vcvarsall, which throws an IOError, and
            # causes an error along the way without much information. We try to
            # catch it here, hoping it is early enough, and print an helpful
            # message instead of Error: None.
            if not self.compiler.initialized:
                try:
                    self.compiler.initialize()
                except IOError:
                    e = get_exception()
                    msg = """\
Could not initialize compiler instance: do you have Visual Studio
installed?  If you are trying to build with MinGW, please use "python setup.py
build -c mingw32" instead.  If you have Visual Studio installed, check it is
correctly installed, and the right version (VS 2008 for python 2.6, 2.7 and 3.2,
VS 2010 for >= 3.3).

Original exception was: %s, and the Compiler class was %s
============================================================================""" % (
                        e,
                        self.compiler.__class__.__name__,
                    )
                    print(
                        """\
============================================================================"""
                    )
                    raise distutils.errors.DistutilsPlatformError(msg)

            # After MSVC is initialized, add an explicit /MANIFEST to linker
            # flags.  See issues gh-4245 and gh-4101 for details.  Also
            # relevant are issues 4431 and 16296 on the Python bug tracker.
            from distutils import msvc9compiler

            if msvc9compiler.get_build_version() >= 10:
                for ldflags in [
                    self.compiler.ldflags_shared,
                    self.compiler.ldflags_shared_debug,
                ]:
                    if "/MANIFEST" not in ldflags:
                        ldflags.append("/MANIFEST")

        if not isinstance(self.fcompiler, FCompiler):
            self.fcompiler = new_fcompiler(
                compiler=self.fcompiler,
                dry_run=self.dry_run,
                force=1,
                c_compiler=self.compiler,
            )
            if self.fcompiler is not None:
                self.fcompiler.customize(self.distribution)
                if self.fcompiler.get_version():
                    self.fcompiler.customize_cmd(self)
                    self.fcompiler.show_customization()
예제 #5
0
 def _check_compiler(self):
     du_config._check_compiler(self)
     try:
         self.compiler.compiler_so.remove('-Wstrict-prototypes')
         self.compiler.compiler_so.remove('-Wall')
     except (AttributeError, ValueError):
         pass
예제 #6
0
 def _check_compiler (self):
     old_config._check_compiler(self)
     from numpy.distutils.fcompiler import FCompiler, new_fcompiler
     if not isinstance(self.fcompiler, FCompiler):
         self.fcompiler = new_fcompiler(compiler=self.fcompiler,
                                        dry_run=self.dry_run, force=1)
         self.fcompiler.customize(self.distribution)
         self.fcompiler.customize_cmd(self)
         self.fcompiler.show_customization()
예제 #7
0
파일: config.py 프로젝트: kidaa/pyparallel
    def _check_compiler(self):
        old_config._check_compiler(self)
        from numpy.distutils.fcompiler import FCompiler, new_fcompiler

        if sys.platform == "win32" and self.compiler.compiler_type == "msvc":
            # XXX: hack to circumvent a python 2.6 bug with msvc9compiler:
            # initialize call query_vcvarsall, which throws an IOError, and
            # causes an error along the way without much information. We try to
            # catch it here, hoping it is early enough, and print an helpful
            # message instead of Error: None.
            if not self.compiler.initialized:
                try:
                    self.compiler.initialize()
                except IOError:
                    e = get_exception()
                    msg = """\
Could not initialize compiler instance: do you have Visual Studio
installed?  If you are trying to build with MinGW, please use "python setup.py
build -c mingw32" instead.  If you have Visual Studio installed, check it is
correctly installed, and the right version (VS 2008 for python 2.6, 2.7 and 3.2,
VS 2010 for >= 3.3).

Original exception was: %s, and the Compiler class was %s
============================================================================""" % (
                        e,
                        self.compiler.__class__.__name__,
                    )
                    print(
                        """\
============================================================================"""
                    )
                    raise distutils.errors.DistutilsPlatformError(msg)

            # After MSVC is initialized, add an explicit /MANIFEST to linker
            # flags.  See issues gh-4245 and gh-4101 for details.  Also
            # relevant are issues 4431 and 16296 on the Python bug tracker.
            from distutils import msvc9compiler

            if msvc9compiler.get_build_version() >= 10:
                for ldflags in [self.compiler.ldflags_shared, self.compiler.ldflags_shared_debug]:
                    if "/MANIFEST" not in ldflags:
                        ldflags.append("/MANIFEST")
                    if "/DEBUG" not in ldflags:
                        ldflags.append("/DEBUG")
                    if "/pdb:None" in ldflags:
                        ldflags.remove("/pdb:None")

        if not isinstance(self.fcompiler, FCompiler):
            self.fcompiler = new_fcompiler(
                compiler=self.fcompiler, dry_run=self.dry_run, force=1, c_compiler=self.compiler
            )
            if self.fcompiler is not None:
                self.fcompiler.customize(self.distribution)
                if self.fcompiler.get_version():
                    self.fcompiler.customize_cmd(self)
                    self.fcompiler.show_customization()
예제 #8
0
 def _check_compiler(self):
     old_config._check_compiler(self)
     from numpy.distutils.fcompiler import FCompiler, new_fcompiler
     if not isinstance(self.fcompiler, FCompiler):
         self.fcompiler = new_fcompiler(compiler=self.fcompiler,
                                        dry_run=self.dry_run,
                                        force=1)
         self.fcompiler.customize(self.distribution)
         self.fcompiler.customize_cmd(self)
         self.fcompiler.show_customization()