Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
ccc-model-manager / lib / python3.9 / site-packages / scipy / _build_utils / gcc_build_bitness.py
Size: Mime:
#!python
""" Detect bitness (32 or 64) of Mingw-w64 gcc build target on Windows.
"""

import re
from subprocess import run, PIPE

def main():
    res = run(['gcc', '-v'], check=True, text=True,
              stdout=PIPE, stderr=PIPE)
    target = re.search(r'^Target: (.*)$', res.stderr, flags=re.M).groups()[0]
    if target.startswith('i686'):
        print('32')
    elif target.startswith('x86_64'):
        print('64')
    else:
        raise RuntimeError('Could not detect Mingw-w64 bitness')


if __name__ == "__main__":
    main()