Commit Graph

96 Commits

Author SHA1 Message Date
Felix Mayr
c2e280b794 python: add versions 3.7.3, 3.5.7, and 3.4.10 (#11300) 2019-05-02 08:01:30 +09:00
Gregory Lee
10b0251af0 added python 2.7.16 (#10805) 2019-03-06 11:05:32 -08:00
Peter Scheibel
af4a36c4d9
Header subdirectories for Python and Eigen (#10773)
Fixes #10769 

This updates the .headers property to include header subdirectories
for Python and Eigen (as is recommended by these packages).

#10623 updated the default behavior of .headers.directories to
exclude subdirectories (since this can cause clashes with system
headers). This broke some packages which depended on the old behavior
of .headers.directories: for example if you had
<package-prefix>/include/subdir/ex1.h, .headers.directories would
include <package-prefix>/include/subdir.
2019-03-04 12:36:51 -06:00
Adam J. Stewart
b43e8fcaa7
Python: optional dependencies and post-installation tests (#10335)
* Add post-installation tests to Python package

* libbsd does not build on macOS

* Make Python dependencies optional

* Add readline dep, remove ncurses patch, fix autoreconf
2019-02-23 12:36:26 -06:00
Daniel Topa
d9d75635c7 Add Python 3.7.2 updated (#10531)
Also add versions 3.7.1, 3.6.8, 3.6.7, 3.6.6. Does NOT alter preferred version (2.7.15).

Supplants PR 10491 "Add Python 3.7.2" (https://github.com/spack/spack/pull/10491).

Verification builds on LANL Darwin:

**Intel Xeon**
[+] /scratch/users/dantopa/new-spack/pr.new.python-3.7.2/general/opt/spack/linux-centos7-x86_64/gcc-4.8.5/python-3.7.2-d3p7vg6w2r563cpmwsmbgjbsiqc4j4fq
[+] /scratch/users/dantopa/new-spack/pr.new.python-3.7.2/general/opt/spack/linux-centos7-x86_64/gcc-4.8.5/python-3.7.1-ibom6qj2z64egyaqz5htkwp5tr362il6
[+] /scratch/users/dantopa/new-spack/pr.new.python-3.7.2/general/opt/spack/linux-centos7-x86_64/gcc-4.8.5/python-3.6.8-rkifc3c7mjgdglw27upiap767ut4wpkz
[+] /scratch/users/dantopa/new-spack/pr.new.python-3.7.2/general/opt/spack/linux-centos7-x86_64/gcc-4.8.5/python-3.6.7-meuesn43twttt756exyzqgdhohjgipjq
[+] /scratch/users/dantopa/new-spack/pr.new.python-3.7.2/general/opt/spack/linux-centos7-x86_64/gcc-4.8.5/python-3.6.6-qwnwme7otyuoqqudcglfmfy75t5npywl

**Arm**
[+] /scratch/users/dantopa/new-spack/pr.new.python-3.7.2/arm/opt/spack/linux-rhel7-aarch64/gcc-4.8.5/python-3.7.2-qj27kzs4ttdqudm3hsi3pt57kv7lshco
[+] /scratch/users/dantopa/new-spack/pr.new.python-3.7.2/arm/opt/spack/linux-rhel7-aarch64/gcc-4.8.5/python-3.7.1-io5eneirgvpegy3tosvp6wq5ndf7yjis
[+] /scratch/users/dantopa/new-spack/pr.new.python-3.7.2/arm/opt/spack/linux-rhel7-aarch64/gcc-4.8.5/python-3.6.8-ej3vnvta2hbtrh7p5hokfqkuewxeqgsa
[+] /scratch/users/dantopa/new-spack/pr.new.python-3.7.2/arm/opt/spack/linux-rhel7-aarch64/gcc-4.8.5/python-3.6.7-l3qnue72ewppn2wxza3w6l62l7ijlque
[+] /scratch/users/dantopa/new-spack/pr.new.python-3.7.2/arm/opt/spack/linux-rhel7-aarch64/gcc-4.8.5/python-3.6.6-b55pdoqsr5bie4k5djd4vokm3nywhm45

**Power9**
[+] /scratch/users/dantopa/new-spack/pr.new.python-3.7.2/power9/opt/spack/linux-rhel7-ppc64le/gcc-4.8.5/python-3.7.2-cicayvl7ki4tswoqlljsmcetwqcnoh3x
[+] /scratch/users/dantopa/new-spack/pr.new.python-3.7.2/power9/opt/spack/linux-rhel7-ppc64le/gcc-4.8.5/python-3.7.1-7vej3zvnvyj2jvz5lnxhnts3ok2fcxbp
[+] /scratch/users/dantopa/new-spack/pr.new.python-3.7.2/power9/opt/spack/linux-rhel7-ppc64le/gcc-4.8.5/python-3.6.8-xijljmdanyrybcx2rv65qshycmbrfv6c
[+] /scratch/users/dantopa/new-spack/pr.new.python-3.7.2/power9/opt/spack/linux-rhel7-ppc64le/gcc-4.8.5/python-3.6.7-vqdhzg7c3xxxregqmzxsqqfzxt2hajvq
[+] /scratch/users/dantopa/new-spack/pr.new.python-3.7.2/power9/opt/spack/linux-rhel7-ppc64le/gcc-4.8.5/python-3.6.6-jf4bnsdwk3qjhtmvjjhblnrcz5dztfdq

2019-02-05
Signed-off-by: Daniel Topa <dantopa@lanl.gov>

Signed-off-by: Daniel Topa <dantopa@lanl.gov>
2019-02-06 12:03:25 -06:00
Greg Becker
450b0e3059 Allow combinatorial projections in views (#9679)
Allow customizing views with Spec-formatted directory structure

Allow views to specify projections that are more complicated than
merging every package into a single shared prefix. This will allow
sites to configure a view for the way they want to present packages
to their users; for example this can be used to create a prefix for
each package but omit the DAG hash from the path.

This includes a new YAML format file for specifying the simplified
prefix for a spec in a view. This configuration allows the use of
different prefix formats for different specs (i.e. specs depending
on MPI can include the MPI implementation in the prefix).
Documentation on usage of the view projection configuration is
included.

Depending on the projection configuration, paths are not guaranteed
to be unique and it may not be possible to add multiple installs of
a package to a view.
2019-01-09 17:39:35 -08:00
Todd Gamblin
6f50cd52ed copyright: update license headers for 2013-2019 copyright. 2019-01-01 00:44:28 -08:00
Todd Gamblin
eea786f4e8 relicense: replace LGPL headers with Apache-2.0/MIT SPDX headers
- remove the old LGPL license headers from all files in Spack
- add SPDX headers to all files
  - core and most packages are (Apache-2.0 OR MIT)
  - a very small number of remaining packages are LGPL-2.1-only
2018-10-17 14:42:06 -07:00
Denis Davydov
600acbbe66 python: add details on missing library to error message (#9332)
When a library cannot be found, the exception now includes the name
of the library that was requested.
2018-10-03 19:46:14 -07:00
Sergey Kosukhin
a9c434d7d7 Build Python 3.7 with external libffi. (#9245) 2018-09-14 17:07:13 -07:00
Adam J. Stewart
ccbff6e0cd
Improve spec['python'].command support for bwpy (#9157) 2018-09-10 17:14:57 -05:00
Andreas Baumbach
ead9363bee add patch for gcc@8 for python 2.7.14 (#8990)
* add gcc8 patch for python 2.7.14

Change-Id: I48cb5e717577d8158d1f7f1fe270156a01940d8a

* add explaining comment

Change-Id: Ia46168e2269d7de47d7ec8d0bf9e3b7696ea8e31

* remove unnecessary part of the patch

Change-Id: Iee763effe2439f0f160c1547640eca4bb9451a68
2018-08-16 07:51:09 -05:00
Adam J. Stewart
73c978ddd9 install_tree, copy_tree can install into existing directory structures (#8289)
Replace use of `shutil.copytree` with `copy_tree` and `install_tree` functions in `llnl.util.filesystem`.

- `copy_tree` copies without setting permissions.  It should be used to copy files around in the build directory.
- `install_tree` copies files and sets permissions.  It should be used to copy files into the installation directory.
- `install` and `copy` are analogous single-file functions.
- add more extensive tests for these functions
- update packages to use these functions.
2018-08-15 09:30:09 -07:00
Adam J. Stewart
a0c13229e8
Add Python 3.7.0 (#8619) 2018-06-29 16:25:39 -05:00
scheibelp
3560f6dbe9 views: packages can customize how they're added to views (#7152)
Functional updates:

- `python` now creates a copy of the `python` binaries when it is added
  to a view

- Python extensions (packages which subclass `PythonPackage`) rewrite
  their shebang lines to refer to python in the view

- Python packages in the same namespace will not generate conflicts if
  both have `...lib/site-packages/namespace-example/__init__.py`

  - These `__init__` files will also remain when removing any package in
    the namespace until the last package in the namespace is removed


Generally (Updated 2/16):

- Any package can define `add_files_to_view` to customize how it is added
  to a view (and at the moment custom definitions are included for
  `python` and `PythonPackage`)

  - Likewise any package can define `remove_files_from_view` to customize
    which files are removed (e.g. you don't always want to remove the
    namespace `__init__`)

- Any package can define `view_file_conflicts` to customize what it
  considers a merge conflict

- Global activations are handled like views (where the view root is the
  spec prefix of the extendee)

  - Benefit: filesystem-management aspects of activating extensions are
    now placed in views (e.g. now one can hardlink a global activation)

  - Benefit: overriding `Package.activate` is more straightforward (see
    `Python.activate`)

  - Complication: extension packages which have special-purpose logic
    *only* when activated outside of the extendee prefix must check for
    this in their `add_files_to_view` method (see `PythonPackage`)

- `LinkTree` is refactored to have separate methods for copying a
  directory structure and for copying files (since it was found that
  generally packages may want to alter how files are copied but still
  wanted to copy directories in the same way)


TODOs (updated 2/20):

- [x] additional testing (there is some unit testing added at this point
  but more would be useful)

- [x] refactor or reorganize `LinkTree` methods: currently there is a
  separate set of methods for replicating just the directory structure
  without the files, and a set for replicating everything

- [x] Right now external views (i.e. those not used for global
  activations) call `view.add_extension`, but global activations do not
  to avoid some extra work that goes into maintaining external views. I'm
  not sure if addressing that needs to be done here but I'd like to
  clarify it in the comments (UPDATE: for now I have added a TODO and in
  my opinion this can be merged now and the refactor handled later)

- [x] Several method descriptions (e.g. for `Package.activate`) are out
  of date and reference a distinction between global activations and
  views, they need to be updated

- [x] Update aspell package activations
2018-06-26 16:14:05 -07:00
Michael Kuhn
8af37d5d64 python: Update to 2.7.15 (#8306)
2.7.14 does not compile with GCC 8, see https://bugs.python.org/issue33374.
2018-05-29 10:28:32 -05:00
Todd Gamblin
f202198777 Convert lazy singleton functions to Singleton object
- simplify the singleton pattern across the codebase
- reduce lines of code needed for crufty initialization
- reduce functions that need to mess with a global

- Singletons whose semantics changed:
  - spack.store.store() -> spack.store
  - spack.repo.path() -> spack.repo.path
  - spack.config.config() -> spack.config.config
  - spack.caches.fetch_cache() -> spack.caches.fetch_cache
  - spack.caches.misc_cache() -> spack.caches.misc_cache
2018-05-17 14:10:30 -07:00
Todd Gamblin
6f2cac9565 init: initialize spack.store lazily
- spack.store was previously initialized at the spack.store module level,
  but this means the store has to be initialized on every spack call.

- this moves the state in spack.store to a singleton so that the store is
  only initialized when needed.
2018-05-17 14:10:30 -07:00
Todd Gamblin
a4d276fbe4 init: factor paths out of spack/__init__.py and into spack.paths module 2018-05-17 14:10:30 -07:00
Elizabeth Fischer
cbd77e3a8d make symlinking python3->python optional (#7960)
* Make symlinking python3->python optional
* Added reference to PEP 394
2018-05-02 12:26:30 -07:00
Adam J. Stewart
bde69177be Don't prepend Tcl/Python to PATH if in system directory (#7677) 2018-04-05 14:39:05 -07:00
healther
9b5492ca19 add version 3.6.5 to python (#7643) 2018-03-30 12:20:16 +02:00
Massimiliano Culpo
dffd8f384c
python: added a variant to enable PGO + using --with-icc if compiled with Intel (#7496)
Added a variant to enable default optimizations for production builds.
Uses --with-icc if built with Intel compilers.
2018-03-25 09:10:40 +02:00
Todd Gamblin
54f97d1dec
Update copyright on LLNL files for 2018. (#7592) 2018-03-24 12:13:52 -07:00
Massimiliano Culpo
c14c0d8e74
python: dbm module + version 3.6.4 (#7520)
A build of python@3.X had the following in the logs:
```
The necessary bits to build these optional modules were not found:
_dbm                  _gdbm                 _tkinter
```
As Tkinter is already a variant, we adopt the same strategy for dbm.
2018-03-19 22:19:26 +01:00
Massimiliano Culpo
b7baeb542d Set a default python that is consistent with the libraries in PYTHONHOME (#7157)
fixes #7128

Before this PR packages that were indirectly dependent on python might
have failed due to inconsistency between the python found in the
environment and the standard libraries set in PYTHONHOME
2018-02-11 23:08:45 -08:00
healther
bddc1556e1 symlink python3 to python (#7103)
* symlink python3 to python

* otherwise not all autotools are smart enough

* Update package.py
2018-01-31 16:11:25 -08:00
scheibelp
278901c02c
Handle test dependencies that are python extensions (#6904)
See #6794

This fixes cases where test-only dependencies were omitted from
consideration when modifying the environment at build time. This
includes an update to the python package definition to add
testing-related python extensions to its specialized environment
setup.
2018-01-12 19:02:54 -08:00
健美猫
0d91f51a27 Python: add 3.6.3 . (#6454) 2017-11-25 11:34:24 -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
Oliver Breitwieser
643a28aac5 python: extensions support for easy-install.pth 2017-11-02 18:45:40 -07:00
Todd Gamblin
5449884b2e Fix bare 'except:' to placate errors in new flake8 version.
- fixes E722 errors from latest version of flake8
- requires us to not use 'bare except:' and catch BaseException instead
2017-10-24 10:05:36 +02:00
Todd Gamblin
7dd79094b0 remove wildcards from make spack core and packages
- This removes all wildcard imports EXCEPT `from spack import *` in packages
2017-10-24 10:05:36 +02:00
Mike Pozulp
2ad3a1bff7 Update pic/shared variants for hdf5, python, silo (#5423) 2017-09-21 18:14:31 -07:00
Gregory Lee
34d2762b1f added python version 2.7.14 and 3.6.2 packages (#5389) 2017-09-18 22:05:26 -05:00
Michael Kuhn
84ae7872d3 Update copyright notices for 2017 (#5295) 2017-09-06 17:44:16 -10:00
Todd Gamblin
cac4362f64 Make LICENSE recognizable by GitHub. (#4598) 2017-06-24 22:22:55 -07:00
Milton Woods
7ea0e143c5 python: RPATH on Cray (#4209)
* python: ensure that distutils sets valid compiler options for RPATH on cray

* python: add cray-rpath patches for python@2.3:3.0.1 and python@3.1:

* python: in patch(..., when="@a:b platform=c"), limit b must be specified

* python: assume that python@4 will break the cray patches
2017-05-28 09:17:16 -07:00
Adam J. Stewart
fa90a65d09 Fix spec['python'].home (#4228) 2017-05-18 12:12:08 -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
Massimiliano Culpo
e78e87fd4b python: added version 3.6.1 (#4035) 2017-04-28 09:55:02 -05:00
Todd Gamblin
221f179716 Add better tests for web.py; fix some bugs found with spidering.
- _spider in web.py was actually failing to spider deeper than a certain
  point.
- Fixed multiprocessing pools to not use daemons and to allow recursive
  spawning.
- Added detailed tests for spidering and for finding archive versions.
- left some xfail URL finding exercises for the reader.
- Fix noqa annotations for some @when decorators
2017-04-01 15:10:45 -07:00
Todd Gamblin
dead67ae56 Restore newlines to easy-install.pth files. (#3583)
Previous syntax fix in 8a873bb was not quite right.
2017-03-28 09:32:50 -07:00
Gregory Lee
8a873bbd8d Fix easy-install.pth syntax (#3569) 2017-03-27 10:56:55 -07:00
Adam J. Stewart
dca4d2b15e Consistent docs and usage of env mod methods (#3351) 2017-03-14 22:26:44 -07:00
Adam J. Stewart
bde0a67415 Add new package for PaGMO/PyGMO (#3210)
* Add new package for PaGMO/PyGMO

* Rename py-pygmo to pagmo

* Fix concretization bug

* Correct Python detection, use correct flags

* Install PyGMO to the pagmo prefix, not the Python prefix
2017-03-02 18:35:19 -06:00
Gregory Lee
6bc7be9217 updated config file name for Python 3.6 (#2881) 2017-01-23 09:34:50 -08:00
Adam J. Stewart
c0aaa8fcea Add PythonPackage base class
- Add a PythonPackage class with build system support.
  - Support build phases in PythonPackage
  - Add a custom sanity check for PythonPackages
  - Get rid of nolink dependencies in python packages

- Update spack create to use new PythonPackage class

- Port most of Python packages to new PythonPackage class

- Conducted a massive install and activate of Python packages.
  - Fixed bugs introduced by install and activate.

- Update API docs on PythonPackage
2017-01-16 20:00:31 -08:00
Elizabeth Fischer
402dfe30f9 Get Rid of nobuild, nolink, and alldeps (#2765)
* Removing the nobuild, nolink, and alldeps dependency types in favor of being explicit.
* This will help with maintenance going forward, as adding more dependency types won't affect existing declared dependencies in weird ways.
* default deptype is still `('build', 'link')`
2017-01-07 19:59:02 -08:00
Gregory Lee
7b337de93e various python package version and dependency updates (#2751)
* various python package version and dependency updates

* various python package version and dependency updates
2017-01-06 08:50:06 -08:00