From d687e332ad41cd7c84bf0007f8c331e56470da18 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 4 Jul 2016 22:59:02 -0700 Subject: [PATCH] Fix compile bugs for gcc on Mac OS X with macports. - add macports to things that are cleaned out of the environment. - linker incompatibilities cause issues with packages like OpenSSL. - also clean up NOQA stuff in OpenSSL --- lib/spack/spack/build_environment.py | 9 +++++ .../repos/builtin/packages/openssl/package.py | 36 ++++++++++++------- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index ce0b91b718..fe5186a7d7 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -277,6 +277,15 @@ def set_build_environment_variables(pkg, env, dirty=False): env.unset('LD_RUN_PATH') env.unset('DYLD_LIBRARY_PATH') + # Remove any macports installs from the PATH. The macports ld can + # cause conflicts with the built-in linker on el capitan. Solves + # assembler issues, e.g.: + # suffix or operands invalid for `movq'" + path = get_path('PATH') + for p in path: + if '/macports/' in p: + env.remove_path('PATH', p) + # Add bin directories from dependencies to the PATH for the build. bin_dirs = reversed( filter(os.path.isdir, ['%s/bin' % prefix for prefix in dep_prefixes])) diff --git a/var/spack/repos/builtin/packages/openssl/package.py b/var/spack/repos/builtin/packages/openssl/package.py index a0747f229d..e7c105d5f5 100644 --- a/var/spack/repos/builtin/packages/openssl/package.py +++ b/var/spack/repos/builtin/packages/openssl/package.py @@ -63,7 +63,8 @@ def url_for_version(self, version): # case return a fake url and exit openssl_url = '@system (reserved version for system openssl)' if not warnings_given_to_user.get(version, False): - tty.msg('Using openssl@system : the version @system is reserved for system openssl') # NOQA: ignore=E501 + tty.msg('Using openssl@system: ' + 'the version @system is reserved for system openssl') warnings_given_to_user[version] = True else: openssl_url = self.check_for_outdated_release( @@ -87,37 +88,46 @@ def check_for_outdated_release(self, version, warnings_given_to_user): openssl_url = latest.format(version=version) urllib.urlopen(openssl_url) except IOError: - openssl_url = older.format(version_number=version_number, version_full=version) # NOQA:ignore=E501 + openssl_url = older.format( + version_number=version_number, version_full=version) # Checks if we already warned the user for this particular # version of OpenSSL. If not we display a warning message # and mark this version if not warnings_given_to_user.get(version, False): - tty.warn('This installation depends on an old version of OpenSSL, which may have known security issues. ') # NOQA: ignore=E501 - tty.warn('Consider updating to the latest version of this package.') # NOQA: ignore=E501 - tty.warn('More details at {homepage}'.format(homepage=Openssl.homepage)) # NOQA: ignore=E501 + tty.warn( + 'This installation depends on an old version of OpenSSL, ' + 'which may have known security issues. ') + tty.warn( + 'Consider updating to the latest version of this package.') + tty.warn('More details at {homepage}'.format( + homepage=Openssl.homepage)) warnings_given_to_user[version] = True return openssl_url + def install(self, spec, prefix): # OpenSSL uses a variable APPS in its Makefile. If it happens to be set # in the environment, then this will override what is set in the # Makefile, leading to build errors. env.pop('APPS', None) - if spec.satisfies("target=x86_64") or spec.satisfies("target=ppc64"): + + if spec.satisfies('target=x86_64') or spec.satisfies('target=ppc64'): # This needs to be done for all 64-bit architectures (except Linux, # where it happens automatically?) env['KERNEL_BITS'] = '64' - config = Executable("./config") - config("--prefix=%s" % prefix, - "--openssldir=%s" % join_path(prefix, 'etc', 'openssl'), - "zlib", - "no-krb5", - "shared") + + options = ['zlib', 'no-krb5', 'shared'] + + config = Executable('./config') + config('--prefix=%s' % prefix, + '--openssldir=%s' % join_path(prefix, 'etc', 'openssl'), + *options) + # Remove non-standard compiler options if present. These options are # present e.g. on Darwin. They are non-standard, i.e. most compilers # (e.g. gcc) will not accept them. filter_file(r'-arch x86_64', '', 'Makefile') make() - make("install") + make('install')