Example #1
0
 def __init__(self, verbose=0, dry_run=0, force=0):
     UnixCCompiler.__init__(self, verbose, dry_run, force)
     status, details = check_config_h()
     self.debug_print("Python's GCC status: %s (details: %s)" % (status, details))
     if status is not CONFIG_H_OK:
         self.warn(
             "Python's pyconfig.h doesn't seem to support your compiler. Reason: %s. Compiling may fail because of undefined preprocessor macros."
             % details
         )
     self.gcc_version, self.ld_version, self.dllwrap_version = get_versions()
     self.debug_print(
         self.compiler_type
         + ": gcc %s, ld %s, dllwrap %s\n" % (self.gcc_version, self.ld_version, self.dllwrap_version)
     )
     if self.ld_version >= "2.10.90":
         self.linker_dll = "gcc"
     else:
         self.linker_dll = "dllwrap"
     if self.ld_version >= "2.13":
         shared_option = "-shared"
     else:
         shared_option = "-mdll -static"
     self.set_executables(
         compiler="gcc -mcygwin -O -Wall",
         compiler_so="gcc -mcygwin -mdll -O -Wall",
         compiler_cxx="g++ -mcygwin -O -Wall",
         linker_exe="gcc -mcygwin",
         linker_so="%s -mcygwin %s" % (self.linker_dll, shared_option),
     )
     if self.gcc_version == "2.91.57":
         self.dll_libraries = ["msvcrt"]
         self.warn("Consider upgrading to a newer version of gcc")
     else:
         self.dll_libraries = get_msvcr()
    def __init__ (self,
                  verbose=0,
                  dry_run=0,
                  force=0):

        UnixCCompiler.__init__ (self, verbose, dry_run, force)

        (status, details) = check_config_h()
        self.debug_print("Python's GCC status: %s (details: %s)" %
                         (status, details))
        if status is not CONFIG_H_OK:
            self.warn(
                "Python's pyconfig.h doesn't seem to support your compiler.  " +
                ("Reason: %s." % details) +
                "Compiling may fail because of undefined preprocessor macros.")

        (self.gcc_version, self.ld_version) = \
            get_versions()
        self.debug_print(self.compiler_type + ": gcc %s, ld %s\n" %
                         (self.gcc_version,
                          self.ld_version) )

        # Hard-code GCC because that's what this is all about.
        # XXX optimization, warnings etc. should be customizable.
        self.set_executables(compiler='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
                             compiler_so='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
                             linker_exe='gcc -Zomf -Zmt -Zcrtdll',
                             linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll')

        # want the gcc library statically linked (so that we don't have
        # to distribute a version dependent on the compiler we have)
        self.dll_libraries=["gcc"]
 def __init__ (self, verbose=0, dry_run=0, force=0):
     UnixCCompiler.__init__ (self, verbose,dry_run, force)
     compiler = self.cc_exe
     self.set_executables(compiler=compiler,
                          compiler_so=compiler,
                          compiler_cxx=compiler,
                          linker_exe=compiler,
                          linker_so=compiler + ' -shared')
Example #4
0
 def __init__ (self, verbose=0, dry_run=0, force=0):
     UnixCCompiler.__init__ (self, verbose, dry_run, force)
     cc = 'icc'
     self.set_executables(compiler=cc,
                          compiler_so=cc,
                          compiler_cxx=cc,
                          linker_exe=cc,
                          linker_so=cc + ' -shared')
Example #5
0
 def __init__(self):
     # Check to ensure that nvcc can be located
     try:
         subprocess.check_output('nvcc --help', shell=True)
     except CalledProcessError:
         print >> sys.stderr, 'Could not find nvcc, the nvidia cuda compiler'
         sys.exit(1)
     UnixCCompiler.__init__(self)
    def __init__(self, verbose=0, dry_run=0, force=0):

        UnixCCompiler.__init__(self, verbose, dry_run, force)

        status, details = check_config_h()
        self.debug_print("Python's GCC status: %s (details: %s)" %
                         (status, details))
        if status is not CONFIG_H_OK:
            self.warn(
                "Python's pyconfig.h doesn't seem to support your compiler. "
                "Reason: %s. "
                "Compiling may fail because of undefined preprocessor macros."
                % details)

        self.gcc_version, self.ld_version, self.dllwrap_version = \
            get_versions()
        self.debug_print(self.compiler_type + ": gcc %s, ld %s, dllwrap %s\n" %
                         (self.gcc_version,
                          self.ld_version,
                          self.dllwrap_version) )

        # ld_version >= "2.10.90" and < "2.13" should also be able to use
        # gcc -mdll instead of dllwrap
        # Older dllwraps had own version numbers, newer ones use the
        # same as the rest of binutils ( also ld )
        # dllwrap 2.10.90 is buggy
        if self.ld_version >= "2.10.90":
            self.linker_dll = "gcc"
        else:
            self.linker_dll = "dllwrap"

        # ld_version >= "2.13" support -shared so use it instead of
        # -mdll -static
        if self.ld_version >= "2.13":
            shared_option = "-shared"
        else:
            shared_option = "-mdll -static"

        # Hard-code GCC because that's what this is all about.
        # XXX optimization, warnings etc. should be customizable.
        self.set_executables(compiler='gcc -mcygwin -O -Wall',
                             compiler_so='gcc -mcygwin -mdll -O -Wall',
                             compiler_cxx='g++ -mcygwin -O -Wall',
                             linker_exe='gcc -mcygwin',
                             linker_so=('%s -mcygwin %s' %
                                        (self.linker_dll, shared_option)))

        # cygwin and mingw32 need different sets of libraries
        if self.gcc_version == "2.91.57":
            # cygwin shouldn't need msvcrt, but without the dlls will crash
            # (gcc version 2.91.57) -- perhaps something about initialization
            self.dll_libraries=["msvcrt"]
            self.warn(
                "Consider upgrading to a newer version of gcc")
        else:
            # Include the appropriate MSVC runtime library if Python was built
            # with MSVC 7.0 or later.
            self.dll_libraries = get_msvcr()
Example #7
0
 def __init__ (self, verbose=0, dry_run=0, force=0):
     UnixCCompiler.__init__ (self, verbose, dry_run, force)
     self.cc_exe = 'icc -fPIC'
     compiler = self.cc_exe
     self.set_executables(compiler=compiler,
                          compiler_so=compiler,
                          compiler_cxx=compiler,
                          linker_exe=compiler,
                          linker_so=compiler + ' -shared')
    def __init__(self, verbose=0, dry_run=0, force=0):

        UnixCCompiler.__init__(self, verbose, dry_run, force)

        status, details = check_config_h()
        self.debug_print("Python's GCC status: %s (details: %s)" % (status, details))
        if status is not CONFIG_H_OK:
            self.warn(
                "Python's pyconfig.h doesn't seem to support your compiler. "
                "Reason: %s. "
                "Compiling may fail because of undefined preprocessor macros." % details
            )

        self.gcc_version, self.ld_version, self.dllwrap_version = get_versions()
        self.debug_print(
            self.compiler_type
            + ": gcc %s, ld %s, dllwrap %s\n"
            % (self.gcc_version, self.ld_version, self.dllwrap_version)
        )

        # ld_version >= "2.10.90" and < "2.13" should also be able to use
        # gcc -mdll instead of dllwrap
        # Older dllwraps had own version numbers, newer ones use the
        # same as the rest of binutils ( also ld )
        # dllwrap 2.10.90 is buggy
        if self.ld_version >= "2.10.90":
            self.linker_dll = "gcc"
        else:
            self.linker_dll = "dllwrap"

        # ld_version >= "2.13" support -shared so use it instead of
        # -mdll -static
        if self.ld_version >= "2.13":
            shared_option = "-shared"
        else:
            shared_option = "-mdll -static"

        # Hard-code GCC because that's what this is all about.
        # XXX optimization, warnings etc. should be customizable.
        self.set_executables(
            compiler="gcc -mcygwin -O -Wall",
            compiler_so="gcc -mcygwin -mdll -O -Wall",
            compiler_cxx="g++ -mcygwin -O -Wall",
            linker_exe="gcc -mcygwin",
            linker_so=("%s -mcygwin %s" % (self.linker_dll, shared_option)),
        )

        # cygwin and mingw32 need different sets of libraries
        if self.gcc_version == "2.91.57":
            # cygwin shouldn't need msvcrt, but without the dlls will crash
            # (gcc version 2.91.57) -- perhaps something about initialization
            self.dll_libraries = ["msvcrt"]
            self.warn("Consider upgrading to a newer version of gcc")
        else:
            # Include the appropriate MSVC runtime library if Python was built
            # with MSVC 7.0 or later.
            self.dll_libraries = get_msvcr()
Example #9
0
 def __init__(self, verbose=0, dry_run=0, force=0):
     UnixCCompiler.__init__(self, verbose, dry_run, force)
     cc_compiler = self.cc_exe
     cxx_compiler = self.cxx_exe
     self.set_executables(compiler=cc_compiler + ' -O3 -fPIC',
                          compiler_so=cc_compiler + ' -O3 -fPIC',
                          compiler_cxx=cxx_compiler + ' -O3 -fPIC',
                          linker_exe=cc_compiler + ' -lamath',
                          linker_so=cc_compiler + ' -lamath -shared')
Example #10
0
 def __init__ (self, verbose=0, dry_run=0, force=0):
     UnixCCompiler.__init__ (self, verbose,dry_run, force)
     self.cc_exe = 'icc -O3 -fPIC -fp-model strict -fomit-frame-pointer -openmp -xHost -w '
     compiler = self.cc_exe
     self.set_executables(compiler=compiler,
                          compiler_so=compiler,
                          compiler_cxx=compiler,
                          linker_exe=compiler,
                          linker_so=compiler + ' -shared')
Example #11
0
 def __init__(self, verbose=0, dry_run=0, force=0):
     UnixCCompiler.__init__(self, verbose, dry_run, force)
     self.cc_exe = 'icc -m64 -fPIC'
     compiler = self.cc_exe
     self.set_executables(compiler=compiler,
                          compiler_so=compiler,
                          compiler_cxx=compiler,
                          archiver='xiar' + ' cru',
                          linker_exe=compiler,
                          linker_so=compiler + ' -shared')
Example #12
0
 def __init__(self, verbose = 0, dry_run = 0, force = 0):
     UnixCCompiler.__init__(self, verbose, dry_run, force)
     status, details = check_config_h()
     self.debug_print("Python's GCC status: %s (details: %s)" % (status, details))
     if status is not CONFIG_H_OK:
         self.warn("Python's pyconfig.h doesn't seem to support your compiler.  " + 'Reason: %s.' % details + 'Compiling may fail because of undefined preprocessor macros.')
     self.gcc_version, self.ld_version = get_versions()
     self.debug_print(self.compiler_type + ': gcc %s, ld %s\n' % (self.gcc_version, self.ld_version))
     self.set_executables(compiler='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall', compiler_so='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall', linker_exe='gcc -Zomf -Zmt -Zcrtdll', linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll')
     self.dll_libraries = ['gcc']
Example #13
0
 def __init__(self, verbose = 0, dry_run = 0, force = 0):
     UnixCCompiler.__init__(self, verbose, dry_run, force)
     status, details = check_config_h()
     self.debug_print("Python's GCC status: %s (details: %s)" % (status, details))
     if status is not CONFIG_H_OK:
         self.warn("Python's pyconfig.h doesn't seem to support your compiler.  " + 'Reason: %s.' % details + 'Compiling may fail because of undefined preprocessor macros.')
     self.gcc_version, self.ld_version = get_versions()
     self.debug_print(self.compiler_type + ': gcc %s, ld %s\n' % (self.gcc_version, self.ld_version))
     self.set_executables(compiler='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall', compiler_so='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall', linker_exe='gcc -Zomf -Zmt -Zcrtdll', linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll')
     self.dll_libraries = ['gcc']
Example #14
0
 def __init__(self, verbose=0, dry_run=0, force=0):
     UnixCCompiler.__init__(self, verbose, dry_run, force)
     cc_compiler = self.cc_exe
     cxx_compiler = self.cxx_exe
     self.set_executables(
         compiler=cc_compiler,
         compiler_so=cc_compiler,
         compiler_cxx=cxx_compiler,
         linker_exe=cc_compiler,
         linker_so=cc_compiler + " -shared",
     )
 def __init__(self, verbose=0, dry_run=0, force=0):
     UnixCCompiler.__init__(self, verbose, dry_run, force)
     self.cc_exe = ('icc -m64 -fPIC -fp-model strict -O3 '
                    '-fomit-frame-pointer -openmp -xSSE4.2')
     compiler = self.cc_exe
     self.set_executables(compiler=compiler,
                          compiler_so=compiler,
                          compiler_cxx=compiler,
                          archiver='xiar' + ' cru',
                          linker_exe=compiler + ' -shared-intel',
                          linker_so=compiler + ' -shared -shared-intel')
Example #16
0
 def __init__(self, verbose=0, dry_run=0, force=0):
     UnixCCompiler.__init__(self, verbose, dry_run, force)
     self.cc_exe = ('icc -m64 -fPIC -fp-model strict -O3 '
                    '-fomit-frame-pointer -openmp -xSSE4.2')
     compiler = self.cc_exe
     self.set_executables(compiler=compiler,
                          compiler_so=compiler,
                          compiler_cxx=compiler,
                          archiver='xiar' + ' cru',
                          linker_exe=compiler + ' -shared-intel',
                          linker_so=compiler + ' -shared -shared-intel')
Example #17
0
 def __init__(self, verbose=0, dry_run=0, force=0):
     UnixCCompiler.__init__(self, verbose, dry_run, force)
     self.cc_exe = ('icc -m64 -fPIC -fp-model strict -O3 '
                    '-fomit-frame-pointer -openmp -xSSE4.2')
     compiler = self.cc_exe
     if platform.system() == 'Darwin':
         shared_flag = '-Wl,-undefined,dynamic_lookup'
     else:
         shared_flag = '-shared'
     self.set_executables(compiler=compiler,
                          compiler_so=compiler,
                          compiler_cxx=compiler,
                          archiver='xiar' + ' cru',
                          linker_exe=compiler + ' -shared-intel',
                          linker_so=compiler + ' ' + shared_flag +
                          ' -shared-intel')
 def __init__(self, verbose=0, dry_run=0, force=0):
     UnixCCompiler.__init__(self, verbose, dry_run, force)
     self.cc_exe = ('icc -m64 -fPIC -fp-model strict -O3 '
                    '-fomit-frame-pointer -openmp')
     compiler = self.cc_exe
     if platform.system() == 'Darwin':
         shared_flag = '-Wl,-undefined,dynamic_lookup'
     else:
         shared_flag = '-shared'
     self.set_executables(compiler=compiler,
                          compiler_so=compiler,
                          compiler_cxx=compiler,
                          archiver='xiar' + ' cru',
                          linker_exe=compiler + ' -shared-intel',
                          linker_so=compiler + ' ' + shared_flag +
                          ' -shared-intel')
Example #19
0
    def __init__(self, verbose=0, dry_run=0, force=0):

        UnixCCompiler.__init__(self, verbose, dry_run, force)

        (status, details) = check_config_h()
        self.debug_print("Python's GCC status: %s (details: %s)" %
                         (status, details))
        if status is not CONFIG_H_OK:
            self.warn(
                "Python's config.h doesn't seem to support your compiler.  " +
                ("Reason: %s." % details) +
                "Compiling may fail because of undefined preprocessor macros.")

        (self.gcc_version, self.ld_version, self.dllwrap_version) = \
            get_versions()
        self.debug_print(
            self.compiler_type + ": gcc %s, ld %s, dllwrap %s\n" %
            (self.gcc_version, self.ld_version, self.dllwrap_version))

        # ld_version >= "2.10.90" should also be able to use
        # gcc -mdll instead of dllwrap
        # Older dllwraps had own version numbers, newer ones use the
        # same as the rest of binutils ( also ld )
        # dllwrap 2.10.90 is buggy
        if self.ld_version >= "2.10.90":
            self.linker = "gcc"
        else:
            self.linker = "dllwrap"

        # Hard-code GCC because that's what this is all about.
        # XXX optimization, warnings etc. should be customizable.
        self.set_executables(compiler='gcc -mcygwin -O -Wall',
                             compiler_so='gcc -mcygwin -mdll -O -Wall',
                             linker_exe='gcc -mcygwin',
                             linker_so=('%s -mcygwin -mdll -static' %
                                        self.linker))

        # cygwin and mingw32 need different sets of libraries
        if self.gcc_version == "2.91.57":
            # cygwin shouldn't need msvcrt, but without the dlls will crash
            # (gcc version 2.91.57) -- perhaps something about initialization
            self.dll_libraries = ["msvcrt"]
            self.warn("Consider upgrading to a newer version of gcc")
        else:
            self.dll_libraries = []
Example #20
0
 def __init__(self, verbose=0, dry_run=0, force=0):
     UnixCCompiler.__init__(self, verbose, dry_run, force)
     self.cc_exe = ('icc -fPIC -fp-model precise -O3 '
                    '-fomit-frame-pointer -qopenmp '
                    '-Wall -Wimplicit '
                    '-qoffload-option,mic,compiler,'
                    '\'"-fp-model fast=2 -Wl,-zdefs"\'')
     compiler = self.cc_exe
     if platform.system() == 'Darwin':
         shared_flag = '-Wl,-undefined,dynamic_lookup'
     else:
         shared_flag = '-shared'
     self.set_executables(compiler=compiler,
                          compiler_so=compiler,
                          compiler_cxx=compiler,
                          archiver='xiar' + ' cru',
                          linker_exe=compiler + ' -shared-intel',
                          linker_so=compiler + ' ' + shared_flag +
                          ' -shared-intel')
Example #21
0
    def __init__(self, verbose=0, dry_run=0, force=0):

        UnixCCompiler.__init__(self, verbose, dry_run, force)

        (status, details) = check_config_h()
        self.debug_print("Python's GCC status: %s (details: %s)" %
                         (status, details))
        if status is not CONFIG_H_OK:
            self.warn(
                "Python's pyconfig.h doesn't seem to support your compiler. "
                "Reason: %s. "
                "Compiling may fail because of undefined preprocessor macros."
                % details)

        # want the gcc library statically linked (so that we don't have
        # to distribute a version dependent on the compiler we have)
        # self.dll_libraries=["gcc"]
        # was removed by the python 3.9 update, as I doubt it makes sense
        self.dll_libraries = []
Example #22
0
    def __init__ (self, verbose=0, dry_run=0, force=0):
        UnixCCompiler.__init__ (self, verbose, dry_run, force)
        cc = 'clang'

        cflags = sysconfig.get_config_var ('CFLAGS') or ""
        cflags += os.getenv('CFLAGS', '')
        cshared = sysconfig.get_config_var ('CCSHARED') or ""
        ldflags = sysconfig.get_config_var ('LDFLAGS') or ""
        ldflags += os.getenv('LDFLAGS', '')
        cppflags = os.getenv ('CPPFLAGS', '')

        cargs = ' ' + cflags + ' ' + cppflags
        soargs = ' ' + cflags + ' ' + cshared
        ldargs = ' ' + ldflags
        
        self.set_executables(compiler=cc + cargs,
                             compiler_so=cc + soargs,
                             compiler_cxx=cc,
                             linker_exe=cc + ldflags,
                             linker_so=cc + ' -shared')
Example #23
0
    def __init__(self, verbose=0, dry_run=0, force=0):
        UnixCCompiler.__init__(self, verbose, dry_run, force)

        v = self.get_version()
        self.cc_exe = ('icc -fPIC -fp-model strict -O3 -fomit-frame-pointer ' +
                       environ.get('CFLAGS', '').strip())
        compiler = self.cc_exe

        if platform.system() == 'Darwin':
            shared_flag = '-Wl,-undefined,dynamic_lookup'
        else:
            shared_flag = '-shared'
        self.set_executables(compiler=compiler,
                             compiler_so=compiler,
                             compiler_cxx=compiler,
                             archiver='xiar' + ' cru',
                             linker_exe=compiler + ' -shared-intel',
                             linker_so=compiler + ' ' + shared_flag +
                             ' -shared-intel ' +
                             environ.get('LDFLAGS', '').strip())
Example #24
0
    def __init__(self, verbose=0, dry_run=0, force=0):
        UnixCCompiler.__init__(self, verbose, dry_run, force)

        v = self.get_version()
        mpopt = 'openmp' if v and v < '15' else 'qopenmp'
        self.cc_exe = ('icc -fPIC -fp-model strict -O3 '
                       '-fomit-frame-pointer -{}').format(mpopt)
        compiler = self.cc_exe

        if platform.system() == 'Darwin':
            shared_flag = '-Wl,-undefined,dynamic_lookup'
        else:
            shared_flag = '-shared'
        self.set_executables(compiler=compiler,
                             compiler_so=compiler,
                             compiler_cxx=compiler,
                             archiver='xiar' + ' cru',
                             linker_exe=compiler + ' -shared-intel',
                             linker_so=compiler + ' ' + shared_flag +
                             ' -shared-intel')
Example #25
0
    def __init__(self, verbose=0, dry_run=0, force=0):
        UnixCCompiler.__init__(self, verbose, dry_run, force)

        v = self.get_version()
        mpopt = "openmp" if v and v < "15" else "qopenmp"
        self.cc_exe = ("icc -m64 -fPIC -fp-model strict -O3 "
                       "-fomit-frame-pointer -{}").format(mpopt)
        compiler = self.cc_exe

        if platform.system() == "Darwin":
            shared_flag = "-Wl,-undefined,dynamic_lookup"
        else:
            shared_flag = "-shared"
        self.set_executables(
            compiler=compiler,
            compiler_so=compiler,
            compiler_cxx=compiler,
            archiver="xiar" + " cru",
            linker_exe=compiler + " -shared-intel",
            linker_so=compiler + " " + shared_flag + " -shared-intel",
        )
 def __init__(self, verbose = 0, dry_run = 0, force = 0):
     UnixCCompiler.__init__(self, verbose, dry_run, force)
     status, details = check_config_h()
     self.debug_print("Python's GCC status: %s (details: %s)" % (status, details))
     if status is not CONFIG_H_OK:
         self.warn("Python's pyconfig.h doesn't seem to support your compiler. Reason: %s. Compiling may fail because of undefined preprocessor macros." % details)
     self.gcc_version, self.ld_version, self.dllwrap_version = get_versions()
     self.debug_print(self.compiler_type + ': gcc %s, ld %s, dllwrap %s\n' % (self.gcc_version, self.ld_version, self.dllwrap_version))
     if self.ld_version >= '2.10.90':
         self.linker_dll = 'gcc'
     else:
         self.linker_dll = 'dllwrap'
     if self.ld_version >= '2.13':
         shared_option = '-shared'
     else:
         shared_option = '-mdll -static'
     self.set_executables(compiler='gcc -mcygwin -O -Wall', compiler_so='gcc -mcygwin -mdll -O -Wall', compiler_cxx='g++ -mcygwin -O -Wall', linker_exe='gcc -mcygwin', linker_so='%s -mcygwin %s' % (self.linker_dll, shared_option))
     if self.gcc_version == '2.91.57':
         self.dll_libraries = ['msvcrt']
         self.warn('Consider upgrading to a newer version of gcc')
     else:
         self.dll_libraries = get_msvcr()
Example #27
0
 def __init__(self, verbose = 0, dry_run = 0, force = 0):
     UnixCCompiler.__init__(self, verbose, dry_run, force)
     status, details = check_config_h()
     self.debug_print("Python's GCC status: %s (details: %s)" % (status, details))
     if status is not CONFIG_H_OK:
         self.warn("Python's pyconfig.h doesn't seem to support your compiler. Reason: %s. Compiling may fail because of undefined preprocessor macros." % details)
     self.gcc_version, self.ld_version, self.dllwrap_version = get_versions()
     self.debug_print(self.compiler_type + ': gcc %s, ld %s, dllwrap %s\n' % (self.gcc_version, self.ld_version, self.dllwrap_version))
     if self.ld_version >= '2.10.90':
         self.linker_dll = 'gcc'
     else:
         self.linker_dll = 'dllwrap'
     if self.ld_version >= '2.13':
         shared_option = '-shared'
     else:
         shared_option = '-mdll -static'
     self.set_executables(compiler='gcc -mcygwin -O -Wall', compiler_so='gcc -mcygwin -mdll -O -Wall', compiler_cxx='g++ -mcygwin -O -Wall', linker_exe='gcc -mcygwin', linker_so='%s -mcygwin %s' % (self.linker_dll, shared_option))
     if self.gcc_version == '2.91.57':
         self.dll_libraries = ['msvcrt']
         self.warn('Consider upgrading to a newer version of gcc')
     else:
         self.dll_libraries = get_msvcr()
Example #28
0
    def __init__(self, verbose=0, dry_run=0, force=0):
        try:
            import tinycc
        except ImportError:
            DistutilsPlatformError(
                "tinycc not installed or not supported for this platform")

        UnixCCompiler.__init__(self, verbose, dry_run, force)

        status, details = check_config_h()
        self.debug_print("Python's GCC status: %s (details: %s)" %
                         (status, details))
        if status is not CONFIG_H_OK:
            self.warn(
                "Python's pyconfig.h doesn't seem to support your compiler. "
                "Reason: %s. "
                "Compiling may fail because of undefined preprocessor macros."
                % details)

        self.tcc_version = _find_exe_version([tinycc.TCC, '-v'])
        self.debug_print(self.compiler_type + ": tcc %s\n" % self.tcc_version)

        self.set_executables(
            compiler=[tinycc.TCC, '-DMS_WIN64', '-D__TINYCC__', '-Wall'],
            compiler_so=[tinycc.TCC, '-DMS_WIN64', '-D__TINYCC__', '-Wall'],
            compiler_cxx=[],
            linker_exe=[tinycc.TCC],
            linker_so=[tinycc.TCC, '-shared'],
        )

        # Include the appropriate MSVC runtime library if Python was built
        # with MSVC 7.0 or later.
        if os.name == 'nt':
            self.dll_libraries = get_msvcr()
        else:
            self.dll_libraries = []
Example #29
0
    def __init__(self, verbose=0, dry_run=0, force=0):
        try:
            import tinycc
        except ImportError:
            DistutilsPlatformError("tinycc not installed or not supported for this platform")


        UnixCCompiler.__init__(self, verbose, dry_run, force)

        status, details = check_config_h()
        self.debug_print("Python's GCC status: %s (details: %s)" %
                         (status, details))
        if status is not CONFIG_H_OK:
            self.warn(
                "Python's pyconfig.h doesn't seem to support your compiler. "
                "Reason: %s. "
                "Compiling may fail because of undefined preprocessor macros."
                % details)

        self.tcc_version = _find_exe_version([tinycc.TCC, '-v'])
        self.debug_print(self.compiler_type + ": tcc %s\n" % self.tcc_version)

        self.set_executables(
            compiler=[tinycc.TCC, '-DMS_WIN64', '-D__TINYCC__', '-Wall'],
            compiler_so=[tinycc.TCC, '-DMS_WIN64', '-D__TINYCC__', '-Wall'],
            compiler_cxx=[],
            linker_exe=[tinycc.TCC],
            linker_so=[tinycc.TCC, '-shared'],
        )

        # Include the appropriate MSVC runtime library if Python was built
        # with MSVC 7.0 or later.
        if os.name == 'nt':
            self.dll_libraries = get_msvcr()
        else:
            self.dll_libraries = []
    def __init__(self, verbose=0, dry_run=0, force=0):

        UnixCCompiler.__init__(self, verbose, dry_run, force)
        self.set_executable("compiler", "nasm")
Example #31
0
    def __init__(self, verbose=0, dry_run=0, force=0):

        UnixCCompiler.__init__(self, verbose, dry_run, force)

        (status, details) = check_config_h()
        self.debug_print("Python's GCC status: %s (details: %s)" %
                         (status, details))
        if status is not CONFIG_H_OK:
            self.warn(
                "Python's pyconfig.h doesn't seem to support your compiler. "
                "Reason: %s. "
                "Compiling may fail because of undefined preprocessor macros."
                % details)

        # Next line of code is problem for cross-compiled enviroment:
        # NOTE: GCC cross-compiler is prefixed by the <hostarch>-<hostos>-
        # and by default binaries are installed in same directory
        # as native compiler.
        self.gcc_version, self.ld_version, self.dllwrap_version = \
            get_versions()
        self.debug_print(
            self.compiler_type + ": gcc %s, ld %s, dllwrap %s\n" %
            (self.gcc_version, self.ld_version, self.dllwrap_version))

        # ld_version >= "2.10.90" and < "2.13" should also be able to use
        # gcc -mdll instead of dllwrap
        # Older dllwraps had own version numbers, newer ones use the
        # same as the rest of binutils ( also ld )
        # dllwrap 2.10.90 is buggy
        if self.ld_version >= "2.10.90":
            self.linker_dll = "gcc"
        else:
            self.linker_dll = "dllwrap"

        # ld_version >= "2.13" support -shared so use it instead of
        # -mdll -static
        if self.ld_version >= "2.13":
            shared_option = "-shared"
        else:
            shared_option = "-mdll -static"

        # FIXME:
        # Hard-code may override unix-compiler settings and isn't
        # possible to use Makefile variables to pass correct flags !
        # Hard-code GCC because that's what this is all about.
        # XXX optimization, warnings etc. should be customizable.
        self.set_executables(compiler='gcc -mcygwin -O -Wall',
                             compiler_so='gcc -mcygwin -mdll -O -Wall',
                             compiler_cxx='g++ -mcygwin -O -Wall',
                             linker_exe='gcc -mcygwin',
                             linker_so=('%s -mcygwin %s' %
                                        (self.linker_dll, shared_option)))

        # cygwin and mingw32 need different sets of libraries
        if self.gcc_version == "2.91.57":
            # cygwin shouldn't need msvcrt, but without the dlls will crash
            # (gcc version 2.91.57) -- perhaps something about initialization
            self.dll_libraries = ["msvcrt"]
            self.warn("Consider upgrading to a newer version of gcc")
        else:
            # Include the appropriate MSVC runtime library if Python was built
            # with MSVC 7.0 or later.
            self.dll_libraries = get_msvcr()
Example #32
0
"""distutils.cygwinccompiler