diff options
author | George Hartzell <hartzell@alerce.com> | 2017-06-02 08:44:01 -0700 |
---|---|---|
committer | Adam J. Stewart <ajstewart426@gmail.com> | 2017-06-02 10:44:01 -0500 |
commit | 23474be4b0fe55dc0818c0a334a337e282717b44 (patch) | |
tree | 881b82d9249718a44cd8f86b198095f74c04f944 | |
parent | 623e7cb7b6adad548aed8a7ab98f6260dab1415e (diff) | |
download | spack-23474be4b0fe55dc0818c0a334a337e282717b44.tar.gz spack-23474be4b0fe55dc0818c0a334a337e282717b44.tar.bz2 spack-23474be4b0fe55dc0818c0a334a337e282717b44.tar.xz spack-23474be4b0fe55dc0818c0a334a337e282717b44.zip |
Add variant to build shared Perl lib (#4416)
* Add variant to build shared Perl lib
Add a variant that enables Perl's "useshrplib" feature, which builds a
shared perl library.
This addresses problems like so:
```
/usr/bin/ld: /blah/blah/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/perl-5.24.1-y43dp3p5w66v7qh5xkwgufxohyuodyew/lib/5.24.1/x86_64-linux/CORE/libperl.a(op.o): relocation R_X86_64_32S against `PL_opargs' can not be used when making a shared object; recompile with -fPIC
/blah/blah/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/perl-5.24.1-y43dp3p5w66v7qh5xkwgufxohyuodyew/lib/5.24.1/x86_64-linux/CORE/libperl.a: could not read symbols: Bad value
```
It should also address the Intel compiler issue discussed in #3081
while respecting Perl's configuration machinery.
* Rename shared variant and default to True
* Use correct variant to add configure arg
* Restore bits that set ccflags for intel compilers
After some experimentation we've established that setting
the flag to build a shared perl library is tightly tied to
the use of -fPIC.
This commit restores the code that sets ccflags for
intel compilers.
* Flake8 cleanup
-rw-r--r-- | var/spack/repos/builtin/packages/perl/package.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/perl/package.py b/var/spack/repos/builtin/packages/perl/package.py index ef1c11289f..95b2ae8726 100644 --- a/var/spack/repos/builtin/packages/perl/package.py +++ b/var/spack/repos/builtin/packages/perl/package.py @@ -69,6 +69,9 @@ class Perl(Package): # Perl doesn't use Autotools, it should subclass Package variant('cpanm', default=True, description='Optionally install cpanm with the core packages.') + variant('shared', default=True, + description='Build a shared libperl.so library') + resource( name="cpanm", url="http://search.cpan.org/CPAN/authors/id/M/MI/MIYAGAWA/App-cpanminus-1.7042.tar.gz", @@ -87,14 +90,18 @@ class Perl(Package): # Perl doesn't use Autotools, it should subclass Package '-des', '-Dprefix={0}'.format(prefix), '-Dlocincpth=' + self.spec['gdbm'].prefix.include, - '-Dloclibpth=' + self.spec['gdbm'].prefix.lib + '-Dloclibpth=' + self.spec['gdbm'].prefix.lib, ] # Discussion of -fPIC for Intel at: - # https://github.com/LLNL/spack/pull/3081 + # https://github.com/LLNL/spack/pull/3081 and + # https://github.com/LLNL/spack/pull/4416 if spec.satisfies('%intel'): config_args.append('-Accflags={0}'.format(self.compiler.pic_flag)) + if '+shared' in spec: + config_args.append('-Duseshrplib') + return config_args def configure(self, spec, prefix): |