Commit Graph

30 Commits

Author SHA1 Message Date
Todd Gamblin
54f97d1dec
Update copyright on LLNL files for 2018. (#7592) 2018-03-24 12:13:52 -07:00
Luigi Calori
24bb3c61de fix perl dependent modules, #5900 (#5937)
*  FIX perl dependent environmwent setup to avoid void lines in generated modules as #5900

* remove debug prints

* fix flake8
2017-11-08 22:10:50 -07:00
Todd Gamblin
05fa302655
Replace github.com/llnl/spack with github.com/spack/spack (#6142)
We moved to a new GitHub org! Now make the code and docs reflect that.
2017-11-04 17:08:04 -07:00
Ben Boeckel
a81485cb3f perl: support extensions in views 2017-11-02 18:45:40 -07:00
George Hartzell
c9d9901e43 perl: add old version (#5844) 2017-10-20 16:18:24 -07:00
Milton Woods
d72bcc91f4 perl: ignore perllocal.pod files during package activation (#5271) 2017-10-19 14:24:49 -07:00
George Hartzell
ad5fb40d75 perl: add write permissions to update config files (#5746)
Perl installs a couple of config files that need to be munged so that
they don't refer to the spack compiler.  These files are installed
read-only.  Behind the scenes 'filter_file' moves its file to a safe
place, and tries to create a working file that is both O_WRONLY and
has the perms of the original file.  On an NFSv4 filesystem, the
combination of 'r--r--r--' and O_WRONLY throws a permissions error.

This commit adds a simple context manager that temporarily makes the
files writable.
2017-10-17 18:38:23 -07:00
Michael Kuhn
84ae7872d3 Update copyright notices for 2017 (#5295) 2017-09-06 17:44:16 -10:00
Milton Woods
4044e9f918 Perl - allow package activation without PERL5LIB variable (#4540)
* perl: prepend default perl @INC path to support package activation

* perl: remove stray comma from list of configure arguments

* perl: final comma in configure arguments makes adding arguments safer

This reverts commit fdc10cd611f525ebc31ca1953e048095b1c75350.

* perl: add comment about modified @INC (thanks to George Hartzell)

* perl: use self.prefix.lib and self.prefix.bin for clarity

* perl: convert tabs added by editor to spaces for flake8

* perl: use new path syntax: prefix.lib.perl5

* perl: avoid line break before binary operator

* perl: use compact spack syntax for perl executable
2017-07-23 09:41:45 -05:00
Todd Gamblin
cac4362f64 Make LICENSE recognizable by GitHub. (#4598) 2017-06-24 22:22:55 -07:00
George Hartzell
23474be4b0 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
2017-06-02 10:44:01 -05:00
George Hartzell
e3eaba80b1 Ensure Config.pm has correct setting for cc (#4345)
* Ensure Config.pm has correct setting for cc

Run a filter after install so that Config.pm records the compiler that
Spack built the package with.  If this isn't done, $Config{cc} will be
set to Spack's cc wrapper script.

* Also patch compilers Config_heavy.pl

This patch sets ld=gcc, which appears to work.  I'm not sure if
there's a good way to get at the ld that Spack uses.

* Clean up quoting

* Fix pattern for Config.pm

Does not start at beginning of line...
2017-05-29 16:59:30 -05:00
George Hartzell
f55eddb9bd Add info for perl@5.22.1 (#4147)
What the user wants, the user gets....
2017-05-05 18:00:23 -05:00
Adam J. Stewart
ce3ab503de Python command, libraries, and headers (#3367)
## Motivation

Python installations are both important and unfortunately inconsistent. Depending on the Python version, OS, and the strength of the Earth's magnetic field when it was installed, the name of the Python executable, directory containing its libraries, library names, and the directory containing its headers can vary drastically. 

I originally got into this mess with #3274, where I discovered that Boost could not be built with Python 3 because the executable is called `python3` and we were telling it to use `python`. I got deeper into this mess when I started hacking on #3140, where I discovered just how difficult it is to find the location and name of the Python libraries and headers.

Currently, half of the packages that depend on Python and need to know this information jump through hoops to determine the correct information. The other half are hard-coded to use `python`, `spec['python'].prefix.lib`, and `spec['python'].prefix.include`. Obviously, none of these packages would work for Python 3, and there's no reason to duplicate the effort. The Python package itself should contain all of the information necessary to use it properly. This is in line with the recent work by @alalazo and @davydden with respect to `spec['blas'].libs` and friends.

## Prefix

For most packages in Spack, we assume that the installation directory is `spec['python'].prefix`. This generally works for anything installed with Spack, but gets complicated when we include external packages. Python is a commonly used external package (it needs to be installed just to run Spack). If it was installed with Homebrew, `which python` would return `/usr/local/bin/python`, and most users would erroneously assume that `/usr/local` is the installation directory. If you peruse through #2173, you'll immediately see why this is not the case. Homebrew actually installs Python in `/usr/local/Cellar/python/2.7.12_2` and symlinks the executable to `/usr/local/bin/python`. `PYTHONHOME` (and presumably most things that need to know where Python is installed) needs to be set to the actual installation directory, not `/usr/local`.

Normally I would say, "sounds like user error, make sure to use the real installation directory in your `packages.yaml`". But I think we can make a special case for Python. That's what we decided in #2173 anyway. If we change our minds, I would be more than happy to simplify things.

To solve this problem, I created a `spec['python'].home` attribute that works the same way as `spec['python'].prefix` but queries Python to figure out where it was actually installed. @tgamblin Is there any way to overwrite `spec['python'].prefix`? I think it's currently immutable.

## Command

In general, Python 2 comes with both `python` and `python2` commands, while Python 3 only comes with a `python3` command. But this is up to the OS developers. For example, `/usr/bin/python` on Gentoo is actually Python 3. Worse yet, if someone is using an externally installed Python, all 3 commands may exist in the same directory! Here's what I'm thinking:

If the spec is for Python 3, try searching for the `python3` command.
If the spec is for Python 2, try searching for the `python2` command.
If neither are found, try searching for the `python` command.

## Libraries

Spack installs Python libraries in `spec['python'].prefix.lib`. Except on openSUSE 13, where it installs to `spec['python'].prefix.lib64` (see #2295 and #2253). On my CentOS 6 machine, the Python libraries are installed in `/usr/lib64`. Both need to work.

The libraries themselves change name depending on OS and Python version. For Python 2.7 on macOS, I'm seeing:
```
lib/libpython2.7.dylib
```
For Python 3.6 on CentOS 6, I'm seeing:
```
lib/libpython3.so
lib/libpython3.6m.so.1.0
lib/libpython3.6m.so -> lib/libpython3.6m.so.1.0
```
Notice the `m` after the version number. Yeah, that's a thing.

## Headers

In Python 2.7, I'm seeing:
```
include/python2.7/pyconfig.h
```
In Python 3.6, I'm seeing:
```
include/python3.6m/pyconfig.h
```
It looks like all Python 3 installations have this `m`. Tested with Python 3.2 and 3.6 on macOS and CentOS 6

Spack has really nice support for libraries (`find_libraries` and `LibraryList`), but nothing for headers. Fixed.
2017-04-29 17:24:13 -07:00
Milton Woods
e6efb1aa21 perl: identify dependency on gdbm (#3896)
* perl: provide +gdbm variant for use when system dbm is missing or buggy

* perl: remove gdbm variant; always depends on gdbm

* perl: pass gdbm paths as Configure arguments
2017-04-26 07:42:43 -05:00
Adam J. Stewart
46d0ca9d01 Ensure that tests are optional (#3922) 2017-04-21 12:15:39 -05:00
George Hartzell
cddb7524b7 Hey, I was using that! :) (#3660)
Turns out that we really want 5.22.2 for backward compatibility.
2017-04-02 20:32:20 -05:00
Adam J. Stewart
343f3b2fde Add QBank package (#3641)
* Add QBank package

* Install the documentation and add it to the MANPATH

* Add Perl DBI package

* Make sure setup method variables are consistent
2017-03-31 11:51:13 -05:00
Adam J. Stewart
d13854b5d4 Perl: add more versions, add phases (#3640) 2017-03-31 09:18:28 -05:00
Milton Woods
9e43ff821c Extendable Perl (#3614)
* perl: make extendable and add Module::Build package
* perl: allow 'spack create' to identify perl packages from their contents
* perl-module-build: fix indenting of package docstring
* perl: split install() method for extensions into phases
* perl: auto-detect build method (Makefile.PL vs Build.PL) and define a 'check' method
* PerlPackage: use import statements similar to those in AutotoolsPackage
* PerlModule: fix detection of Build.PL
* PerlPackageTemplate: remove extraneous lines to avoid flake8 warnings
* PerlPackageTemplate: split into separate templates for Makefile.PL and Build.PL
* PerlPackage: add cross-references to docstrings
* AutotoolsPackage: fix ambiguous cross-references to avoid errors in doc tests
* PerlbuildPackageTemplate: depend on perl-module-build if Build.PL exists
2017-03-30 16:38:58 -07:00
Jon Rood
0c1441c3e3 Using fPIC in PERL when using an Intel compiler. (#3355) 2017-03-04 07:50:38 -06:00
Elizabeth Fischer
8cb7f3d262 Keep Curl Bootstrap Working With http:// (#3113)
* Add comments documenting problems in recent versions of NetCDF.
* Add comments to packages required to install curl.
2017-02-17 11:52:08 -08:00
Adam J. Stewart
dbb18df3f2 Add latest stable Perl release (#2969) 2017-02-03 14:10:08 -08:00
George Hartzell
74a181febc Remove local copy of cpanm installer
This is handled as a resource in the package now.
2016-08-02 12:13:24 -04:00
George Hartzell
f2f5f6c279 Touch up variant comment 2016-08-02 11:18:50 -04:00
George Hartzell
c994565c62 Use "resource" machinery to manage cpanm tarball
Use the resource machinery to fetch/cache/unpack/... the App::cpanminus
tarball.

- this hardcodes the version, I can't figure out how to use a variant to
  hold/set the value and access it in the resource().
- change up the install to use the `with working_dir()` meme.
2016-08-02 11:16:46 -04:00
George Hartzell
1b9becc541 Add the std spack header to perl/package.py
Stole the example header from antlr/package.py, included it at the top
of perl/package.py.
2016-08-02 11:16:46 -04:00
George Hartzell
08ff7b65af Make running perl's tests conditional
Make running perl's tests conditional, one must now specify the
`--run-tests` flag to the `spack install` command in order to run the
tests.

On one system (8 core, 16GB Digital Ocean Droplet), installing without
tests takes 3 minutes, with tests takes 16 minutes.
2016-08-02 11:16:46 -04:00
George Hartzell
4d72e0fb9d Make the cpanm version a variant
Rather than hard-coding the verison of `cpanm` that's [optionally]
installed into the core, make it a variant with a default value of
'1.7042'.

Also discovered that `prefix + 'bin'` is the same as `prefix.bin`, so
embetter that bit of code.
2016-08-02 11:16:46 -04:00
George Hartzell
a5a4525bed Add perl package
Add perl package, based on [work by
justintoo](https://github.com/LLNL/spack/pull/105).  He had too many
things pulled into that pull request, this just adds a perl package.

Support the current releases on the past three minor branches.

Run perl's tests before installing.

Install cpanm into the core (makes building on top of this perl *much*
simpler).  Controlled by a variant.
2016-08-02 11:16:46 -04:00