Exemplo n.º 1
0
    def configure_args(self):
        spec = self.spec

        # Generic options to compile GCC
        options = [
            # Distributor options
            '--with-pkgversion=Spack GCC',
            '--with-bugurl=https://github.com/spack/spack/issues',
            # Xcode 10 dropped 32-bit support
            '--disable-multilib',
            '--enable-languages={0}'.format(','.join(
                spec.variants['languages'].value)),
            # Drop gettext dependency
            '--disable-nls'
        ]

        # Use installed libz
        if self.version >= Version('6'):
            options.append('--with-system-zlib')

        if 'zstd' in spec:
            options.append('--with-zstd={0}'.format(spec['zstd'].prefix))

        # Enabling language "jit" requires --enable-host-shared.
        if 'languages=jit' in spec:
            options.append('--enable-host-shared')

        # Binutils
        if spec.satisfies('+binutils'):
            binutils = spec['binutils'].prefix.bin
            options.extend([
                '--with-gnu-ld',
                '--with-ld=' + binutils.ld,
                '--with-gnu-as',
                '--with-as=' + binutils.join('as'),
            ])

        # enable_bootstrap
        if spec.satisfies('+bootstrap'):
            options.extend([
                '--enable-bootstrap',
            ])

        # Configure include and lib directories explicitly for these
        # dependencies since the short GCC option assumes that libraries
        # are installed in "/lib" which might not be true on all OS
        # (see #10842)
        #
        # More info at: https://gcc.gnu.org/install/configure.html
        for dep_str in ('mpfr', 'gmp', 'mpc', 'isl'):
            if dep_str not in spec:
                options.append('--without-{0}'.format(dep_str))
                continue

            dep_spec = spec[dep_str]
            include_dir = dep_spec.headers.directories[0]
            lib_dir = dep_spec.libs.directories[0]
            options.extend([
                '--with-{0}-include={1}'.format(dep_str, include_dir),
                '--with-{0}-lib={1}'.format(dep_str, lib_dir)
            ])

        # nvptx-none offloading for host compiler
        if spec.satisfies('+nvptx'):
            options.extend([
                '--enable-offload-targets=nvptx-none',
                '--with-cuda-driver-include={0}'.format(
                    spec['cuda'].prefix.include),
                '--with-cuda-driver-lib={0}'.format(
                    spec['cuda'].libs.directories[0]), '--disable-bootstrap',
                '--disable-multilib'
            ])

        if sys.platform == 'darwin':
            options.extend([
                '--with-native-system-header-dir=/usr/include',
                '--with-sysroot={0}'.format(macos_sdk_path()),
                '--with-libiconv-prefix={0}'.format(spec['iconv'].prefix)
            ])

        # enable appropriate bootstrapping flags
        stage1_ldflags = str(self.rpath_args)
        boot_ldflags = stage1_ldflags + ' -static-libstdc++ -static-libgcc'
        options.append('--with-stage1-ldflags=' + stage1_ldflags)
        options.append('--with-boot-ldflags=' + boot_ldflags)

        return options
Exemplo n.º 2
0
    def configure_args(self):
        spec = self.spec

        # Generic options to compile GCC
        options = [
            # Distributor options
            '--with-pkgversion=Spack GCC',
            '--with-bugurl=https://github.com/spack/spack/issues',
            # Xcode 10 dropped 32-bit support
            '--disable-multilib',
            '--enable-languages={0}'.format(','.join(
                spec.variants['languages'].value)),
            # Drop gettext dependency
            '--disable-nls',
            '--with-mpfr={0}'.format(spec['mpfr'].prefix),
            '--with-gmp={0}'.format(spec['gmp'].prefix),
        ]

        # Use installed libz
        if self.version >= Version('6'):
            options.append('--with-system-zlib')

        # Enabling language "jit" requires --enable-host-shared.
        if 'languages=jit' in spec:
            options.append('--enable-host-shared')

        # Binutils
        if spec.satisfies('+binutils'):
            static_bootstrap_flags = '-static-libstdc++ -static-libgcc'
            options.extend([
                '--with-sysroot=/',
                '--with-stage1-ldflags={0} {1}'.format(self.rpath_args,
                                                       static_bootstrap_flags),
                '--with-boot-ldflags={0} {1}'.format(self.rpath_args,
                                                     static_bootstrap_flags),
                '--with-gnu-ld',
                '--with-ld={0}/ld'.format(spec['binutils'].prefix.bin),
                '--with-gnu-as',
                '--with-as={0}/as'.format(spec['binutils'].prefix.bin),
            ])

        # MPC
        if 'mpc' in spec:
            options.append('--with-mpc={0}'.format(spec['mpc'].prefix))

        # ISL
        if 'isl' in spec:
            options.append('--with-isl={0}'.format(spec['isl'].prefix))

        # nvptx-none offloading for host compiler
        if spec.satisfies('+nvptx'):
            options.extend([
                '--enable-offload-targets=nvptx-none',
                '--with-cuda-driver-include={0}'.format(
                    spec['cuda'].prefix.include),
                '--with-cuda-driver-lib={0}'.format(
                    spec['cuda'].libs.directories[0]), '--disable-bootstrap',
                '--disable-multilib'
            ])

        if sys.platform == 'darwin':
            options.extend([
                '--with-native-system-header-dir=/usr/include',
                '--with-sysroot={0}'.format(macos_sdk_path()),
                '--with-libiconv-prefix={0}'.format(spec['libiconv'].prefix)
            ])

        return options
Exemplo n.º 3
0
    def configure_args(self):
        spec = self.spec

        # Generic options to compile GCC
        options = [
            '--disable-multilib', '--enable-languages={0}'.format(','.join(
                spec.variants['languages'].value)),
            '--with-mpfr={0}'.format(spec['mpfr'].prefix),
            '--with-gmp={0}'.format(spec['gmp'].prefix), '--enable-lto',
            '--with-quad'
        ]

        # Use installed libz
        if self.version >= Version('6'):
            options.append('--with-system-zlib')

        # Enabling language "jit" requires --enable-host-shared.
        if 'languages=jit' in spec:
            options.append('--enable-host-shared')

        # Binutils
        if spec.satisfies('+binutils'):
            static_bootstrap_flags = '-static-libstdc++ -static-libgcc'
            binutils_options = [
                '--with-sysroot=/',
                '--with-stage1-ldflags={0} {1}'.format(self.rpath_args,
                                                       static_bootstrap_flags),
                '--with-boot-ldflags={0} {1}'.format(self.rpath_args,
                                                     static_bootstrap_flags),
                '--with-gnu-ld',
                '--with-ld={0}/ld'.format(spec['binutils'].prefix.bin),
                '--with-gnu-as',
                '--with-as={0}/as'.format(spec['binutils'].prefix.bin),
            ]
            options.extend(binutils_options)

        # MPC
        if 'mpc' in spec:
            options.append('--with-mpc={0}'.format(spec['mpc'].prefix))

        # ISL
        if 'isl' in spec:
            options.append('--with-isl={0}'.format(spec['isl'].prefix))

        # macOS
        if sys.platform == 'darwin':
            options.append('--with-build-config=bootstrap-debug')

        # nvptx-none offloading for host compiler
        if spec.satisfies('+nvptx'):
            options.extend([
                '--enable-offload-targets=nvptx-none',
                '--with-cuda-driver-include={0}'.format(
                    spec['cuda'].prefix.include),
                '--with-cuda-driver-lib={0}'.format(
                    spec['cuda'].libs.directories[0]), '--disable-bootstrap',
                '--disable-multilib'
            ])

        if sys.platform == 'darwin':
            options.extend([
                '--with-native-system-header-dir=/usr/include',
                '--with-sysroot={0}'.format(macos_sdk_path())
            ])

        return options