Compare commits

...

1672 Commits

Author SHA1 Message Date
Elizabeth Fischer
30e563bd23 Edits... 2016-08-30 23:48:34 -04:00
Elizabeth Fischer
5450f9b917 1. Rewrite of "Getting Started": everything you need to set up Spack, even on old/ornery systems. This is not a reference manual section; items covered here are covered more systematically elsewhere in the manual. Some sections were moved here from elsewhere.
2. Beginning to write three methods of application developer support.  Two methods were moved from elsewhere.
2016-08-29 23:06:38 -04:00
Elizabeth Fischer
72a3d35d0c Transferred pending changes from efischer/develop 2016-08-29 18:26:10 -04:00
Robert D. French
a21d3d353b New URL scheme for newer (and older) PDTs (#1651) 2016-08-29 10:01:04 -07:00
Todd Gamblin
2850ca60be Change spack --profile sort key for 2.6 compatibility. (#1656) 2016-08-29 09:56:54 -07:00
Robert D. French
4095eb2196 Ole' GNU nano; Actually ran flake8 (#1649) 2016-08-29 09:21:19 -07:00
Todd Gamblin
f7ee8d001a Merge pull request #1564 from adamjstewart/features/create
Suggest setuptools when creating Python package
2016-08-29 09:11:45 -07:00
Todd Gamblin
57033a62fa Merge pull request #1563 from adamjstewart/features/sphinx
Add all Sphinx dependencies
2016-08-29 09:08:46 -07:00
Todd Gamblin
31cab4bae2 Merge pull request #1619 from davydden/pkg/nwchem_macos_fix
nwchem: use basename for CC and FC
2016-08-29 06:51:14 -07:00
Denis Davydov
66ea42f8d7 nwchem: use basename for CC and FC 2016-08-29 15:15:23 +02:00
Todd Gamblin
f5c9a8c2ee Merge pull request #1650 from davydden/pkg/ape_octopus_comments
ape octopus: in-code comments
2016-08-29 06:02:19 -07:00
Denis Davydov
5333a799ea octopus: in-code comments to explain compiler flags 2016-08-29 08:45:28 +02:00
Denis Davydov
90070c317d ape: in-code comments to explain compiler flags 2016-08-29 08:45:15 +02:00
Todd Gamblin
a3f1ae8c4f Merge pull request #1041 from adamjstewart/features/matplotlib
Matplotlib Python package overhaul
2016-08-28 21:22:44 -07:00
Abhinav Bhatele
a9a29d207d add versions 2.2rc2 and 2.1 to the mvapich2 package (#1630) 2016-08-28 20:18:57 -07:00
Erik Schnetter
e119c32a9c Hot-fix for qthreads (#1632)
The download tarball for qthreads vanished. Install it from a git branch instead as temporary work-around.
2016-08-28 20:18:24 -07:00
Jeffrey Salmond
82808f944a New package: opencoarrays (#1633)
* opencoarrays: new package

* opencoarrays: remove tests from install due to (unimportant) failures in some configurations

* opencoarrays: fix flake8 errors
2016-08-28 20:17:22 -07:00
Tyler Esser
83897af710 Documentation: Fix accidental quotation. version() takes expand as a keyword. (#1640) 2016-08-28 20:16:08 -07:00
Adam J. Stewart
d39322e278 Run flake8 checks on new untracked files (#1510) 2016-08-28 19:35:09 -07:00
Robert D. French
974749aaf6 Provide mpi-less variant for nco (#1643) 2016-08-28 19:15:15 -07:00
Erik Schnetter
6acfcd82b1 Update Julia to 0.5 release branch; install some Julia package as well (#1637)
* Update Julia to 0.5 release branch; install some Julia package as well

* Add comments, correct flake8 error

* Correct flake8 error
2016-08-28 17:46:10 -07:00
Robert D. French
079d063c6d Variant for building cdo without mpi (#1638) 2016-08-28 17:43:54 -07:00
Erik Schnetter
db7c3d2de6 New package for the Mercurial (hg) version control system (#1644)
* New package "mercurial"

* Disable self-checks

The self-checks require subversion, which we don't want to require.
2016-08-28 17:31:15 -07:00
Todd Gamblin
2053db4d17 Make clang detection work on AWS Ubuntu14. 2016-08-27 17:04:46 -07:00
Todd Gamblin
7ebb17e459 Remove stale operating_system.py test per discussion in #1631
- Test has not been registered in `__init__.py` for a while and needs a
  refresh.
2016-08-25 21:20:34 -07:00
becker33
e73a1a4ec3 Merge pull request #1558 from mcfadden8/mmcfadden-features/gcc-pic-libraries
Added variant to gcc package to install PIC versions of libgfortran and libstdc++
2016-08-25 16:00:00 -07:00
Gregory Lee
77c24d4127 Merge pull request #1379 from LLNL/features/graphlib3
added stat 3.0 beta and added pygtk and dependent packages
2016-08-25 09:14:36 -07:00
Massimiliano Culpo
80754a4062 and the missing word is... (#1628) 2016-08-25 02:46:12 -07:00
Todd Gamblin
8170bcfcdd Merge pull request #1574 from ARCCA/plumed-push
Update plumed package to include optional modules
2016-08-25 02:45:33 -07:00
Andrew Williams
07e0da24c5 Reverted url to point to tarball rather than git tag 2016-08-25 10:21:56 +01:00
Todd Gamblin
22d2786940 Merge pull request #1580 from davydden/pkg/trilinos_url_fix
trilinos: switch to github url; fix missing py-numpy dependency
2016-08-25 02:10:05 -07:00
Todd Gamblin
e9bc3a9e32 Merge pull request #663 from citibeth/efischer/160327-DocumentationImprovements
[RtM] Documentation Improvements
2016-08-25 02:04:30 -07:00
Todd Gamblin
848299ba38 Merge pull request #1621 from KineticTheory/boost-intel
Boost: fix recipe for Intel compilers.
2016-08-24 15:23:29 -07:00
Kelly (KT) Thompson
2ddaabed25 + Boost: fix recipe for intel compilers.
This is the same patch provided by PR #550, but rebased against the current
develop branch. It also passes the flake8 checks.
2016-08-24 15:57:28 -06:00
Todd Gamblin
062ff13da6 Make spack info print deps in sorted order 2016-08-24 14:10:25 -07:00
Todd Gamblin
93cb2db531 Fix build dependency. 2016-08-24 14:10:12 -07:00
Todd Gamblin
a7e568b1d1 Merge branch 'eschnett/sympol' of git://github.com/eschnett/spack into eschnett-eschnett/sympol 2016-08-24 14:05:05 -07:00
Todd Gamblin
19bbe5e421 Merge pull request #1596 from eschnett/eschnett/git-update
Update git to 2.9.3
2016-08-24 14:03:04 -07:00
Todd Gamblin
86fe78f5f1 Merge pull request #1582 from eschnett/eschnett/gcc-update
Update gcc to @6.2.0
2016-08-24 14:02:54 -07:00
Elizabeth Fischer
85be3aefa7 Put url_for_version() after versions in example. 2016-08-24 15:26:19 -04:00
Todd Gamblin
24c0ece841 Merge pull request #1615 from trws/module_delim_portability
avoid specifying --delim unless required
2016-08-24 12:12:44 -07:00
Tom Scogland
2b6833cb80 appeasing flake8, also cleaning up header
The header append lines were too long, so I just converted it into a
multi-line string template so it's all one piece now instead of a bunch
of appends.
2016-08-24 11:56:33 -07:00
Tom Scogland
73620fe868 avoid specifying --delim unless required
This increases portability of generated module files to versions of
environment_modules hearkening back to just after the turn of the
millennium.
2016-08-24 11:00:16 -07:00
Todd Gamblin
e6bac6f208 Merge pull request #1613 from eschnett/eschnett/cmake-update
Update cmake to 3.6.1
2016-08-24 08:49:33 -07:00
Todd Gamblin
63859bf113 Merge pull request #1575 from davydden/pkg/nwchem
nwchem: add new package
2016-08-24 08:49:11 -07:00
Todd Gamblin
5cfa74801f Merge pull request #1565 from adamjstewart/features/fftw
Add latest version of fftw
2016-08-24 08:49:00 -07:00
Adam J. Stewart
5970b7a00a Only run tests if explicitly requested 2016-08-24 10:34:20 -05:00
Erik Schnetter
41750ce70d Update cmake to 3.6.1 2016-08-24 10:45:13 -04:00
Denis Davydov
d154f151aa py-cclib: new package 2016-08-24 16:26:35 +02:00
Denis Davydov
6d2d5806b5 nwchem: add python module 2016-08-24 13:40:02 +02:00
citibeth
8a481e7e13 Added CMake-based Development case study to docuemntation. 2016-08-23 16:39:01 -04:00
Elizabeth F
86d39255ec Explained url_for_version() 2016-08-23 16:39:01 -04:00
citibeth
2efd7a5e0b Added note on use of 'less -R' for colorized output. 2016-08-23 16:36:02 -04:00
Denis Davydov
dae219d5c3 nwchem: add another patch 2016-08-23 22:24:16 +02:00
Denis Davydov
459b6eae11 nwchem: add another patch 2016-08-23 22:15:38 +02:00
Erik Schnetter
3194f2001b Update git to 2.9.3 2016-08-23 15:35:43 -04:00
Erik Schnetter
05f5ba4bf9 Correct flake8 errors 2016-08-23 14:57:29 -04:00
Erik Schnetter
73cae8d9c4 Implement review requests
- use two empty lines before `class`
- change version numbering scheme for packages, use `url_for_version` to make things work
- specify dependency types
- add comment about temporarily moved download location
- update two packages to newer versions
2016-08-23 13:52:28 -04:00
Denis Davydov
52ae0ea055 trilinos: use version.dashed 2016-08-23 18:48:17 +02:00
Todd Gamblin
de12a34415 Merge pull request #1586 from davidbeckingsale/patch-1
Ensure RAJA builds out-of-source
2016-08-23 08:55:50 -07:00
David Beckingsale
243d516bf0 Ensure RAJA builds out-of-source 2016-08-23 08:18:26 -07:00
Denis Davydov
6500ac80e4 nwchem: fix lapack detection 2016-08-23 16:46:40 +02:00
Erik Schnetter
a2692e4ef5 sympol: Add package 2016-08-23 10:41:08 -04:00
Erik Schnetter
bdc825fc3c cddlib: Point download url to a (more reliable) Fedora server 2016-08-23 09:59:56 -04:00
Erik Schnetter
64d3f87e60 Merge branch 'develop' into eschnett/sympol 2016-08-23 09:45:46 -04:00
Denis Davydov
7eb386e55e nwchem: add patches 2016-08-23 14:52:18 +02:00
Denis Davydov
5da9116c06 nwchem: add scalapack; extra steps for 32bit blas/lapack 2016-08-23 11:55:00 +02:00
Denis Davydov
aca8576de4 trilinos: switch to github url; fix missing py-numpy dependency 2016-08-23 10:50:08 +02:00
Todd Gamblin
e81f3daa28 Merge pull request #1519 from mathstuf/fix-deptypes
Fix deptypes
2016-08-22 21:40:25 -07:00
Erik Schnetter
7b49166f9b Update gcc to @6.2.0
Also add some missing older version.
Update download location to original GNU location.
2016-08-22 20:26:54 -04:00
Denis Davydov
a44beee172 nwchem: add new package 2016-08-23 02:22:44 +02:00
Andrew Williams
65abd279cd Renamed intelmpi as suggested 2016-08-22 13:44:21 +01:00
Andrew Williams
87d15212eb Cleaned branch to only include plumed package 2016-08-22 12:30:17 +01:00
Andrew Williams
4b354cbe26 Merge pull request #1 from ARCCA/plumed
Plumed
2016-08-22 12:15:35 +01:00
Andrew Williams
226d4f04f3 Spelling tweaks and consistent quoting 2016-08-22 12:09:50 +01:00
Andrew Williams
5661afa315 Passed flake8 tests 2016-08-22 12:03:47 +01:00
Andrew Williams
0c8462723b Found upstream plumed package and modified this one to match 2016-08-22 11:24:03 +01:00
Todd Gamblin
fbe76c41fd Merge pull request #1570 from eschnett/eschnett/hdf5-blosc-2
hdf5-blosc: Correct download url
2016-08-21 12:12:09 -07:00
Erik Schnetter
78685addbb hdf5-blosc: Correct download url 2016-08-21 14:39:54 -04:00
Todd Gamblin
55b1182a4c Merge pull request #1554 from eschnett/eschnett/hdf5-blosc
hdf5-blosc: Remove commit id from version specification
2016-08-21 09:44:25 -07:00
Adam J. Stewart
d5903e4612 Flake8 2016-08-19 17:06:34 -05:00
Adam J. Stewart
f0f2c6c486 Add latest version of fftw 2016-08-19 17:05:14 -05:00
Gregory L. Lee
a177b9be8a updated stat 3.0.0b url 2016-08-19 13:11:21 -07:00
Adam J. Stewart
df623dad15 Suggest setuptools when creating Python package 2016-08-19 14:31:42 -05:00
Adam J. Stewart
835b8f246e py-sphinx requires py-setuptools during runtime 2016-08-19 14:20:31 -05:00
Adam J. Stewart
d7873b5319 Swap lowercase for uppercase in URL 2016-08-19 14:00:50 -05:00
Adam J. Stewart
c1af0d3806 Fix binary conflicts during sphinx activation 2016-08-19 13:54:22 -05:00
Adam J. Stewart
d4e3699510 Add all Sphinx dependencies 2016-08-19 13:44:00 -05:00
Erik Schnetter
466da3afcc Remove commented-out outdated commit id 2016-08-19 11:52:40 -04:00
Andrew Williams
90e5ccd98c Cleaned up commented out code in intelmpi package 2016-08-19 15:01:46 +01:00
Andrew Williams
13f636ec68 Added required arguments to get plumed to build with intelmpi 2016-08-19 15:00:21 +01:00
Tom Scogland
c8dd1bb40b Merge pull request #1527 from SteVwonder/py-cffi-rpath-fix
py-cffi: set LDSHARED in env so that rpath is set
2016-08-18 11:55:40 -07:00
Stephen Herbein
3445a781eb py-cffi: set LDSHARED env so that rpath is set
py-cffi's .so was being built without the rpath being set.  distutils
looks at the LDSHARED for which compiler to use to build the final .so.
Since it was not set, distutils fell back to the system provided
compiler.  Setting it forces the shared library to be compiled with the
spack compiler (meaning that the rpath is set correctly).
2016-08-18 11:32:19 -07:00
Andrew Williams
6641f42417 Not compiling due to mpi error. Also getting this error from the command line so could be separate issue. Otherwise package definition first draft complete. 2016-08-18 13:19:36 +01:00
Erik Schnetter
296212d78d hdf5-blosc: Remove commit id from version specification
The respective commit seems to have vanished.
Now using the master branch without specifying a particular commit.
2016-08-17 16:36:33 -04:00
Marty McFadden
f4ec99ecb4 Added +piclibs variant for building PIC versions of libgfortran.a and libstdc++.a 2016-08-17 09:28:21 -07:00
Andrew Williams
b99e945e6d Added variants and dependencies to plumed but I'm getting an error when trying to resolve mpi to a valid virtual package 2016-08-17 15:43:59 +01:00
becker33
7f57405eac Merge pull request #1531 from davydden/pkg/ape
ape: add new package
2016-08-16 10:52:27 -07:00
becker33
e8afbfbce7 Merge pull request #1530 from davydden/pkg/octopus
octopus: new package
2016-08-16 10:49:41 -07:00
Denis Davydov
5dcc0f7802 ape: add new package 2016-08-16 19:42:32 +02:00
Denis Davydov
9509c10064 octopus: new package 2016-08-16 19:38:38 +02:00
Gregory L. Lee
f182590aae added pkg-config to build deps of cairo and pixman 2016-08-15 15:17:53 -07:00
Gregory L. Lee
54ef9443d3 fix atk url_for_version 2016-08-15 13:51:54 -07:00
Gregory L. Lee
74dd7a36b5 allow parallel build of stat 2016-08-15 13:51:54 -07:00
Gregory L. Lee
749a4e78c7 gobject-introspection requires glib version 2.48.1 2016-08-15 13:51:54 -07:00
Gregory L. Lee
3df208efc0 stat and dependences package updates 2016-08-15 13:51:53 -07:00
Gregory L. Lee
69931996bf added dyninst patches for stat+dysect 2016-08-15 13:51:53 -07:00
Gregory L. Lee
f9cb21e886 flake 8 fixes for dyninst 2016-08-15 13:51:53 -07:00
Gregory L. Lee
0074ecd6fa dyninst package use spec.satisfies instead of @when 2016-08-15 13:51:52 -07:00
Gregory L. Lee
8b94937609 flake 8 fixes for stat and dependents
flake 8 fixes for dyninst

flake 8 fixes for dyninst

flake 8 fixes for dyninst
2016-08-15 13:50:39 -07:00
Gregory L. Lee
bd8aab00e4 updated stat and added pygtk and dependent packages 2016-08-15 13:48:58 -07:00
Todd Gamblin
ae20e53cfb Merge pull request #1524 from epfl-scitas/bugfix/urls
stripping the links to remove spaces and '\n'
2016-08-15 13:42:38 -07:00
Nicolas Richart
37faa41b6f stripping the links to remove spaces and '\n' 2016-08-15 21:13:25 +02:00
Todd Gamblin
1e673bfa42 Don't assume spack is in the path when buildign docs. 2016-08-15 10:49:09 -07:00
Andrew Williams
27793d97dc temp commit in current state 2016-08-15 16:16:00 +01:00
Ben Boeckel
9ec1c0e18e opencv: make py-numpy a nolink dependency 2016-08-15 10:47:00 -04:00
Ben Boeckel
042666eb7e go: mark git as also being a runtime dependency 2016-08-15 10:46:45 -04:00
Ben Boeckel
826732efec packages: mark builddeps as type='build'
Less sure about these.
2016-08-15 10:46:23 -04:00
Ben Boeckel
eb13cbe9bd r-datatable: fix nolink dependency 2016-08-15 10:46:05 -04:00
Ben Boeckel
0d17d90b29 packages: mark builddeps as type='build' 2016-08-15 10:45:19 -04:00
Andrew Williams
3edfa390f7 Basic package file for plumed and boilerplate for external intel mpi 2016-08-15 11:19:40 +01:00
Adam J. Stewart
bc64990bc6 Replace python('setup.py' with setup_py( 2016-08-12 12:16:48 -05:00
Todd Gamblin
483e4116c0 Merge pull request #1509 from adamjstewart/docs/md5
Update documentation for spack md5
2016-08-12 09:19:36 -07:00
Todd Gamblin
e1c2ea5123 Merge pull request #1342 from adamjstewart/features/cgns
Add CGNS package
2016-08-12 09:19:07 -07:00
Adam J. Stewart
c815aed207 Update documentation for spack md5 2016-08-12 10:51:56 -05:00
Adam J. Stewart
d4377c1293 Add Python 3.5 support, latest version of PySide 2016-08-12 09:59:38 -05:00
Adam J. Stewart
633e540a17 Use GitHub URL for ImageMagick 2016-08-11 14:13:33 -05:00
becker33
ec7f58bf96 Merge pull request #1493 from xjrc/bugfix/nonbool-variants
Bug Fix : Allow Packages to Have Variants w/ Non-Bool, Non-String Defaults
2016-08-11 11:33:54 -07:00
becker33
1be63348b5 Merge pull request #1484 from mpbelhorn/olcf/correct_cce_compiler_name
Olcf/correct cce compiler name
2016-08-11 11:30:36 -07:00
Matt Belhorn
568305ddff Corrects Cray compiler name and adds missing version flag. 2016-08-11 13:56:21 -04:00
Todd Gamblin
cd6c370303 Merge pull request #1480 from adamjstewart/features/run-flake8
Various improvements to run-flake8
2016-08-11 10:31:43 -07:00
Adam J. Stewart
f147d64527 Rebase messed up flake8 2016-08-11 11:01:57 -05:00
Adam J. Stewart
04cee45ac9 Skip webengine until webkit support is added 2016-08-11 10:33:43 -05:00
Adam J. Stewart
2b0444b6f4 Latest version of pyside still has problems, add deps 2016-08-11 10:33:43 -05:00
Adam J. Stewart
b6fad65f52 Combine patch for all versions
Patch doesn't work with @when unless you specify a patch for every
version. When running `spack patch` for a version without a patch,
spack thinks that a patch exists, tries to apply it, but it doesn't
exist. Spack gets very confused.
2016-08-11 10:33:43 -05:00
Adam J. Stewart
1363b05e93 Add test dependencies 2016-08-11 10:33:43 -05:00
Adam J. Stewart
5cc76f7d84 Fix patch for py-pyside 1.2.4 2016-08-11 10:33:43 -05:00
Adam J. Stewart
59ce0c7514 Add patch to build qt 4 with GCC 6 2016-08-11 10:33:42 -05:00
Adam J. Stewart
ddf1879bed Remove glib dependency, causes problems with PCRE and JavaScript 2016-08-11 10:33:02 -05:00
Adam J. Stewart
90dd26397c Fix qt patch 2016-08-11 10:33:02 -05:00
Adam J. Stewart
7135299a66 Add latest version of pcre 2016-08-11 10:33:02 -05:00
Adam J. Stewart
ac15d5d619 Add patch for qt gamepad compilation problems 2016-08-11 10:33:01 -05:00
Adam J. Stewart
eac9a5905f Flake8 and url_for_version changes 2016-08-11 10:33:01 -05:00
Adam J. Stewart
80742b2647 Add latest version of qt 2016-08-11 10:30:31 -05:00
Adam J. Stewart
8a0824df09 Update matplotlibrc filtering for GUI backends 2016-08-11 10:28:35 -05:00
Adam J. Stewart
a388871083 Update ImageMagick to latest version 2016-08-11 10:28:35 -05:00
Adam J. Stewart
2b83ea30e7 Re-add ipython support 2016-08-11 10:28:35 -05:00
Adam J. Stewart
f56de63972 Fix cycler dependencies, update qhull version names 2016-08-11 10:28:35 -05:00
Adam J. Stewart
0b8a3ad8ad Flake8 2016-08-11 10:28:34 -05:00
Adam J. Stewart
aa6a6df640 Undo changes to GUI framework 2016-08-11 10:28:34 -05:00
Adam J. Stewart
e905ce16c9 Flake8 2016-08-11 10:28:34 -05:00
Adam J. Stewart
11e595089d Matplotlib overhaul 2016-08-11 10:28:33 -05:00
Adam J. Stewart
87d0a7c315 Always clean up tmp files, even if killed 2016-08-11 09:56:41 -05:00
Adam J. Stewart
09c9786fab Allow run-flake8 to be run from anywhere 2016-08-11 09:53:04 -05:00
Adam J. Stewart
1edfc82123 Run flake8 checks on changed uncommitted files 2016-08-11 09:53:04 -05:00
Todd Gamblin
e6a122417a Merge pull request #1491 from eschnett/eschnett/curl
Update curl to 7.50.1
2016-08-11 03:04:07 -07:00
becker33
f59653ac2c Merge pull request #1496 from LLNL/features/pep8-compliance
PEP8 compliance
2016-08-10 17:36:31 -07:00
Todd Gamblin
84e331c586 Remove unneeded noqa comments. 2016-08-10 16:33:39 -07:00
Todd Gamblin
db59f87e32 Update README.md for PEP8 2016-08-10 16:33:39 -07:00
Todd Gamblin
240f1fd223 Spack packages now PEP8 compliant. 2016-08-10 16:33:39 -07:00
Todd Gamblin
867121ca68 Move jsonschema files out of config.py to their own package. 2016-08-10 16:33:38 -07:00
Todd Gamblin
bf1072c902 Make Spack core PEP8 compliant. 2016-08-10 16:33:37 -07:00
Todd Gamblin
8061deb883 Merge pull request #1495 from LLNL/bugfix/module-init-deprecation-gh1494
Fix superclass constructor args.
2016-08-10 16:12:23 -07:00
Todd Gamblin
e7f4fd404d Fix superclass constructor for SpackNamespace objects. 2016-08-10 15:54:13 -07:00
Joseph Ciurej
aa860bf4df Fixed a bug that was making packages with non-bool default variants to crash. 2016-08-10 11:54:33 -07:00
Erik Schnetter
158deae625 Update curl to 7.50.1 2016-08-10 13:51:57 -04:00
becker33
cfde03e694 Merge pull request #1485 from hartzell/patch-6
Fix typo 'flexbile' -> 'flexible'
2016-08-09 15:34:51 -07:00
George Hartzell
4bca1c5440 Fix typo 'flexbile' -> 'flexible' 2016-08-09 15:13:08 -07:00
Todd Gamblin
d380d16427 Merge pull request #1482 from mpbelhorn/olcf/do_not_use_ssl_to_fetch_upstream_openssl
Openssl package should not require openssl (https) to obtain source.
2016-08-09 13:22:31 -07:00
Matt Belhorn
2be065418b Openssl package should not require openssl (https) to obtain source. 2016-08-09 15:57:07 -04:00
Todd Gamblin
a095fd517f Merge pull request #1015 from LLNL/features/faster-virtuals
Faster virtuals and concretization
2016-08-09 10:33:40 -07:00
becker33
fb9f6fe9b5 Merge pull request #1473 from epfl-scitas/packages/plumed_dependents
plumed : added dependents (gromacs, cp2k)
2016-08-09 09:14:33 -07:00
Todd Gamblin
9d4a36a62f Properly re-raise exceptions from lock context handler. 2016-08-09 02:25:09 -07:00
Todd Gamblin
0c75c13cc0 Flake8 fixes 2016-08-09 02:25:07 -07:00
alalazo
38dcd6bce9 qa : flake8 issues 2016-08-09 09:54:24 +02:00
Todd Gamblin
102ac7bcf1 Move provider cache to home directory and refactor Transactions
Major stuff:

- Created a FileCache for managing user cache files in Spack.  Currently just
  handles virtuals.

- Moved virtual cache from the repository to the home directory so that users do
  not need write access to Spack repositories to use them.

- Refactored `Transaction` class in `database.py` -- moved it to
  `LockTransaction` in `lock.py` and made it reusable by other classes.

Other additions:

- Added tests for file cache and transactions.

- Added a few more tests for database

- Fixed bug in DB where writes could happen even if exceptions were raised
  during a transaction.

- `spack uninstall` now attempts to repair the database when it discovers that a
  prefix doesn't exist but a DB record does.
2016-08-09 00:24:54 -07:00
alalazo
5362864cc9 plumed : fixed name clash on attribute 2016-08-09 09:24:36 +02:00
Massimiliano Culpo
15d9fb1879 plumed : adding dependents
* cp2k : added plumed
* gromacs : patched pme load balancing
* gromacs : added plumed
2016-08-09 09:23:53 +02:00
Todd Gamblin
2042e9a6d8 Fix bugs with sparse spec printing.
- Make namespace, arch, and dependnecies show up in spec yaml
  only if they're set.

- Lost some of this functionality with deptypes
2016-08-08 21:04:23 -07:00
Todd Gamblin
1339714eec Restore text output in verbose mode. 2016-08-08 21:04:23 -07:00
Todd Gamblin
5d690c9270 Make compiler command test last until caching is fixed.
- global compiler cache breaks tests that come after this one.
2016-08-08 21:04:23 -07:00
Todd Gamblin
e5743db9b9 Fix issues with import order in tests.
- modules weren't set properly as attributes in parent modules
2016-08-08 21:04:23 -07:00
Todd Gamblin
d195576fba WIP 2016-08-08 21:04:23 -07:00
Todd Gamblin
5e5024342f Fix iterator invalidation issues. 2016-08-08 21:04:23 -07:00
Todd Gamblin
4de45c2684 fix scoping issue. 2016-08-08 21:04:23 -07:00
Todd Gamblin
ce6ac93abe rename virtual module to provider_index 2016-08-08 21:04:23 -07:00
Todd Gamblin
1f5a21decf Fix namespace support in Repo.get_pkg_class() 2016-08-08 21:04:23 -07:00
Todd Gamblin
ab049eca41 Faster key in FlagMap._cmp_key 2016-08-08 21:04:23 -07:00
Todd Gamblin
37fc258313 Remove vestigial methods from Package. 2016-08-08 21:04:23 -07:00
Todd Gamblin
faa0a0e4c3 Add a ProviderIndex cache.
- Spack will check if the index needs updating, and will only parse
  all package files if it does.

- Spack tries to parse as few package files as necessary.
2016-08-08 21:04:23 -07:00
Todd Gamblin
cf2f902b82 Make ProviderIndexes mergeable, so we can cache them per-repo. 2016-08-08 21:04:23 -07:00
Todd Gamblin
bf028990e7 Make ProviderIndex yaml-izable.
- allow a provider index to be stored and re-read.
2016-08-08 21:04:23 -07:00
Todd Gamblin
025609c63f More compact YAML formatting for abstract specs.
- Don't add empty/absent fields to Spec YAML when they're not there.
2016-08-08 21:04:23 -07:00
Todd Gamblin
7aaad89ba9 Lazily evaluate all_package_names in repository.py
- Don't need to list all packages unless we have to.

- Only use the list of all packages for existence checks if we have
  generated it for some other purpose.
2016-08-08 21:04:23 -07:00
becker33
2b94d7cf8e Merge pull request #1472 from adamjstewart/fixes/rstrip
Only strip newline chars, not spaces
2016-08-08 13:28:56 -07:00
Adam J. Stewart
5d48c108a3 Only strip newline chars, not spaces 2016-08-08 15:02:05 -05:00
becker33
3ea1325620 Merge pull request #1345 from hartzell/feature/add-perl-dependency-to-git
Add depends_on('perl'), depends_on('pcre') to git package
2016-08-08 09:44:50 -07:00
Todd Gamblin
dd30066feb Merge pull request #1449 from hartzell/feature/add-package-for-prank
Add package for prank and supporting tools
2016-08-07 23:43:40 -07:00
Todd Gamblin
e65a8b6a9a Merge pull request #1463 from davydden/pkg/opium
opium: add new package
2016-08-07 15:56:27 -07:00
Todd Gamblin
8121ac2c27 Merge pull request #1464 from hartzell/feature/update-lmod
No need to patch Lmod after 6.4.4
2016-08-07 15:55:16 -07:00
Todd Gamblin
93f5a750cb Merge pull request #1465 from glennpj/pango_url
Add list_url to pango package
2016-08-07 15:55:04 -07:00
Todd Gamblin
281f6f18e1 Merge pull request #1466 from pramodk/develop
PDT should download full installer package
2016-08-07 15:54:50 -07:00
Denis Davydov
db87a9d3ce tar: fix 1.28 on macOS; add 1.29 (#1462) 2016-08-07 15:54:01 -07:00
Adam J. Stewart
d7329d7bc2 Fix erroneously stripped trailing whitespace in patch (#1467) 2016-08-07 15:53:25 -07:00
Pramod Kumbhar
e9edfec0ec PDT should download full installer package pdtoolkit-X.tar.gz (default pdt-X.tar.gz is only for x86 and cray) 2016-08-07 01:14:26 +02:00
Glenn Johnson
2ad21e7070 Add list_url to pango package
Added a `list_url` so the updated pango tar file can be retrieved.
2016-08-06 18:12:47 -05:00
George Hartzell
09d96bef9f No need to patch Lmod after 6.4.4
The Lmod author changed the src so that it uses the tclsh (and shared
libraries) discovered at configure time.  He did it differently that I
did in this patch, but he changes solve our problem too, so...
2016-08-06 17:39:05 -04:00
George Hartzell
9ebbde0e01 Make configure use our gettext library
The configure script needs extra encouragement to link against our
gettext/libintl library.
2016-08-06 16:28:47 -04:00
George Hartzell
1de5817b58 Clean up rebase problems
My rebase duplicated the depends_on('zlib') and dropped the --with-curl
from the configure.

This fixes those.
2016-08-06 16:28:47 -04:00
George Hartzell
f699d7c08e [Whitespace] Gather the depends_on's together. 2016-08-06 16:28:47 -04:00
George Hartzell
152fa33a55 Call configure --with-libpcre=... to use our pcre
An earlier commit claimed that this package depends_on('pcre') but I
didn't fix the call to configure that enabled it.

This fixes that.
2016-08-06 16:28:47 -04:00
George Hartzell
3cf2fd40a8 Enable depends_on('pcre') also
While I have the patient on the operating table, @adamjstewart asked
me to uncomment and test the depends_on('pcre').

Did it and it Works For Me(tm).
2016-08-06 16:28:47 -04:00
George Hartzell
653905e3a2 Add depends_on('perl') to git package
This commit changes the git package to depend_on('perl').  The system
perl is not always sufficient to install git (e.g. a CentOS7 system with
the development tools group installed has perl but not the
ExtUtils::MakeMaker package that git needs) and one can't always update
the system's perl.

This PR depends_on PR #1339, which adds a perl package to spack.
2016-08-06 16:28:47 -04:00
George Hartzell
f800708ef3 Switch to using *std_cmake_args 2016-08-06 16:27:40 -04:00
George Hartzell
6a62a6b693 Flake8 whitespace cleanup 2016-08-06 16:27:40 -04:00
George Hartzell
a07a0ef54b Add Bio++ tool suite and supporting libs
Add the Bio++ suite and its supporting libraries.
2016-08-06 16:27:40 -04:00
George Hartzell
3c81bb44ba Add package for mafft 2016-08-06 16:27:40 -04:00
George Hartzell
e0db1f0268 Add package for exonerate 2016-08-06 16:27:40 -04:00
George Hartzell
9e16902397 Fix name of bpp-suite (missing -...) 2016-08-06 16:27:40 -04:00
George Hartzell
63592096c5 Add package for prank 2016-08-06 16:27:40 -04:00
Denis Davydov
4983ebcf7c opium: add new package 2016-08-06 21:35:52 +02:00
becker33
d3f115933e Merge pull request #1451 from hartzell/feature/add-package-for-fastx_toolkit
Add package for fastx toolkit
2016-08-05 15:09:46 -07:00
becker33
18d155e713 Merge pull request #1452 from hartzell/feature/add-package-for-samtools
Add package for samtools
2016-08-05 15:09:41 -07:00
George Hartzell
a6afaeb974 Remove lingering FIXME commentary 2016-08-05 17:51:24 -04:00
George Hartzell
769408130a Samtools depends on htslib from 1.3.1 onward
Samtools used to (before 1.3.1) include it's own copy of htslib.  Going
forward, it needs to use the standalone htslib.
2016-08-05 17:47:11 -04:00
becker33
90f68d2c66 Merge pull request #1460 from glennpj/fix_list_vcs
Catch error for version in VCS
2016-08-05 13:34:37 -07:00
becker33
8e20a14945 Merge pull request #1453 from hartzell/feature/add-package-for-seqtk
Add package for seqtk
2016-08-05 10:25:19 -07:00
becker33
f403f256ca Merge pull request #1450 from hartzell/feature/add-package-for-bwa
Add package for bwa
2016-08-05 10:21:10 -07:00
Glenn Johnson
20221ee3aa Catch error for version in VCS
This PR will catch the error where the url can not be determined from a
VCS URL, such as git. It will print a message to the console and move on
because it should not be a fatal error at this point in the process.

This should fix #1459.
2016-08-05 11:16:43 -05:00
becker33
594a6710ed Merge pull request #1442 from suraia/update-scorep-2.0
Update Score-P to 2.0

Most likely this can be generalized to link against older versions of dependencies, but it looks good for now.
2016-08-05 08:57:25 -07:00
George Hartzell
d6dedee6ff Flake8 cleanup 2016-08-04 15:23:04 -04:00
Bruno Turcksin
0c02ee86a7 Add Trilinos 12.6.4 (#1447) 2016-08-04 11:29:10 -07:00
George Hartzell
e12d7aadda Add package for seqtk
Seqtk is a tool for working with fast[aq] files.
2016-08-04 14:18:03 -04:00
George Hartzell
fd11db92e1 Add package for bcftools 2016-08-04 14:18:03 -04:00
George Hartzell
ba0577dc96 Update samtools to support v1.3.1
Update the samtools package to support v1.3.1, which
- now uses configure script; and
- now depends on external htslib package.

The dependency on mpc seems to have been bogus, it's never linked in,
nor is it mentioned in the source tree.  I *do* have a version in
/usr/lib64, but ldd does not sure it being linked in either....

By depending on 'ncurses' I can do away with the need for the patch.
2016-08-04 14:18:03 -04:00
George Hartzell
ef1369c365 Add package for htslib
Htslib was pulled out of samtools and made into a standalone thing.
This commit adds a packag for it, in support of the samtools package.
2016-08-04 14:18:03 -04:00
George Hartzell
e17862c421 Add package for fastx toolkit
Tools for working with FASTA/FASTQ files.
2016-08-04 14:18:02 -04:00
George Hartzell
d5bb2955b1 Add package for libgtextutils
Gordon's Text utils Library, in support of fastx toolkit.
2016-08-04 14:18:02 -04:00
George Hartzell
d4274b32f2 Make flake8 happy (long lines) 2016-08-04 14:18:01 -04:00
Todd Gamblin
6ab78eb88e sbang filtering now works on non-writable files. (#1445)
- sbang now changes mode to writable and restores mode if a file is not
  writable.
2016-08-04 10:46:45 -07:00
Michael Kuhn
d7665a63e3 flake8 fixes 2016-08-04 19:04:48 +02:00
becker33
369b2ef01f Merge pull request #1330 from suraia/fix-ascii-graph
Fix graph command with ASCII output
2016-08-04 09:37:24 -07:00
becker33
1ac1cc3d2c Merge pull request #1437 from jgalarowicz/update-xercesc
Update the version of xerces-c, where the developers remove the old v…
2016-08-04 09:00:36 -07:00
becker33
3c6f6fc811 Merge pull request #1438 from jgalarowicz/update-libmonitor
Update libmonitor to use its new github location, it does not exist w…
2016-08-04 08:59:35 -07:00
becker33
bacfa91cfd Merge pull request #1444 from tobbez/fix_indent_spider
Fix incorrect indentation in spack.util.web._spider
2016-08-04 08:44:35 -07:00
becker33
cabcdf0ec9 Merge pull request #1443 from davydden/pkg/dealii_python
dealii: add optional python bindings
2016-08-04 08:43:36 -07:00
becker33
fcc8b1d3e4 Merge pull request #1431 from hartzell/feature/add-package-for-unison
Add package for unison (and ocaml)
2016-08-04 08:41:45 -07:00
Torbjörn Lönnemark
61b3ecb6d2 Fix flake8 issues 2016-08-04 16:28:14 +02:00
Denis Davydov
af8741c23c dealii: add optional python bindings 2016-08-04 16:11:14 +02:00
Torbjörn Lönnemark
a591e183bc Fix incorrect indentation 2016-08-04 16:09:49 +02:00
Michael Kuhn
584e5506f2 Update Score-P to 2.0 2016-08-04 14:24:25 +02:00
Michael Kuhn
2bd1a51193 flake8 fixes 2016-08-04 13:07:33 +02:00
Michael Kuhn
1578a95982 Fix tests. 2016-08-04 13:07:33 +02:00
Michael Kuhn
7affaca321 Fix graph command with ASCII output. 2016-08-04 13:07:33 +02:00
Todd Gamblin
b7fa2c4e21 Fix #1429: Remove git dep from gettext; break circular dependency.
- It's not really a circular dependency -- git is a run dependency of gettext

- We can revert this change when Spack is smart enough to make git a run
  dependency and build it.
2016-08-03 21:53:53 -07:00
Jim Galarowicz
2e1dbd0697 Fix flake8 errors for: Update libmonitor to use its new github location, it does not exist where the package file now points to. 2016-08-03 21:32:15 -05:00
Jim Galarowicz
e69423a154 Fix flake8 errors for Update the version of xerces-c, where the developers remove the old version, so there is no fallback. 2016-08-03 21:28:56 -05:00
Jim Galarowicz
e68b7d8c63 Update libmonitor to use its new github location, it does not exist where the package file now points to. 2016-08-03 21:08:48 -05:00
Jim Galarowicz
638f779841 Update the version of xerces-c, where the developers remove the old version, so there is no fallback. 2016-08-03 21:04:17 -05:00
Todd Gamblin
be1158f7a3 Merge pull request #1433 from JRWynneIII/error_message_fix
Fix typo for error message when compiler doesn't exist for arch
2016-08-03 14:29:08 -07:00
James Riley Wynne III
f0609699ba Added parens to %'s arguments. Fixes #1432 2016-08-03 17:16:04 -04:00
George Hartzell
43371c31a2 Flake8 cleanup 2016-08-03 16:51:53 -04:00
Todd Gamblin
dce105d16f Merge pull request #1382 from KineticTheory/gktplus3-deps
GTK+3: Provide updates to package dependencies.
2016-08-03 13:45:18 -07:00
George Hartzell
4acf6d76bf Add package for unison
Add package for unison (the file synchronizer).

Needs the ocaml compiler to build.
2016-08-03 16:41:31 -04:00
George Hartzell
a7bfaa3797 Add package for ocaml compiler
Installs the ocaml compiler.
2016-08-03 16:41:31 -04:00
Todd Gamblin
88bb67e279 Merge pull request #1430 from KineticTheory/cray-cc-recursion-fix
Cray: Fix a typo that could cause an infinite recursion when calling env/cc
2016-08-03 13:34:54 -07:00
Kelly (KT) Thompson
46e9d85283 Cray: Fix a typo that could cause an infinite recursion when calling /env/cc.
fixes #1428
2016-08-03 14:15:44 -06:00
Kelly (KT) Thompson
7c46a4c0e4 Provide minor updates after code review
+ Always depend on the gettext package. This simplifies the logic and I no
  longer need to 'import sys'
+ Only apply the patch for the older version of glib.
2016-08-03 13:26:02 -06:00
becker33
3e6ebd577f Merge pull request #1378 from LLNL/bugfix/gh-1324-intel-parallel-studio
Bugfix/gh 1324 intel parallel studio
2016-08-03 10:46:40 -07:00
becker33
353726f08f Merge pull request #1156 from adamjstewart/features/py-meep
Add py-meep package and dependencies

Merging to add the gettext support, will submit a separate issue for the LD_LIBRARY_PATH issue with MPI and py-meep
2016-08-03 10:07:05 -07:00
becker33
7ae163d436 Merge pull request #1361 from epfl-scitas/features/module_token_expansion_in_environment
module : token expansion in environment
2016-08-03 09:49:28 -07:00
becker33
b9195b415a Merge pull request #1420 from epfl-scitas/packages/plumed
plumed : added package
2016-08-03 08:36:31 -07:00
alalazo
2f1c000f62 qa : flake8 issues 2016-08-03 08:26:58 +02:00
Kelly (KT) Thompson
d7d12aa2dc One more formatting change to make flake8 happy. 2016-08-02 19:05:48 -06:00
becker33
48997cffa1 Merge pull request #1233 from hartzell/add-nextflow
First cut package for nextflow, has issues
2016-08-02 11:52:19 -07:00
becker33
4ff4eab476 Merge pull request #1236 from davydden/pkg/arpack-ng_blas
arpack-ng: fix blas/lapack libraries
2016-08-02 11:50:42 -07:00
Denis Davydov
f90692cf81 arpack-ng: fix blas/lapack libraries 2016-08-02 20:27:34 +02:00
becker33
13d9eed85b Merge pull request #1424 from adamjstewart/features/setup_py
spack create should use setup_py() instead of python()
2016-08-02 10:28:14 -07:00
Adam J. Stewart
941acef009 spack create should use setup_py() instead of python() 2016-08-02 12:20:28 -05:00
becker33
b5a117c923 Merge pull request #1366 from hartzell/feature/add-package-for-ack
Add package for ack
2016-08-02 10:11:11 -07:00
becker33
1534a115bd Merge pull request #1421 from hartzell/feature/add-package-for-texlive
Add package for texlive
2016-08-02 10:10:43 -07:00
becker33
a03a35565e Merge pull request #1339 from hartzell/features/add-perl
Add perl package
2016-08-02 10:10:04 -07:00
becker33
326b9838ed Merge pull request #1423 from glennpj/fix_url
Move archive_version setting to if block
2016-08-02 10:05:25 -07:00
George Hartzell
fa70a837d4 Remove accidentally committed cabal-install bits 2016-08-02 13:00:47 -04:00
becker33
91004158c6 Merge pull request #1243 from davydden/pkg/atlas_urls
atlas: fix urls and shared libs
2016-08-02 09:59:05 -07:00
Glenn Johnson
2929fb0a4d Move archive_version setting to if block
The archive_version variable should only get set if versions will be
checked and that is only if there is a list_url in the package file. For
VCS repos setting the variable triggers an error from web.py as it
parses the default_fetcher object.

This should fix #1422.
2016-08-02 11:54:09 -05:00
becker33
3f26bbc8b3 Merge pull request #864 from davydden/kdiff3
kdiff3: initial version of the package
2016-08-02 09:35:00 -07:00
becker33
a3322fab0a Merge pull request #1360 from glennpj/pysetuptoolsdep
Add py-setuptools dependencies to packages
2016-08-02 09:33:40 -07:00
becker33
21158195fb Merge pull request #1354 from paulhopkins/bugfix/preferred_variants_do_not_recognise_-variant
Bugfix/preferred variants do not recognise  -variant
2016-08-02 09:15:06 -07: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
becker33
9490bd2154 Merge pull request #1373 from hartzell/bug/update-several-r-packages
Update several R packages (r-shiny prereqs)
2016-08-02 09:07:31 -07:00
George Hartzell
4c8672ed1f Add previous versions back into package
Following the advice of @glennpj, added the old versions back into the
packages.

I can install the current packages and the previous packages.
2016-08-02 11:45:16 -04:00
George Hartzell
c77425bb22 Remove useless def unpack
Before I learned that I was stumbling over a real but (#1308), I thought
I needed to arrange for the fetcher to skip the unpack step.

This commit removes the useful `def unpack`.
2016-08-02 11:32:19 -04:00
George Hartzell
a6605d842b Flake8 cleanup. 2016-08-02 11:25:03 -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
George Hartzell
949621eb7f Add package for texlive 2016-08-02 11:15:42 -04:00
George Hartzell
857a03c127 Ack should depends_on('perl')
Add a depends_on('perl') and rewrite the script's `#!` line to refer to
that Perl's `perl` executable.
2016-08-02 11:11:05 -04:00
George Hartzell
114da813a3 Remove unnecessary imports.
Now that it's sporting a cleaner install method, these imports are
unnecessary.
2016-08-02 11:11:05 -04:00
George Hartzell
bf467c5df3 Remove override of unpack(self)
I cargo culted that from my *nextflow* package.  I [thought I] needed it
to work around Spack trying to use tar to unpack something that was
neither a tar ball nor unpackable.

This package works fine without it.  In retrospect, the error that I was
seeing in the *nextflow* package was probably this problem #1308.
2016-08-02 11:11:05 -04:00
George Hartzell
6c3623422f Use cleaner mech to install script
Use @adamjstewart's nicer bit of python code in the
install method.
2016-08-02 11:11:05 -04:00
George Hartzell
63121a0c49 Add package for ack
Add a package for [ack](http://beyondgrep.com/install/).  Simply install
the fatpacked script.

It uses '#!/usr/bin/env perl' and it very much not choosy about what
perl it needs.  For now just trust that there's one available, perhaps
someday we can/should uncomment the depends_on('perl').

Follows the methodolgy I used in nextflow.  Has the same
uninstall/install problem that nextflow has, there is an issue in
progress for that: https://github.com/LLNL/spack/issues/1308.

Tested on CentOS7.
2016-08-02 11:11:05 -04:00
George Hartzell
12d1263980 Update several R packages (r-shiny prereqs)
r-jsonlite 0.0.21 -> 1.0
r-mime     0.4    -> 0.5
rcpp       0.12.5 -> 0.12.6

CRAN is funny.  The older versions of these packages are still available
in package specific directories but the current version is not there, so
I don't see any way to make the older versions work.
2016-08-02 11:10:41 -04:00
George Hartzell
6f332c7e4c Fix whitespace, make flake8 happ{y,ier}. 2016-08-02 11:10:12 -04:00
George Hartzell
bfcec69630 Add standard header, use spack helpers
Added the standard header (stolen from R).

Touched up the install to use set_executable rather than doing it
myself.
2016-08-02 11:10:12 -04:00
George Hartzell
4373a2b629 First cut package for nextflow, has issues
This is my first cut at a package to support nextflow.  It's also my
first package.  It works, but has issues.  I'm going to submit a pull
request and get some coaching on how to deal with it.

One issue particular: if I install, then uninstall, then try to install
again (which uses the cached copy of the "distribution file"), it
explodes.
2016-08-02 11:10:12 -04:00
Glenn Johnson
a57d94af03 Fix flake8 issues. 2016-08-02 09:53:57 -05:00
Denis Davydov
a1703bf70d kdiff3: add license block 2016-08-02 16:37:14 +02:00
Gilles Fourestey
dea7bbb4a0 added plumed
* plumed : first version
* plumed : added dependencies and docs
2016-08-02 15:06:46 +02:00
Denis Davydov
565bd5f51e atlas: revert to lapack 3.5.0 2016-08-02 13:52:32 +02:00
Denis Davydov
bef7e2645a atlas: flake8 fixes 2016-08-02 13:52:32 +02:00
Denis Davydov
f6a4a6b00f atlas: add install_test 2016-08-02 13:52:32 +02:00
Denis Davydov
0c0b37800d atlas: set (blas|lapack)_shared_lib 2016-08-02 13:52:32 +02:00
Denis Davydov
4ecf481337 atlas: fix shared libs; set compilers 2016-08-02 13:52:32 +02:00
Denis Davydov
6f7e12d49b atlas: fix urls and use lapack 3.6.0 2016-08-02 13:52:32 +02:00
Denis Davydov
0aa513ad70 libxau: mark pkg-config as build-type dependency 2016-08-02 13:50:46 +02:00
Denis Davydov
450c750214 kdiff3: initial version of the package 2016-08-02 13:49:40 +02:00
Denis Davydov
a4e59c2758 libxau: add missing dependency 2016-08-02 13:49:40 +02:00
Kelly (KT) Thompson
9433e84776 Formatting changes for flake8. 2016-08-01 22:54:51 -06:00
Kelly (KT) Thompson
17f0eb5148 Provide correct download urls and additional dependencies. 2016-08-01 22:10:54 -06:00
ba11f19efc Merge remote-tracking branch 'upstream/develop' into gktplus3-deps 2016-08-01 20:50:28 -06:00
becker33
bb5dd49206 Merge pull request #1419 from LLNL/bugfix-compiler-error-message
Bugfix compiler error message
2016-08-01 17:30:03 -07:00
Gregory Becker
679ceabf36 fixed flake8 errors 2016-08-01 17:22:13 -07:00
Gregory Becker
31042e8ed1 further improved error message 2016-08-01 17:16:06 -07:00
Gregory Becker
2705f2c0e3 changed error raised in concretize compiler to provide better error message 2016-08-01 17:11:10 -07:00
becker33
c678a9e3da Merge pull request #1417 from LLNL/features/combined-cray-platform-cleanup
Removed vestigial cray_xc platform in favor of combined cray platform
2016-08-01 16:26:20 -07:00
Gregory Becker
0cf1f917d5 fixed architecture test 2016-08-01 16:17:31 -07:00
becker33
bc2e0cc87c Merge pull request #1418 from mamelara/bugfix/add_import
Add import statement
2016-08-01 16:09:28 -07:00
Mario Melara
0425f5d523 Add import statement
Add missing import statement for join_path
2016-08-01 15:59:30 -07:00
Gregory Becker
0ce98d4d65 Removed vestigial cray_xc platform in favor of combined cray platform 2016-08-01 15:43:11 -07:00
becker33
7f43a7d134 Merge pull request #1376 from mpbelhorn/olcf/unified_cray_platform
Olcf/unified cray platform
2016-08-01 15:40:11 -07:00
Matt Belhorn
661708b7fa Fixes Flake8 indentation errors. 2016-08-01 17:27:33 -04:00
Matt Belhorn
ae167c09fc Prefers bash over sh.
Assuming a bash interactive environment will be correctly formed on login, we
should prefer to probe the environment using a shell that reports itself as
`bash` instead of `sh` which may not source files that set the
environment modules in statements like:

```
case "$is" in
bash) test -s /etc/bash.bashrc.local && . /etc/bash.bashrc.local ;;
ksh)  test -s /etc/ksh.kshrc.local   && . /etc/ksh.kshrc.local ;;
zsh)  test -s /etc/zsh.zshrc.local   && . /etc/zsh.zshrc.local ;;
ash)  test -s /etc/ash.ashrc.local   && . /etc/ash.ashrc.local
esac
test -s /etc/sh.shrc.local && . /etc/sh.shrc.local
```
2016-08-01 17:17:24 -04:00
becker33
14d861a41c Merge pull request #1414 from adamjstewart/fixes/filter_file
Fix backup=True for filter_file
2016-08-01 14:10:59 -07:00
Matt Belhorn
e864d27641 Replaces bash-ism source for POSIX-compliant .
Change is made in order to use `/bin/sh` on systems where `/bin/sh` is not
simply an alias for `/bin/bash --norc`.
2016-08-01 17:04:09 -04:00
becker33
b892cebe8a Merge pull request #1343 from glennpj/r_unfilter
R extension dependencies with compiler wrapper
2016-08-01 13:51:13 -07:00
becker33
49e47966a8 Merge pull request #1357 from hartzell/patch-6
Fix doc for install_tree (cut/paste error)
2016-08-01 13:45:20 -07:00
becker33
e861e35acf Merge pull request #1234 from mwilliammyers/package-opencv
Update opencv package
2016-08-01 13:44:31 -07:00
becker33
1847aa035d Merge pull request #1348 from glennpj/rcurl
r-curl update and changed remote archive
2016-08-01 13:38:38 -07:00
becker33
630ff6871d Merge pull request #1346 from glennpj/url_list_fetch
Url list fetch
2016-08-01 13:37:57 -07:00
becker33
94238eebfa Merge pull request #1381 from davydden/pkg/mkl_linux
MKL linux fixes
2016-08-01 13:36:10 -07:00
Adam J. Stewart
5b79f0d04a Fix backup=True for filter_file 2016-08-01 15:35:02 -05:00
becker33
dc9fcea989 Merge pull request #1365 from hartzell/feature/add-package-for-tree
Add package for tree
2016-08-01 13:21:09 -07:00
becker33
15514792d5 Merge pull request #1374 from hartzell/bug/fix-jdk-import-of-distutils
Bug: fix jdk package's use of distutils
2016-08-01 13:20:44 -07:00
becker33
851bc506e4 Merge pull request #1367 from adamjstewart/features/pgi
Add latest version of PGI
2016-08-01 13:07:35 -07:00
becker33
932300256c Merge pull request #1413 from mdevlin1/fixes/libxsmm
Fixed libxsmm package
2016-08-01 13:06:05 -07:00
becker33
6361f5c2d4 Merge pull request #1359 from sknigh/libhio
added libhio package
2016-08-01 13:05:29 -07:00
Mitchell Devlin
2d51ea5da4 fixed libxsmm makefile filter 2016-08-01 14:38:16 -05:00
Adam J. Stewart
fed7ba1dab Add latest version of PGI 2016-08-01 13:42:00 -05:00
Glenn Johnson
19578d954f Fix flake8 line length errors 2016-08-01 13:37:42 -05:00
Adam J. Stewart
ab885a5397 Allow git to depend on gettext now that it works 2016-08-01 13:35:22 -05:00
Adam J. Stewart
4014a29d2b Use proper deptype so that spack activate works 2016-08-01 13:35:22 -05:00
Adam J. Stewart
b4cd2a85df Re-add trailing whitespace in patch 2016-08-01 13:35:22 -05:00
Adam J. Stewart
f5aed63b0b pkg-config should be a build dependency only 2016-08-01 13:35:22 -05:00
Adam J. Stewart
5cac0a528c Fix undefined symbols by building shared libraries 2016-08-01 13:35:22 -05:00
Adam J. Stewart
bdb64c2e39 Tell MEEP where to find libctl 2016-08-01 13:35:22 -05:00
Adam J. Stewart
0903ae0599 Final fixes to get libctl working 2016-08-01 13:35:22 -05:00
Adam J. Stewart
1e3a5d4e26 Final fixes to get guile to build 2016-08-01 13:35:21 -05:00
Adam J. Stewart
6db99a4fe7 Rename gc => bdw-gc, fix libunistring bug 2016-08-01 13:35:21 -05:00
Adam J. Stewart
5b1a882fc2 Update meep's url_for_version 2016-08-01 13:35:21 -05:00
Adam J. Stewart
a2578c21e4 Supply flags to bdist 2016-08-01 13:35:21 -05:00
Adam J. Stewart
8d0758fc4c Allow py-meep to link properly 2016-08-01 13:35:21 -05:00
Adam J. Stewart
880cbb2217 Better testing for MEEP 2016-08-01 13:35:21 -05:00
Adam J. Stewart
3b4820f290 Patch pkg-config and update installs for various packages 2016-08-01 13:35:21 -05:00
Adam J. Stewart
9e05fdf4a1 Bug fixes 2016-08-01 13:35:20 -05:00
Adam J. Stewart
7e53f4328f Add py-meep package and dependencies 2016-08-01 13:35:20 -05:00
becker33
e470478dc1 Merge pull request #1363 from hartzell/feature/add-package-for-cask
Add package for cask
2016-08-01 11:08:13 -07:00
George Hartzell
7d303afd64 Address flake8 issue 2016-08-01 13:42:55 -04:00
George Hartzell
1552ed943a Add package for cask
Add a package for cask, the emacs project/dependency management tool.

Based on [Homebrew's formula][brew].

[brew]: https://github.com/Homebrew/homebrew-core/blob/master/Formula/cask.rb
2016-08-01 13:41:28 -04:00
George Hartzell
31b7580b76 Fix jdk package's use of distutils
See issue #1364.  @citibeth's fix works fine.
2016-08-01 13:33:27 -04:00
becker33
cc3fc2ba4c Merge pull request #1322 from mdevlin1/feature/libxsmm
Add libxsmm package
2016-08-01 09:56:09 -07:00
becker33
0ce54c99af Merge pull request #1383 from epfl-scitas/packages/cp2k
cp2k : added package
2016-08-01 09:35:50 -07:00
Matt Belhorn
aaa5c9e8a4 Writes default module list to terminal when debugging. 2016-08-01 12:05:29 -04:00
Paul Hopkins
cca240c8f9 Add concretize_preferences tests 2016-08-01 16:18:11 +01:00
alalazo
ec09dfe5d1 cp2k : added package 2016-08-01 10:41:33 +02:00
Todd Gamblin
fbbb82259a Merge pull request #1407 from glennpj/r-ncdf4
New package - r-ncdf4
2016-07-31 22:15:52 -07:00
Todd Gamblin
ea11aab71f Merge pull request #1406 from glennpj/r-np
New package - r-np
2016-07-31 22:15:37 -07:00
Todd Gamblin
2042c94a6c Merge pull request #1405 from glennpj/r-survey
New package - r-survey
2016-07-31 22:15:09 -07:00
Todd Gamblin
64be8a80b2 Merge pull request #1404 from glennpj/r-tarifx
New package - r-tarifx
2016-07-31 22:14:56 -07:00
Todd Gamblin
7185fe2876 Merge pull request #1403 from glennpj/r-e1071
New package - r-e1071
2016-07-31 22:14:40 -07:00
Todd Gamblin
0724eba935 Merge pull request #1402 from glennpj/r-plotrix
New package - r-plotrix
2016-07-31 22:14:25 -07:00
Todd Gamblin
441bb83682 Merge pull request #1401 from glennpj/r-gdata
New package - r-gdata
2016-07-31 22:13:50 -07:00
Todd Gamblin
2cffc90284 Merge pull request #1400 from glennpj/r-roxygen2
New package - r-roxygen2
2016-07-31 22:13:16 -07:00
Todd Gamblin
68cedd2599 Merge pull request #1399 from glennpj/r-testthat
New package - r-testthat
2016-07-31 22:12:06 -07:00
Todd Gamblin
d00fd06095 Merge pull request #1398 from glennpj/r-xml
New package - r-xml
2016-07-31 22:11:38 -07:00
Todd Gamblin
3d571ad934 Merge pull request #1397 from glennpj/r-datatable
New package - r-datatable
2016-07-31 22:11:32 -07:00
Glenn Johnson
8815f0a0b5 New package - r-ncdf4
Interface to Unidata netCDF (version 4 or earlier) format data files.
2016-07-31 17:12:29 -05:00
Glenn Johnson
bfd03db12a New package - r-np
Nonparametric kernel smoothing methods for mixed data types.
2016-07-31 16:18:55 -05:00
Glenn Johnson
f14eb07dc1 New package - r-survey
Analysis of complex survey samples.
2016-07-31 15:50:19 -05:00
Glenn Johnson
a9cc6a7d08 New package - r-tarifx
A collection of various utility and convenience functions.
2016-07-31 15:39:09 -05:00
Glenn Johnson
be2f2e42db New package - r-e1071
Misc functions of the Department of Statistics, Probability Theory Group
(Formerly: E1071), TU Wien.
2016-07-31 15:26:13 -05:00
Glenn Johnson
05e5276aec New package - r-plotrix
Various plotting functions.
2016-07-31 15:15:55 -05:00
Glenn Johnson
dbf799bbf9 New package - r-gdata
Data manipulation tools.
2016-07-31 15:07:40 -05:00
Glenn Johnson
f39e570f36 New package - r-roxygen2
In-source documentation for R.
2016-07-31 14:52:16 -05:00
Glenn Johnson
58a6039c0a New package - r-testthat
A unit testing system for R.
2016-07-31 14:40:46 -05:00
Glenn Johnson
0662b953f0 New package - r-xml
Tools for parsing and generating XML within R and S-Plus.
2016-07-31 14:25:17 -05:00
Glenn Johnson
1b04b8be01 New package - r-datatable
Extension of Data.frame
2016-07-31 14:11:04 -05:00
Todd Gamblin
500218df80 Merge pull request #1384 from epfl-scitas/qa/drop_flake8_python26
qa : no flake8 on python 2.6, coveralls only on python 2.7
2016-07-30 20:25:14 -07:00
Todd Gamblin
173a16b38a Merge pull request #1396 from glennpj/r-quantmod
New package - r-quantmod
2016-07-30 20:15:53 -07:00
Todd Gamblin
68ba5377c1 Merge pull request #1395 from glennpj/r-ggmap
New package - r-ggmap and dependencies
2016-07-30 20:14:57 -07:00
Todd Gamblin
253507c0c3 Merge pull request #1394 from glennpj/r-maps
New package - r-maps
2016-07-30 20:14:27 -07:00
Todd Gamblin
7684652ce3 Merge pull request #1393 from glennpj/r-maptools
New package - r-maptools
2016-07-30 20:14:19 -07:00
Todd Gamblin
b12dc34ba7 Merge pull request #1391 from glennpj/r-caret
New package - r-caret
2016-07-30 20:14:09 -07:00
Todd Gamblin
9c31ee8a75 Merge pull request #1390 from glennpj/r-glmnet
New package - r-glmnet
2016-07-30 20:13:50 -07:00
Todd Gamblin
ae5ba2b110 Merge pull request #1389 from glennpj/r-vcd
New package - r-vcd
2016-07-30 20:13:05 -07:00
Todd Gamblin
13499f1655 Merge pull request #1388 from glennpj/r-multcomp
New package - r-multcomp
2016-07-30 20:12:51 -07:00
Todd Gamblin
49e9f365d8 Merge pull request #1387 from glennpj/r-randomforest
New package r-randomforest
2016-07-30 20:12:21 -07:00
Todd Gamblin
0fa8a491d3 Merge pull request #1386 from glennpj/r-car
New package r-car
2016-07-30 20:12:02 -07:00
Glenn Johnson
41cd861861 New package - r-quantmod
Qualitative Financial modelling framework.
2016-07-30 18:25:43 -05:00
Glenn Johnson
2913aa8d09 New package - r-ggmap and dependencies
Spatial visualization with ggplot2
2016-07-30 18:14:02 -05:00
Glenn Johnson
1bd2def41e New package - r-maps
Draw geographical maps.
2016-07-30 17:34:07 -05:00
Glenn Johnson
386f0e577a New package - r-maptools
Tools for reading and handling spatial objects.
2016-07-30 17:26:31 -05:00
Glenn Johnson
7207ce2a18 New package - r-caret
Classification and Regression Training
2016-07-30 16:53:54 -05:00
Glenn Johnson
20e52e5052 New package - r-glmnet
Lasso and Elastic-Net Regularized Generalized Linear Models
2016-07-30 16:38:00 -05:00
Glenn Johnson
e9944150a5 New package - r-vcd
Visualizing Categorical Data
2016-07-30 16:28:43 -05:00
Glenn Johnson
fc1804974c New package - r-multcomp
Simultaneous Inference in General Parametric Models.
2016-07-30 16:09:57 -05:00
Glenn Johnson
12167e8f37 New package r-randomforest
Breiman and Cutler's Random Forests for Classification and Regression.
2016-07-30 15:39:28 -05:00
Glenn Johnson
8dc26bbcd9 Have R extensions build in parallel.
Set `MAKEFLAGS` so R extensions can be built in parallel if that is set
in spack.
2016-07-30 15:20:14 -05:00
Glenn Johnson
ee7acc6b13 New package r-car
Companion to Applied Regression.
2016-07-30 15:10:25 -05:00
alalazo
f4422dc165 qa : fixes #1370 (no flake8 on python 2.6, coveralls only python 2.7) 2016-07-30 18:49:23 +02:00
Matt Belhorn
dc7e0899a0 Invokes subshell without user init scripts. 2016-07-30 11:38:34 -04:00
Matt Belhorn
5bb2d3baa0 Replaces technique for obtaining default back_end target.
New technique parses output of `module list` in clean login environment
in order to let convoluted initialization scripts to work for us rather
than against us as when trying to parse them directly.
2016-07-29 15:06:56 -04:00
Matt Belhorn
5e97eb5ec4 Obtains default modules from a clean subshell.
The list of default environment modules is obtained by calling

`module list -lt`

from a subshell with a wiped environment. This allows `/etc/profile` and other
init scripts to be fully sourced which should generally include loading the
default modules.

The list of default modules is then parsed for the first acceptable CPU target,
assumed to be the back_end target.
2016-07-29 15:02:25 -04:00
Kelly (KT) Thompson
6c80b15220 GTK+3: Provide updates to package dependencies.
WIP: I started trying to build gtkplus@3.20, but this package has many more
dependencies than v2 and it requires newer versions of existing packages. This
commit provides updates for 5 packages that are required by GTK+3. This is not
the complete set of changes required for GTK+3.

atk  - move default version from 2.14 -> 2.20.
glib - move default version from 2.42 -> 2.49
     - v2.49 requires pcre+utf as a new dependency.
pcre - if variant +utf is selected, add '--enable-unicode-properties' to the
       configure options.
libepoxy - new package to spack
         - manages OpenGL function pointers.
pango    - move default version from 1.36 -> 1.40
2016-07-29 09:05:44 -06:00
Denis Davydov
aad5a4c4b3 mkl: flake8 fixes; minor docu update 2016-07-29 14:12:07 +02:00
Paul Hopkins
5eebb2defa Use space characters to separate preferred variants from package name and each other 2016-07-29 13:02:47 +01:00
Denis Davydov
b6ce0e6f0e trilinos: make sure hdf5 is picked up from Spack 2016-07-29 13:11:12 +02:00
Denis Davydov
943896e237 trilinos: fix lapack lib dir 2016-07-29 13:09:34 +02:00
Denis Davydov
8ee4df8101 hypre: minor cleanup related to blas/lapack 2016-07-29 11:37:19 +02:00
Denis Davydov
572f1cd427 mkl: symlink libs to prefix.lib 2016-07-29 11:36:37 +02:00
Todd Gamblin
e04662f84f Merge pull request #1344 from LLNL/bugfix/py-nose-nosetests
do not ignore nosetests script in py-nose
2016-07-28 10:19:13 -07:00
becker33
5caaa2cd75 Merge pull request #1331 from adamjstewart/fixes/mvapich2
MVAPICH2 depends on libpciaccess
2016-07-28 09:52:51 -07:00
becker33
3759f62cba Merge pull request #1235 from davydden/pkg/p4est_run_tests
p4est: use run_tests instead of a variant
2016-07-27 18:36:36 -07:00
Matt Belhorn
07f2dd5498 Merge pull request #1 from robertdfrench/olcf/unified_cray_platform
PEP8 Goodness
2016-07-27 14:33:09 -04:00
robertdfrench
eab56b71be PEP8 Goodness 2016-07-27 13:11:24 -04:00
Matt Belhorn
3040381f03 Front-end unification for Cray systems.
A platform to generically cover all Cray systems is introduced to avoid having
specific platforms for each of XK (XE, XT), XC, and future systems using CrayPE
and CNL.

The platform searches for 'front_end' and 'back_end' targets, in order, from:

  * Environment variables 'SPACK_FRONT_END' and 'SPACK_BACK_END'
  * A spack configuration file 'targets.yaml'
  * Parsing `/etc/bash.bashrc.local` for first loaded CrayPE CPU target.

If a back_end target is not found through one of these methods, an exception is
raised. Otherwise, the back_end is set as the default target. The shell init
script search is based on recommendations in Crayports case #144359.

No automagic way of determining front_end targets has been found (to date) so if
a front_end is not specified through configuration, it is ignored which should
leave a spack instance in a consistant state.
2016-07-27 11:37:15 -04:00
George Hartzell
f855cf6bab Add package for tree
Add a package for [tree](http://mama.indstate.edu/users/ice/tree/).

It has a Makefile that hardcodes a prefix and some CFLAGS.  Used
filter_file to:

- set the make variable *prefix* to `prefix`; and
- comment out their CFLAGS, just use ours....

It installs, runs on CentOS7, and uninstalls cleanly.
2016-07-27 11:32:03 -04:00
Matt Belhorn
b1e6c58ff2 Adds __str__ method to CNL operating system class. 2016-07-27 11:25:23 -04:00
Matt Belhorn
4e6fdd12e2 Adds targets config file 2016-07-27 11:25:23 -04:00
Todd Gamblin
458deaae5e Merge pull request #1350 from adamjstewart/fixes/openssl
Fix OpenSSL url_for_version
2016-07-27 08:08:00 -07:00
alalazo
9c7b98dcc8 modules : handle dashes in environment variables 2016-07-26 09:03:17 +02:00
Greg Lee
e4525e57bb intel parallel studio itac fixes 2016-07-25 14:02:15 -07:00
Greg Lee
dba384108b intel parallel studio setup mkl environment 2016-07-25 14:01:49 -07:00
becker33
e4ced765f1 Merge pull request #1353 from epfl-scitas/qa/minor_cleanup
qa : minor cleanup
2016-07-25 10:34:43 -07:00
Samuel Knight
a2d4dcc636 Added libhio package 2016-07-25 17:32:03 +00:00
becker33
969e785d94 Merge pull request #1352 from glennpj/r_googlevis
New package - r-googlevis
2016-07-25 10:25:47 -07:00
becker33
5b7ec8de95 Merge pull request #1351 from glennpj/r_htmlwidgets
New packages - R htmlwidgets
2016-07-25 10:25:19 -07:00
becker33
e19872e77f Merge pull request #1347 from glennpj/rdeps
Add dependency type to r- packages
2016-07-25 10:19:32 -07:00
Glenn Johnson
eb865b0df2 Add py-setuptools as dependency
With the addition of dependency types and with `py-setuptools` set as
type='build' there are more packages that need to have `py-setuptools`
added as a dependency.

This PR adds that dependency for the following packages:
- py-h5py
- py-networkx
- py-pytables
- py-scikit-image
2016-07-25 11:23:09 -05:00
alalazo
c6a05f4a7d qa : flake8 issues fixes #1109 2016-07-25 18:22:09 +02:00
alalazo
3126ed5f21 modules : permit token expansion in configuration files 2016-07-25 18:10:27 +02:00
George Hartzell
d684b17c06 Fix doc for install_tree (cut/paste error)
It looks like the docs for copy_tree were cut/paste from copy and still referred to installing a "file".

This fixes that.
2016-07-25 08:45:44 -07:00
alalazo
5cfaa557d3 qa : flake8 issues 2016-07-25 10:19:58 +02:00
alalazo
23006d1195 spec : removed dead code 2016-07-25 09:05:50 +02:00
Glenn Johnson
81cd458c26 r-curl update and chaged remote archive
This updates to the 1.0 version of r-curl. The remote archive directory
name also changed so change that here as well.
2016-07-24 16:48:07 -05:00
Glenn Johnson
27986c9edf New packages - R htmlwidgets 2016-07-24 16:43:35 -05:00
Glenn Johnson
b7bf88c761 New package - r-googlevis 2016-07-24 16:38:36 -05:00
Adam J. Stewart
29278090eb Fix OpenSSL url_for_version 2016-07-24 15:19:27 -05:00
Glenn Johnson
b1e5ec0573 Make sure package has the url attribute.
In addition to `list_url` make sure the package has the `url` attribute
set before attempting to add urls from a list. This is to cover the case
where there may be a `list_url` specified in tandem with a
`url_for_version`.
2016-07-24 09:21:11 -05:00
Glenn Johnson
4f09e8c975 Only use list if list_url set
This commit will make urls from list_url only checked if `list_url` is
set in the package file. This makes more sense as there is no need to
check for those if the attribute is not present. If `url` is present and
`list_url` is not then it would result in the same url. If
`url_for_version` is used then that will not work anyway.
2016-07-23 22:56:08 -05:00
Glenn Johnson
a8855f48aa Add dependency type tp r- packages
This PR adds the `nolink` dependency type to r- package dependencies.
This is needed due to the new dependency types in Spack. A couple of
packages were updated with new versions as well.
2016-07-23 19:43:55 -05:00
Glenn Johnson
4181fd79cd Fix flake8 errors related to lines
Fixed the flake 8 errors that involved too many blank lines or not
enough blank lines. Basically, all of the flake8 errors except line
length errors.
2016-07-23 19:10:09 -05:00
Glenn Johnson
b51be2bb1b Have fetch use list_url
This PR allows archive file retrieval from urls derived from the
`list_url` setting in a package file. This allows for continued
retrieval of checksummed archive files even when they are moved to a new
remote location when a package is updated upstream.
2016-07-23 19:09:58 -05:00
Greg Lee
773bca159a do not ignore nosetests script in py-nose 2016-07-22 15:49:36 -07:00
Glenn Johnson
ec9959b152 R extension dependencies with compiler wrapper
This commit introduces a mechanism to insure that R package dependencies
are built with the Spack compiler wrapper. A copy of Makeconf is made
before `filter_compilers` is called. This is then pointed to by the
R_MAKEVARS_SITE environment variable set up in
`setup_dependent_environment`. With this the normal compilers are used
outside of spack and the spack wrapper compilers are used inside of
spack.

This commit also standardizes on the `join_path` call. It also sets the
commented build command to reflect what is actually used with the newer
string formatting.
2016-07-22 17:05:01 -05:00
Adam J. Stewart
1be486c90a Add CGNS package 2016-07-22 17:02:45 -05:00
becker33
7220bc1766 Merge pull request #1340 from adamjstewart/features/create
Use example deptypes in newly created packages
2016-07-22 14:25:12 -07:00
Todd Gamblin
395c616a48 Merge pull request #950 from xjrc/packages/python
Enhancement Proposal: Make Python Spack Installs Ignore User Configuration
2016-07-22 13:56:19 -07:00
Adam J. Stewart
ebbcebac62 Use example deptypes in newly created packages 2016-07-22 13:55:00 -05:00
Joseph Ciurej
fa92f58167 Adding temporary script that fixes all Python extensions w/ 'setup_py'. 2016-07-22 11:17:19 -07:00
Joseph Ciurej
ac2e0962ce Improved the build flag construction code in the python install method. 2016-07-22 11:12:02 -07:00
Joseph Ciurej
fb2d2303d6 Fixed a bug that was causing Python installs to be affected by user config. 2016-07-22 11:11:08 -07:00
Todd Gamblin
f5b4664c7c Merge pull request #1336 from glennpj/rcase
Fix alpha case of dependencies for some r-packages
2016-07-22 10:08:14 -07:00
alalazo
00d7fd8e21 test_install : removed commented code 2016-07-22 18:14:36 +02:00
Todd Gamblin
adffba5081 Merge pull request #1230 from hartzell/update-jdk
Add URL and md5 for jdk-8u92.
2016-07-21 22:06:29 -07:00
Glenn Johnson
e083c91d5e Fix alpha case of dependencies.
A while ago I was asked to convert packages to all lowercase. That was
done but some dependencies did not get converted in the specification.
This commit fixes that as well as a couple of urls that need to be made
explicit and a missing dependency on jdk.
2016-07-21 19:58:04 -05:00
Todd Gamblin
ed737cb2a2 Merge pull request #1333 from LLNL/features/no-openssl-pinging
Remove remote website pinging from OpenSSL
2016-07-21 16:46:59 -07:00
Todd Gamblin
488550c2e6 Merge pull request #1334 from hartzell/add-gcc-5.4.0
Update gcc package with info about gcc-5.4.0
2016-07-21 16:37:31 -07:00
Todd Gamblin
8523f75e6c Remove remote website pinging from OpenSSL
- OpenSSL no longer checks remote versions on the openssl site.

- Spack is used on systems that aren't connected to the internet, and
  this check is probably in the wrong place and affects too many
  commands.  We can work on figuring out a better, more configurable
  place to put a check like this.
2016-07-21 16:35:20 -07:00
Todd Gamblin
4707362ccd Merge pull request #1263 from hartzell/lmod-needs-tcl
The lmod package should depend_on('tcl')
2016-07-21 16:32:54 -07:00
becker33
dd5b1ac098 Merge pull request #1335 from LLNL/crayxc-detection
Crayxc detection
2016-07-21 15:06:42 -07:00
Gregory Becker
bcbe9c02da Added cray wrapper names directory to spack_env_paths so the spack compiler wrapper will remove them from the environment (prevents hang) 2016-07-21 14:50:23 -07:00
Gregory Becker
1544f98ee0 fixed flake8 errors 2016-07-21 14:36:10 -07:00
Gregory Becker
f0d5317913 fixed 2016-07-21 14:11:34 -07:00
Gregory Becker
2ae7429b18 Bug fix for cray_xc platform 2016-07-21 14:04:22 -07:00
George Hartzell
4efe022165 Update with info about gcc-5.4.0 2016-07-21 15:36:22 -04:00
Mitchell Devlin
796308ed85 edit 2016-07-21 13:39:27 -05:00
George Hartzell
4c105895ab Fix flake8 violations 2016-07-21 14:24:51 -04:00
George Hartzell
9523e50732 Fix shebang line in tcl scripts
Lmod's configure script goes to the trouble of finding
tclsh.  This change uses that info to rewrite the #! lines
in the tcl scripts so that they call the tclsh that the
configure script discovered.

It needs to massage the existing shebang lines into something
that the sed statement in the makefile can manipulate and
it needs to add the path_to_tclsh info into the set of sed
statements.

Checked with versions 6.4.1 and 6.3.7 (the checksum for 6.0.1 is
incorrect, a fix for another time).
2016-07-21 13:58:16 -04:00
George Hartzell
52f0249c61 tcl is actually a runtime dependency.
lmod uses tclsh at runtime, so adjust the depends_on accordingly
(thanks @davydden!).
2016-07-21 13:51:03 -04:00
George Hartzell
a27cb639d8 The lmod package should depend_on('tcl')
The lmod package needs a tclsh.  Up until now it just assumed
that one was available on the system.

This change adds a depends_on('tcl') to the lmod package.

The tcl package installs a tclsh script with an embedded version
number (e.g. tclsh8.6) but the lmod configuration looks for tclsh.
This change extends the tcl package to symlink tclshX.Y to tclsh in
the tcl package bin directory.
2016-07-21 13:51:03 -04:00
Adam J. Stewart
cf8f14780f MVAPICH2 depends on libpciaccess 2016-07-21 11:13:17 -05:00
Todd Gamblin
098af17971 Merge pull request #1208 from paulhopkins/bugfix/github1196-specify-preferred-variants
Bugfix/github1196 specify preferred variants
2016-07-21 08:36:19 -07:00
Todd Gamblin
5745ede31d Merge pull request #1328 from suraia/fix-recursive-module-load
Fix recursive module loading
2016-07-21 08:34:36 -07:00
Todd Gamblin
0b1d03abe6 Merge pull request #1327 from suraia/update-load-documentation
Update documentation for recursive module loading
2016-07-21 08:33:40 -07:00
Paul Hopkins
00280936da Flake8 fixes to ensure qa tests pass 2016-07-21 13:12:58 +01:00
Paul Hopkins
480fe9cb9a Re-add documentation for variant preferences 2016-07-21 12:32:00 +01:00
Paul Hopkins
bd91dd9d6d Allow users to supply preferred variants via packages.yaml 2016-07-21 12:32:00 +01:00
Michael Kuhn
732c24f603 Fix recursive module loading. 2016-07-21 13:15:53 +02:00
Michael Kuhn
4e1f86881a Update documentation for recursive module loading. 2016-07-21 13:15:10 +02:00
Gregory Lee
07d4c6cf0b Merge pull request #1205 from glennpj/psxe
Setup environment for Intel Parallel Studio
2016-07-20 21:14:34 -07:00
Glenn Johnson
ead1b93f75 MPI related changes
- Redid the code for setting the itac symlink for the cluster edition.
- Removed the *PATH variables for MPI to avoid a conflict with other MPI
  environment modules.
- Added missing test for `+all` when checking variants.
2016-07-20 20:03:05 -05:00
Glenn Johnson
0be4c7dfbd Changes as discussed in PR review
- removed unneeded entry for `debugger/gdb/intel64_mic`
- set `+mpi` directory name to impi
2016-07-20 20:03:05 -05:00
Glenn Johnson
5e5e36a659 Fix flake8 errors. 2016-07-20 19:54:35 -05:00
Glenn Johnson
16f67b5bb1 Setup environment for Intel Parallel Studio
Set up the environment for the Intel compilers and tools. This commit
does the following:

- Unset variables that were incorrect from the auto guess prefix
  inspections.
- Add a RemovePath environment_modifications_formats for dotkit.
- Set the module environment variables appropriate for the different
  variants.
- Change the component logic so that the '+all' variant works. It was
  getting split by letter and leaving COMPONENTS empty.
- Added a variant checking function.
- Added NONRPM_DB_DIR to the silent.cfg so that the product database
  goes to the installation directory.
- With the product database in prefix the code to remove the product
  database file from the home directory is no longer needed and was
  removed.
- Reformat the 'tools' variant description.

There are probably more variables needed for the '+tools' for the
'professional' product version but I do not have access to that.
2016-07-20 19:54:35 -05:00
mwilliammyers
b8444aa518 Merge remote-tracking branch 'upstream/develop' into package-opencv
* upstream/develop: (126 commits)
  Fix indent/flake8 error.
  openexr : Add new package
  Set environment variables
  Added gnu packages datamash, parallel, and screen
  added package as argument to setup_platform_environment
  ilmbase : Add new IlmBase package
  Documented linker default
  fixed flake errors
  removed commented-out code
  Set default link type to dynamic on cray. Includes hooks for platform-based environment changes
  fixed flake errors
  fixed flake errors
  Improved cray_xc detection bug fix
  Improved cray_xc detection
  remove FIXMEs
  Ensure that per-4.4.1 NetCDF doesn't use HDF5 1.10
  Re-ignore licenses directory
  Add "default" configuration scope.
  Draft CDO
  Make frontend OS on Cray machines a proper linux distro.
  ...
2016-07-20 18:34:53 -06:00
mwilliammyers
a09bebcaea opencv : Add section comments 2016-07-20 18:19:59 -06:00
mwilliammyers
a9541997ae opencv : Reorder depends_on statements 2016-07-20 18:19:03 -06:00
mwilliammyers
bd02892f7b opencv : Use dso_suffix for python lib 2016-07-20 18:10:10 -06:00
mwilliammyers
ea9fa81ba5 opencv : Fix python include dir for cmake 2016-07-20 18:10:09 -06:00
mwilliammyers
670157b364 opencv : Add zlib cmake support 2016-07-20 18:10:09 -06:00
mwilliammyers
e5ae48a9da opencv : Add jasper cmake support 2016-07-20 18:10:09 -06:00
mwilliammyers
47514d07b1 opencv : Use dso_suffix 2016-07-20 18:10:08 -06:00
mwilliammyers
f2e8f27c15 opencv : Add libpng cmake support 2016-07-20 18:10:08 -06:00
mwilliammyers
fc79b104f0 opencv : Add libjpeg-turbo cmake support 2016-07-20 18:10:07 -06:00
mwilliammyers
97143768c8 opencv : Add libtiff cmake support 2016-07-20 18:10:07 -06:00
mwilliammyers
d3b97227a1 opencv : Add optional jdk dependency 2016-07-20 18:10:07 -06:00
mwilliammyers
da2b695f93 opencv : Fix lib finding for python 2016-07-20 17:25:05 -06:00
mwilliammyers
10c285a774 opencv : Use string.format() 2016-07-20 17:25:01 -06:00
mwilliammyers
0654ee6a10 opencv : Fix style inconsistencies 2016-07-20 17:24:55 -06:00
mwilliammyers
8cf03c209f opencv : Make extending python optional 2016-07-20 17:24:50 -06:00
mwilliammyers
c588ce9648 opencv : Improve cmake detecting python 2016-07-20 17:24:46 -06:00
mwilliammyers
3fac2dcc41 opencv : Fix cmake not disabling gtk 2016-07-20 17:24:40 -06:00
mwilliammyers
0080ffcf9f opencv : Use in operator 2016-07-20 17:24:35 -06:00
mwilliammyers
ce902bf27a opencv : Minor style changes 2016-07-20 17:24:30 -06:00
mwilliammyers
2cde6aaabd opencv : Add GUI support 2016-07-20 17:24:26 -06:00
mwilliammyers
578ddea418 opencv : Fix pep8 style issues 2016-07-20 17:24:21 -06:00
mwilliammyers
cf0f5756f5 opencv : Fix python extensions issues 2016-07-20 17:24:13 -06:00
mwilliammyers
9e1d26e973 opencv : Add CUDA extensions 2016-07-20 17:23:46 -06:00
Todd Gamblin
e389afedaa Merge pull request #1323 from glennpj/rlib
Set environment variables for R
2016-07-20 15:43:26 -07:00
Todd Gamblin
b9c79824a2 Merge pull request #1313 from sknigh/gnu-tools
Added packages for GNU tools screen, datamash, and parallel
2016-07-20 15:38:55 -07:00
Todd Gamblin
0777d3a5ba Merge pull request #1326 from mwilliammyers/package-openexr
openexr : Add new package
2016-07-20 15:35:36 -07:00
Mitchell Devlin
2344ffd0c7 add libxsmm package 2016-07-20 16:36:31 -05:00
Glenn Johnson
0c75174ec3 Fix indent/flake8 error. 2016-07-20 15:56:20 -05:00
mwilliammyers
e973adf84b openexr : Add new package 2016-07-20 14:49:03 -06:00
Glenn Johnson
f9137f606f Set environment variables
This commit adds `setup_environment` to export the libraries and
headers.

Fixes #1314.
2016-07-20 15:37:31 -05:00
Todd Gamblin
8856a226c7 Merge pull request #1277 from mathstuf/special-deptypes
deptypes: support special deptypes by string
2016-07-20 13:15:57 -07:00
Todd Gamblin
d8acd41ba1 Merge pull request #1321 from mwilliammyers/package-ilmbase
ilmbase : Add new IlmBase package
2016-07-20 13:13:21 -07:00
Todd Gamblin
8efbec3c0b Merge pull request #1292 from eschnett/eschnett/hdf5-default-1.10
Make newest HDF5 release the default version
2016-07-20 12:57:45 -07:00
Todd Gamblin
4c7c9f4ff5 Merge pull request #1303 from adamjstewart/features/armadillo
Updates to Armadillo package
2016-07-20 12:56:41 -07:00
Todd Gamblin
cd4f429f72 Merge pull request #1319 from LLNL/cray-linker
Cray linker
2016-07-20 12:56:01 -07:00
Samuel Knight
24c14ff7a8 Added gnu packages datamash, parallel, and screen 2016-07-20 19:53:14 +00:00
Gregory Becker
eda1176ba7 added package as argument to setup_platform_environment 2016-07-20 12:26:31 -07:00
mwilliammyers
c9f4e8ce5a ilmbase : Add new IlmBase package 2016-07-20 13:13:47 -06:00
Gregory Becker
6983c1d30d Documented linker default 2016-07-20 12:04:00 -07:00
Gregory Becker
412618d531 fixed flake errors 2016-07-20 11:52:16 -07:00
Gregory Becker
7db4170062 removed commented-out code 2016-07-20 11:36:47 -07:00
Gregory Becker
f4fb9a0771 Set default link type to dynamic on cray. Includes hooks for platform-based environment changes 2016-07-20 11:35:13 -07:00
Todd Gamblin
79e066d53c Merge pull request #1315 from LLNL/improved-cray-detection
Improved cray detection
2016-07-20 11:11:56 -07:00
Gregory Becker
106147716a fixed flake errors 2016-07-20 11:00:56 -07:00
Gregory Becker
0d18f7249c fixed flake errors 2016-07-20 10:50:18 -07:00
Gregory Becker
26d1ddc176 Improved cray_xc detection bug fix 2016-07-20 10:28:38 -07:00
Gregory Becker
4c506b36c5 Improved cray_xc detection 2016-07-20 10:25:07 -07:00
Todd Gamblin
4434f482c0 remove FIXMEs 2016-07-20 09:48:54 -07:00
Todd Gamblin
3def8ef60e Merge branch 'cdo' of https://github.com/robertdfrench/spack into robertdfrench-cdo 2016-07-20 09:48:01 -07:00
Todd Gamblin
20584ab084 Merge pull request #1302 from robertdfrench/adios-url
Get adios from github, not NCCS
2016-07-20 09:47:23 -07:00
Todd Gamblin
7c28338d60 Merge pull request #1301 from robertdfrench/silver-searcher
Silver Searcher 0.32 is out
2016-07-20 09:47:12 -07:00
Todd Gamblin
17a63c9646 Merge pull request #1284 from eschnett/eschnett/py-h5py.2
Declare dependency of "py-h5py +mpi" on "py-mpi4py"
2016-07-20 09:45:54 -07:00
Todd Gamblin
01a361d637 Merge pull request #1288 from LLNL/features/cray_compiler_names
Let packages call use_cray_compilers() in install to get , etc set to…
2016-07-20 09:45:36 -07:00
Todd Gamblin
7f20678969 Merge pull request #1291 from eschnett/eschnett/netcdf-4.4.1
Update NetCDF to version 4.4.1
2016-07-20 09:34:14 -07:00
Erik Schnetter
69e36c9821 Ensure that per-4.4.1 NetCDF doesn't use HDF5 1.10 2016-07-20 11:25:46 -04:00
Todd Gamblin
c503b43e38 Merge pull request #1311 from adamjstewart/features/licenses
Re-ignore licenses directory
2016-07-20 07:14:47 -07:00
Adam J. Stewart
83330d2b59 Re-ignore licenses directory 2016-07-20 08:50:32 -05:00
Todd Gamblin
6501cba5a7 Merge pull request #1309 from LLNL/features/spack-defaults
Add "default" configuration scope.
2016-07-19 23:48:12 -07:00
Todd Gamblin
26480f14f9 Add "default" configuration scope.
- Default scope is versioned with spack and can be overridden by site
  or user config.

- Default scope provides sensible default concretization preferences
  for all of Spack.

- per-platform concretization scope can be added later (to force a
  particular MPI on, e.g., Cray systems)
2016-07-19 17:10:17 -07:00
Robert D. French
6b0fb476ab Draft CDO 2016-07-19 15:57:55 -07:00
Todd Gamblin
dd7bd4f320 Make frontend OS on Cray machines a proper linux distro. 2016-07-19 14:59:04 -07:00
Ben Boeckel
1315753e70 deptypes: support special deptypes by string 2016-07-19 16:26:18 -04:00
Robert D. French
1c9cf668a1 Silver Search 0.32 is out
PEP8 Love + Re-adding v0.30.0
2016-07-19 10:48:53 -07:00
Adam J. Stewart
8034536054 Fix shared object suffix for macOS 2016-07-19 12:37:34 -05:00
Adam J. Stewart
afa4cdc2d8 Updates to Armadillo package 2016-07-19 12:33:04 -05:00
Robert D. French
25e765baae Download Adios from Github
Get adios from github, not NCCS

Use correct hash, thanks Ben
2016-07-19 10:31:59 -07:00
Todd Gamblin
a64a2e72cf Merge pull request #1226 from adamjstewart/features/tkinter
Add Tkinter support for Python
2016-07-19 09:41:12 -07:00
Todd Gamblin
c4b4ce7d85 Merge pull request #1135 from epfl-scitas/features/module_refresh_reworking
spack module : reworking of the command
2016-07-19 09:27:58 -07:00
Todd Gamblin
4ad29b6c9b Merge pull request #1262 from davydden/pkg/suite_sparse_fix_blas
suite-sparse: enable TBB and fix Blas/Lapack libs
2016-07-19 09:18:42 -07:00
Todd Gamblin
7e16a4edd7 Merge pull request #1294 from eschnett/eschnett/flex
Flex requires m4
2016-07-19 09:04:04 -07:00
alalazo
acfeb5d043 Merge branch 'develop' of https://github.com/LLNL/spack into features/module_refresh
Conflicts:
	lib/spack/spack/test/__init__.py
2016-07-19 09:05:27 +02:00
Erik Schnetter
71684cb071 Flex requires m4 2016-07-18 23:04:20 -04:00
Erik Schnetter
4dec06e4f4 Make HDF5 1.10 the default version
Apply this only after NetCDF 4.4.1 is supported.
2016-07-18 20:14:44 -04:00
Erik Schnetter
94df1b801a Update NetCDF to version 4.4.1
This version supports HDF5 1.10 in a backward-compatible manner.
2016-07-18 20:11:32 -04:00
Todd Gamblin
7555c3d949 Merge pull request #1204 from goxberry/cmake-3.6.0
cmake@3.6.0
2016-07-18 16:53:17 -07:00
becker33
013cfafe57 Merge pull request #1229 from suraia/fix-preferred-providers
Fix preferred providers.
2016-07-18 16:47:08 -07:00
Gregory Becker
218fc602fa Let packages call use_cray_compilers() in install to get , etc set to cray names 2016-07-18 15:43:21 -07:00
Todd Gamblin
25a9181a1b Merge pull request #1287 from mwilliammyers/package-jasper
jasper: Add new jasper package
2016-07-18 15:43:18 -07:00
mwilliammyers
02340062b4 package - jasper - Add new jasper package 2016-07-18 16:17:07 -06:00
Todd Gamblin
4a276807b1 Merge pull request #1245 from LLNL/features/cray-detection-improvement
The /cray_home directory is more consistent than the /cray/craype dir…
2016-07-18 14:36:08 -07:00
Todd Gamblin
51834773b4 Merge pull request #851 from mathstuf/safer-bootstrap
bootstrap: fall back to the default upstream URL
2016-07-18 14:25:29 -07:00
Gregory Becker
46ee4a3a53 Using cc -craype-verbose to get cray platform type 2016-07-18 14:25:17 -07:00
Todd Gamblin
607813d5ce setuptools is a build dependency in numpy. 2016-07-18 14:13:14 -07:00
Erik Schnetter
67fade5b1e Declare dependency of "py-h5py +mpi" on "py-mpi4py" 2016-07-18 17:08:56 -04:00
Todd Gamblin
a9ed2296a1 Merge pull request #1282 from eschnett/eschnett/py-numpy
py-numpy: Add py-setuptools dependencies
2016-07-18 13:58:17 -07:00
Todd Gamblin
fa0bbb57ea Merge pull request #1270 from davydden/pkg/mumps_scalapack_fix_blas
Pkg/mumps scalapack fix blas
2016-07-18 13:57:26 -07:00
Erik Schnetter
49cd6f6269 py-numpy: Add py-setuptools dependencies
Closes #1281.
2016-07-18 16:01:48 -04:00
Todd Gamblin
653f25d676 Merge pull request #1171 from adamjstewart/features/octave
Allow spack create to automatically detect octave build system
2016-07-18 12:32:32 -07:00
Todd Gamblin
089189afaf Merge pull request #1238 from davydden/pkg/mkl_update
mkl: add provide blas/lapack
2016-07-18 11:52:30 -07:00
Todd Gamblin
0a89342508 Merge pull request #1271 from paulhopkins/bugfix/package-list
Bugfix/package list
2016-07-18 10:47:12 -07:00
Todd Gamblin
06f57a31c1 Merge pull request #1273 from mathstuf/opt-ignore
gitignore: don't require opt to be a directory
2016-07-18 10:44:16 -07:00
Michael Kuhn
19df1ea79d flake8 fix 2016-07-18 17:53:26 +02:00
Ben Boeckel
2b4d2b8748 gitignore: don't require opt to be a directory
I use a symlink to make it easy to swap out.
2016-07-18 11:39:26 -04:00
Paul Hopkins
a46138dea9 More flake8 fixes for package-list 2016-07-18 13:59:58 +01:00
Adam J. Stewart
ea425a101a Flake8 and new tk version 2016-07-18 07:51:08 -05:00
Adam J. Stewart
583232ea52 Build Python with Tkinter support 2016-07-18 07:51:08 -05:00
Adam J. Stewart
89c9bec81e Flake8 2016-07-18 07:45:28 -05:00
Adam J. Stewart
262ab40188 Update build_system_guess test with new class name 2016-07-18 07:45:28 -05:00
Adam J. Stewart
199a8af7cc Flake8 2016-07-18 07:45:28 -05:00
Adam J. Stewart
e9f42c1a94 Allow spack create to automatically detect octave build system 2016-07-18 07:45:27 -05:00
alalazo
a96eb7096d Merge branch 'develop' of https://github.com/LLNL/spack into features/module_refresh
Conflicts:
	share/spack/setup-env.sh
2016-07-18 14:12:47 +02:00
Paul Hopkins
cc027148eb Flake8 fixes in cmd/package-list.py file 2016-07-18 12:52:23 +01:00
Paul Hopkins
2b3ba850b3 Fix spack package-list to correctly handle deptypes 2016-07-18 12:51:58 +01:00
Todd Gamblin
b3789a4693 Merge pull request #1269 from davydden/pkg/hypre_trilinos_blas
Pkg/hypre trilinos blas
2016-07-18 03:06:37 -07:00
Todd Gamblin
4030f8d7c3 Merge pull request #1268 from LLNL/bugfix/spack-info-gh1256
Fix broken `spack info` command after build dep merge.
2016-07-18 03:03:05 -07:00
Todd Gamblin
cddaba8add flake8 fixes.
- package.py
- spec.py
- test/architecture.py
2016-07-18 02:34:24 -07:00
Todd Gamblin
192369dd2b Fix #1265: Errors in spack reindex
- Consolidated code to read spec.yaml and database index.yaml into
  one method (`read_yaml_dep_specs()`) in spec.py.

- Code understands old hash format, tuple format, and dicts for dep
  specs, for backward compatibility.

- Spec YAML now uses a dict with keys to represent dep specs (this is
  more future-proof).

- Dep specs no longer contain !!py-tuple entries in YAML (only lists
  properly YAML-ize)

- bump database version.
2016-07-18 01:19:07 -07:00
Todd Gamblin
73f10c9363 Fix broken spack info command after build dep merge.
- Added a method to get dependencies of particular types from Package
- Fixed info command.
2016-07-18 01:19:07 -07:00
Todd Gamblin
cdc2ebee90 Better error messages for spack reindex. 2016-07-18 01:14:47 -07:00
Denis Davydov
2e4966c854 netlib-scalapack: use dso_suffix 2016-07-18 10:11:18 +02:00
Todd Gamblin
c898b9db04 Merge pull request #1188 from epfl-scitas/packages/py-numpy
RPATH for blas in py numpy
2016-07-17 21:20:39 -07:00
Todd Gamblin
117743863e Merge pull request #1252 from hartzell/patch-5
Fix format of explanation of an example & question
2016-07-17 21:20:02 -07:00
Todd Gamblin
28ce08b9e2 Merge pull request #1258 from eschnett/eschnett/openmpi-2.0.0
Update to OpenMPI 2.0.0
2016-07-17 21:01:21 -07:00
Todd Gamblin
0e8bf79fa4 Merge pull request #1240 from epfl-scitas/truncated_documentation
doc : fixes #1239
2016-07-17 20:59:36 -07:00
alalazo
dc671ad037 docs : substituted None with empty cell 2016-07-17 22:17:52 +02:00
Denis Davydov
1bd3a702c9 mumps: flake8 fixes 2016-07-16 15:14:06 +02:00
Denis Davydov
561748a063 netlib-scalapack: flake8 fixes 2016-07-16 08:03:54 +02:00
Denis Davydov
9ea4f80f15 flake8 fixes 2016-07-16 07:58:51 +02:00
Denis Davydov
0752eccfa5 mumps: don't hardcode blas name; remove unused depends_on(lapack) 2016-07-16 07:38:42 +02:00
Denis Davydov
6175ce7559 netlib-scalapack: make sure Spack's Lapack is used 2016-07-16 07:37:38 +02:00
Denis Davydov
987fb137f9 trilinos: don't hardcode blas/lapack names 2016-07-16 07:31:38 +02:00
Denis Davydov
514c61b8fe hypre: don't hardcode blas/lapack/mpi; optionally run tests 2016-07-16 07:28:31 +02:00
Denis Davydov
992250ddea add to_lib_name() to get library name from a path 2016-07-16 07:24:05 +02:00
Michael Kuhn
d61190c3ff Explicitly request zmpi in module blacklist test. 2016-07-16 00:48:04 +02:00
Denis Davydov
96e9dbca08 suite-sparse: enable TBB and fix Blas/Lapack libs 2016-07-16 00:33:39 +02:00
Erik Schnetter
5a1ed51dcd Correct indentation 2016-07-15 18:10:33 -04:00
becker33
63101e9914 Merge pull request #1261 from adamjstewart/features/create-deptype
Automatically add deptype to newly created packages
2016-07-15 15:10:10 -07:00
Adam J. Stewart
8c1cc44522 Automatically add deptype to newly created packages 2016-07-15 16:43:25 -05:00
becker33
36f818b9fb Merge pull request #1246 from suraia/improve-shell-integration
Improve shell integration.
2016-07-15 14:23:51 -07:00
becker33
c0be585b67 Merge pull request #1168 from epfl-scitas/packages/gts
gts : added package
2016-07-15 14:07:59 -07:00
becker33
656b2d562f Merge pull request #1177 from epfl-scitas/packages/swiftsim_and_metis
swiftsim : fixed configuration for metis
2016-07-15 14:05:28 -07:00
becker33
f761130343 Merge pull request #1187 from paulhopkins/bugfix/python-updates
Bugfix/python updates
2016-07-15 14:04:46 -07:00
becker33
f1d85ac2e9 Merge pull request #1227 from glennpj/ggvis
New package - r-ggvis
2016-07-15 14:00:15 -07:00
becker33
1585c014d7 Merge pull request #1259 from adamjstewart/fixes/run-flake8
Updates to run-flake8 test
2016-07-15 13:55:01 -07:00
becker33
37ce4108ce Merge pull request #1254 from mdevlin1/features/hmmer
add HMMER package
2016-07-15 13:52:56 -07:00
becker33
e822257565 Merge pull request #1251 from hartzell/patch-4
Minor typo fix
2016-07-15 13:51:02 -07:00
Adam J. Stewart
a4a2f179c7 Updates to run-flake8 test 2016-07-15 12:11:41 -05:00
Erik Schnetter
4663288b49 Update to OpenMPI 2.0.0 2016-07-15 13:00:48 -04:00
George Hartzell
64b1bafd41 Make flake8 happy with .../jdk/package.py
My PR for adding a new jdk version failed its
travis run because of existing flake8 violoations.

This package cleans them up.

I'm not particularly pythonic, but most of the complaints were
obvious.  HOWEVER, I'm not particularly confident about handling
long lines by taking an flake8 exception comment onto the end.

Feedback welcome...
2016-07-15 12:39:40 -04:00
Mitchell Devlin
5f1b6f000d add HMMER package 2016-07-15 11:03:57 -05:00
Denis Davydov
b29b7595dd mkl: add info on interface and threading layers to the docstring 2016-07-15 17:35:10 +02:00
alalazo
1f3cb2b93c Merge branch 'develop' of https://github.com/LLNL/spack into features/module_refresh
Conflicts:
	lib/spack/spack/cmd/module.py
2016-07-15 10:37:27 +02:00
Todd Gamblin
077848fc0b Merge pull request #378 from mathstuf/dep-types
dependency types
2016-07-15 00:29:16 -07:00
Todd Gamblin
f3e9588457 Fix package name bug. 2016-07-14 23:15:54 -07:00
Gregory Becker
487ec2aff1 added py-pydatalog package 2016-07-14 23:12:35 -07:00
Todd Gamblin
b8e2799700 Add GNU Prolog package. 2016-07-14 14:38:30 -07:00
Ben Boeckel
5d152edcaf spec: assign namespaces to the full dependency DAG 2016-07-14 16:33:48 -04:00
Ben Boeckel
faa3d43d9c package: mention the package that is no concrete 2016-07-14 16:33:38 -04:00
Ben Boeckel
a0584c78a8 foam-extend, sundials: add cmake as a builddep
The sundials doesn't use CMake directly, but it is referenced in the
patch step. I suspect it calls CMake somewhere else in its build system.
2016-07-14 16:21:47 -04:00
Ben Boeckel
d71a12438b cantera: use nolink for python module dependencies
Unsure about this, but this is probably true.
2016-07-14 16:21:47 -04:00
Ben Boeckel
39aef5fc00 lua: bring in run deps of build and run deps 2016-07-14 16:21:47 -04:00
Ben Boeckel
a82385cdae R: look only at run dependencies of build and run deps 2016-07-14 16:21:46 -04:00
Ben Boeckel
0ca1a481a3 python: setup the dependent environment properly
We want the run dependencies of all build and run dependencies of the
current package.
2016-07-14 16:21:46 -04:00
Ben Boeckel
ac1701ae29 msgpack-c: add missing dependency on cmake 2016-07-14 16:21:46 -04:00
Ben Boeckel
77965ce5bf py-matplotlib: require py-setuptools to build 2016-07-14 16:21:46 -04:00
Ben Boeckel
6fd45520da deptypes: mark deptypes in packages 2016-07-14 16:21:46 -04:00
Ben Boeckel
45c675fe7f spack: introduce dependency types
deptypes: allow for different queries

For things like Python modules, they are required for the build and
runtime, but rather than adding a new parameter for what to query across
the dependency DAG, just expose the recursive query parameter.
2016-07-14 16:21:46 -04:00
Ben Boeckel
bae97d17d0 test: use file:// url for git repos 2016-07-14 16:21:45 -04:00
Ben Boeckel
bdf82246f7 darwin: explicitly use the 'when=' kwarg 2016-07-14 16:21:45 -04:00
Ben Boeckel
1ae43b3405 doxygen: add missing import 2016-07-14 16:21:45 -04:00
Ben Boeckel
6d2ec9baf7 test/stage: use os.path.realpath on the test paths
When var/spack/stage is a symlink, the tests fail since realpath is used
on the resulting path, but not the original path, so the string compare
fails. Smarter path testing might be a better option.
2016-07-14 16:21:45 -04:00
Ben Boeckel
b4682c8ca3 directory_layout: fix error path when specs conflict 2016-07-14 16:21:45 -04:00
Ben Boeckel
e275b567eb typos: fix some typos 2016-07-14 16:21:45 -04:00
Michael Kuhn
64d91943ec Support --dependencies for recursively loading modules. 2016-07-14 20:14:06 +02:00
George Hartzell
3e718920d1 Remove extraneous letter 'p'
It got in there by mistake, now it's gone.
2016-07-14 09:40:47 -07:00
George Hartzell
3051c3d71d Fix format of explanation of an example & question
This list was not formatted correctly on [the ReadTheDocs site](http://software.llnl.gov/spack/basic_usage.html#specs-dependencies).

I'm not a .rst expert, but I think that it was improperly indented.

The example includes an `arch=...` string but *arch* is not listed in the valid compiler flag specifiers or architecture specifiers.  Should it be, or is it considered an "optional variant specifier?
2016-07-14 08:31:07 -07:00
George Hartzell
e052aaf44d Minor typo fix
the packages that depends on => the packages that depend on
2016-07-14 08:19:32 -07:00
Denis Davydov
668b4f1b2c mkl: set MKLROOT 2016-07-13 23:36:23 +02:00
Michael Kuhn
5ffc50732b flake8 fixes 2016-07-13 23:05:08 +02:00
Michael Kuhn
fcfe2618d5 Improve shell integration.
Enable sh emulation for Zsh and allow loading modules recursively.
2016-07-13 20:33:14 +02:00
Todd Gamblin
d24c11f2b1 Merge pull request #1231 from adamjstewart/fixes/bzip2
Patch both bzip2 makefiles
2016-07-13 10:46:58 -07:00
Adam J. Stewart
3864da6300 Flake8 2016-07-13 11:45:16 -05:00
Adam J. Stewart
d09b0c95ec Filter both makefiles to allow intel to build bzip2 2016-07-13 11:45:16 -05:00
alalazo
0e2afedb7f doc : fixes #1239 2016-07-13 12:43:48 +02:00
Denis Davydov
de9cce3e80 p4est: flake8 2016-07-13 11:45:33 +02:00
Denis Davydov
52ca215e29 mkl: add provide blas/lapack 2016-07-13 11:42:40 +02:00
Denis Davydov
b8bd02c5b2 p4est: use run_tests instead of a variant 2016-07-13 10:56:40 +02:00
George Hartzell
a73d91a2e5 Add URL and md5 for jdk-8u92.
Installed on Centos7.2 system, `java -version` works.
2016-07-12 16:59:08 -04:00
Todd Gamblin
27aa265abd Merge pull request #1211 from hartzell/patch-3
Typo: verison -> version
2016-07-12 13:53:52 -07:00
Michael Kuhn
b7d9b58cc5 Fix preferred providers. 2016-07-12 19:57:08 +02:00
Glenn Johnson
955d02049c New package - r-ggvis
Bring in ggvis and dependencies.

GGvis is an implementaion of the 'Grammar of Graphics', combined with
shiny.
2016-07-12 12:27:54 -05:00
Todd Gamblin
069de3f008 Merge pull request #1223 from glennpj/tidyr
New package - r-tidyr
2016-07-12 00:23:09 -07:00
Todd Gamblin
04b3d8d86f Merge pull request #1222 from glennpj/libxml2
Use the site_packages_dir from the Python class
2016-07-12 00:22:45 -07:00
Glenn Johnson
502d15fd3b New package - r-tidyr
Tools for changing the layout of data sets.
2016-07-11 21:12:28 -05:00
Glenn Johnson
5e323b052a Remove import of os
The import of `os` is no longer needed.
2016-07-11 20:21:25 -05:00
Glenn Johnson
81daaddfe9 Use the site_packages_dir from the Python class
It is not necessary to set site_packages_dir in this package as it is
already provided by the Python package class.
2016-07-11 20:08:30 -05:00
Todd Gamblin
38e722f75d Merge pull request #1215 from glennpj/prefix_inspections
Add share/man to prefix inspections.
2016-07-11 16:47:22 -07:00
Todd Gamblin
15790d7018 Merge pull request #1207 from davydden/pkg/dealii_update_petsc37
dealii: update for petsc37
2016-07-11 15:32:32 -07:00
Todd Gamblin
551d9eb328 Merge pull request #1220 from glennpj/libxml2
Fix libxml2 error reported on Google Groups list
2016-07-11 15:27:15 -07:00
Glenn Johnson
1b08296392 Fix flake8 error 2016-07-11 17:22:31 -05:00
Glenn Johnson
8de84b5d8a Fix error reported on Google Groups list
Fixes the reported `TypeError: not enough arguments for format string`
error.
2016-07-11 16:56:26 -05:00
Todd Gamblin
78ac11ff88 Merge pull request #1217 from LLNL/features/git-submodule-init
Add `submodules` option for git fetching.
2016-07-11 14:17:41 -07:00
Todd Gamblin
283d621b6e Add documentation for fetching submodules. 2016-07-11 13:27:37 -07:00
Todd Gamblin
86b1b28906 Add submodules option for git fetching. 2016-07-11 13:27:35 -07:00
Todd Gamblin
efdcd199c1 Merge pull request #1218 from glennpj/dplyr
New package - r-dplyr
2016-07-11 13:19:09 -07:00
Todd Gamblin
db1516d582 Merge pull request #1219 from glennpj/lubridate
New package - r-lubridate
2016-07-11 13:18:44 -07:00
Glenn Johnson
d99fbbb68f New package - r-lubridate
Functions to work with date-times and timespans.
2016-07-11 14:59:47 -05:00
Glenn Johnson
11960e53ef New package - r-dplyr
This brings in dplyr and dependencies.
2016-07-11 14:50:33 -05:00
alalazo
5f861e075c Merged develop into branch 2016-07-11 20:57:55 +02:00
Todd Gamblin
255d05a9c1 Merge pull request #1214 from glennpj/rfilter
Filter compilers for R
2016-07-11 11:37:39 -07:00
Glenn Johnson
6d36ec3d76 Add share/man to prefix inspections.
The share/man path should be in prefix_inspections for MANPATH as
share/man is a common location for manual pages.
2016-07-11 13:35:22 -05:00
Todd Gamblin
7f6541ef02 Merge pull request #1190 from davydden/feature/version_dev
add special treatment of @develop version
2016-07-11 11:31:54 -07:00
Glenn Johnson
664bdd359f Filter compilers for R
This adds a filter_compilers function to have the Makeconf file for R
point to the actual compilers rather than the spack wrappers. Also added
version 3.3.1.
2016-07-11 13:29:43 -05:00
Denis Davydov
306e601d4e document special treatment of development version 2016-07-11 19:50:33 +02:00
George Hartzell
fbaff33f3f Typo: verison -> version 2016-07-11 09:44:20 -07:00
Todd Gamblin
a729c332c8 Merge pull request #1210 from hartzell/patch-2
Typo: verison -> version
2016-07-11 09:43:52 -07:00
George Hartzell
1682257b35 Typo: verison -> version 2016-07-11 09:42:49 -07:00
Todd Gamblin
691e628726 Merge pull request #1206 from davydden/pkg/slepc_371_fix
slepc: fix install_name for binaries on macOS for 3.7.1
2016-07-11 09:14:53 -07:00
Todd Gamblin
85947d0985 Merge pull request #1209 from paulhopkins/bugfix/octave-suitesparse-variant
Fix typo in Octave variant suitesparse
2016-07-11 08:58:37 -07:00
Paul Hopkins
0d3a52ae29 Fix typo in Octave variant suitesparse 2016-07-11 16:00:19 +01:00
Denis Davydov
1b553f2b21 dealii: fix directory structure 2016-07-11 13:21:16 +02:00
Denis Davydov
f14cd67446 dealii: flake8 fixes 2016-07-11 10:56:57 +02:00
Denis Davydov
84afaf385f dealii: run tests only when self.run_tests=true 2016-07-11 10:22:29 +02:00
Denis Davydov
1cc6e42682 dealii: add petsc/slepc 3.7 support 2016-07-11 10:20:15 +02:00
Denis Davydov
38550bbc1b slepc: fix install_name for binaries on macOS for 3.7.1 2016-07-11 10:17:09 +02:00
Geoffrey Oxberry
7551e4c14f cmake@3.6.0
Add CMake version 3.6.0.
2016-07-10 18:02:51 -07:00
Denis Davydov
b29d5e6032 add special treatment of develop version 2016-07-10 14:21:52 +02:00
Todd Gamblin
b0f4052bd8 Merge pull request #1169 from davydden/feature/install_argument_tests_petsc_fixes
--run-tests install argument and petsc fixes
2016-07-09 12:10:16 -07:00
Denis Davydov
e482994a15 petsc: add -lm when building example 2016-07-09 08:12:34 +02:00
Todd Gamblin
c086ccdab6 Merge pull request #1200 from glennpj/lowpackname
Have ``spack create`` default to lower case name for package
2016-07-08 13:29:52 -07:00
Glenn Johnson
33d0660abc Have `spack create` default to lower case name
This will create package directories with lower case names when using
`spack create`. The documentation was modified to reflect this.
2016-07-08 15:11:37 -05:00
Todd Gamblin
3338fcf014 Merge pull request #1199 from eschnett/eschnett/cereal-update
Update Cereal to 1.2.0
2016-07-08 12:21:14 -07:00
Erik Schnetter
c8137194f0 Update Cereal to 1.2.0 2016-07-08 15:20:09 -04:00
Todd Gamblin
f04258eb29 Merge pull request #1192 from SteVwonder/develop
docbook-xml: replace 'cp -t' with install_tree
2016-07-08 11:09:41 -07:00
Todd Gamblin
1fa67e458c Merge pull request #1194 from SteVwonder/lua-fix
lua: switch self.version[:2] to .up_to(2)
2016-07-08 11:09:18 -07:00
Todd Gamblin
642be5fa3d Merge pull request #1197 from SteVwonder/json-c-serial-build
json-c: fix build by running serially
2016-07-08 11:08:10 -07:00
Todd Gamblin
2759f14f23 Merge pull request #1198 from hartzell/patch-1
Fix typo
2016-07-08 11:08:00 -07:00
George Hartzell
1b9e8a0e65 Fix typo
Comamnds -> Commands
2016-07-08 11:01:08 -07:00
Stephen Herbein
bb8a8ecda3 json-c: fix build by running serially 2016-07-08 10:39:47 -07:00
Paul Hopkins
49e8e4b590 Add comments explaining UCS4 and prevent variant being used on Python 3.3 and above 2016-07-08 13:47:25 +01:00
Stephen Herbein
1a1bf31032 lua: switch self.version[:2] to .up_to(2)
Previous package would not install correctly, would throw:
return os.path.join('share', 'lua', '%d.%d' % self.version[:2])
TypeError: %d format: a number is required, not Version
2016-07-07 18:58:52 -07:00
Stephen Herbein
1b53452618 docbook-xml: replace 'cp -t' with install_tree
'-t' is not supported by the default cp on Mac OS X

replace with install/install_tree

cannot just use install_tree since shutil.copytree insists that the dst
directory not exist
2016-07-07 17:41:53 -07:00
Nicolas Richart
d339f2af29 flake8 corrections 2016-07-07 18:22:27 +02:00
Nicolas Richart
4c1b53660d fixes #719 2016-07-07 18:18:01 +02:00
Paul Hopkins
a2be05f24b Fix whitespace 2016-07-07 14:00:37 +01:00
Paul Hopkins
719b6bfffd Modify range for ucs4 2.* configure arguments 2016-07-07 13:18:40 +01:00
Paul Hopkins
8c1274bbbb Fix Python configure arguments for ucs4 variant on Python 3.0 and above 2016-07-07 13:12:43 +01:00
Paul Hopkins
fb6d850637 Add more python versions 2016-07-07 13:09:08 +01:00
Todd Gamblin
b9148b1751 Merge pull request #1125 from NERSC/docs/cray
Update documentation for use on Cray
2016-07-06 15:06:20 -07:00
Gregory Becker
403a55afb2 Minor bug fix 2016-07-06 14:54:25 -07:00
Gregory Becker
663b30b3e8 Update target autodetection for linux platform 2016-07-06 14:54:22 -07:00
Todd Gamblin
6bb31a9a4c Merge pull request #1175 from davydden/pkg/arpack-3.4.0
Pkg/arpack 3.4.0
2016-07-06 14:45:21 -07:00
Todd Gamblin
91da3d8e64 Merge pull request #1174 from LLNL/bugfix/github-1172-suite-sparse
Bugfix/GitHub 1172 suite sparse
2016-07-06 14:35:59 -07:00
Todd Gamblin
c6e89d9283 Merge pull request #1180 from davydden/pkg/oce_update_and_fix
oce: add 0.17.2; fix running tests
2016-07-06 14:27:05 -07:00
Denis Davydov
14cef6eab8 oce: flake8 fixes 2016-07-06 22:51:20 +02:00
Denis Davydov
c096bb332a petsc: fix unit tests 2016-07-06 22:45:43 +02:00
Denis Davydov
081918d71a add --run-tests argument for install() 2016-07-06 22:45:30 +02:00
Todd Gamblin
58487accdd Merge pull request #1179 from paulhopkins/features/python-ucs4
Add ucs4 unicode variant to Python package
2016-07-06 12:27:04 -07:00
Greg Lee
3df0f1902d clean up suitesparse deps 2016-07-06 12:15:20 -07:00
Greg Lee
4e27d91351 flake 8 fixes 2016-07-06 11:51:32 -07:00
Denis Davydov
57eaea2e8c oce: add 0.17.2; fix running tests 2016-07-06 20:35:59 +02:00
Paul Hopkins
61fe89bda0 Add ucs4 unicode variant to Python package 2016-07-06 18:29:54 +01:00
Denis Davydov
3d755a148b arpack-ng: fix binaries for macOS 2016-07-06 18:30:38 +02:00
Todd Gamblin
03fdb2058a Merge pull request #1176 from epfl-scitas/features/version_minor_improvements
spack.Version : like a duck!
2016-07-06 09:01:19 -07:00
alalazo
379f23be02 swiftsim : fixed configuration for metis 2016-07-06 17:51:46 +02:00
alalazo
9b926a480f qa : flake8 issues 2016-07-06 17:03:32 +02:00
alalazo
780a57367d version : modified __getitem__ to return either an item or a Version instance + unit tests 2016-07-06 17:00:48 +02:00
alalazo
32e086f44a version : modified __repr__ to return a string representation of the object + unit tests 2016-07-06 15:24:10 +02:00
Denis Davydov
c8fc56686c arpack-ng: fix corrupted parpack_cmake.patch 2016-07-06 13:42:59 +02:00
Denis Davydov
63e45c586c arpack-ng: flake8 fixes and minor update of incode comments 2016-07-06 13:27:02 +02:00
Denis Davydov
a47b3ba01b arpack-ng: use spec['mpi'].mpif77 2016-07-06 13:23:51 +02:00
Denis Davydov
f5f7abd71f arpack-ng: add 3.4.0 with cmake build 2016-07-06 12:59:42 +02:00
Todd Gamblin
2b9d02d594 Merge pull request #1173 from willkill07/bugfix/module/spec_typo
(bugfix) fixed typo of spec --> raw_spec
2016-07-05 15:45:27 -07:00
Greg Lee
4c063c6055 kludge to get suite-sparse-4.5.1 to link with -lstdc++ 2016-07-05 13:48:32 -07:00
Greg Lee
976b2b4d25 added suitesparse version 4.5.3 2016-07-05 13:45:22 -07:00
William Killian
1f64f08cb3 (bugfix) fixed typo of spec --> raw_spec 2016-07-05 13:32:37 -07:00
Todd Gamblin
cb9c4ac866 Merge pull request #1170 from eschnett/eschnett/py-h5py
Don't enforce `hdf5~mpi`
2016-07-05 09:02:43 -07:00
Erik Schnetter
79b3ef0362 Don't enforce hdf5~mpi 2016-07-05 10:58:11 -04:00
alalazo
55c4a676ad gts : added package 2016-07-05 14:30:48 +02:00
Todd Gamblin
d687e332ad 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
2016-07-04 22:59:02 -07:00
Todd Gamblin
690937f953 Add --dirty option to spack install.
- Allow install to be run without cleaning the environment.
2016-07-04 22:58:01 -07:00
Todd Gamblin
6bac1598f6 Merge branch 'fix-archive' of https://github.com/mwilliammyers/spack into mwilliammyers-fix-archive 2016-07-04 21:35:33 -07:00
Todd Gamblin
f2a692c515 Merge pull request #1163 from epfl-scitas/fixes/reserved_name_for_system_packages
fixes : reserved name for system packages
2016-07-04 21:25:50 -07:00
Todd Gamblin
d166c04db5 Merge pull request #1166 from glennpj/rstan
New package - RStan
2016-07-04 21:23:10 -07:00
Todd Gamblin
1de675e976 Merge pull request #1165 from robertdfrench/ruby-needs-ffi-zlib
Ruby 2.2.0 needs ffi and zlib
2016-07-04 21:22:38 -07:00
Glenn Johnson
d5abcc5c88 Fix flake errors 2016-07-04 17:55:10 -05:00
Glenn Johnson
519b760222 New package - RStan
This PR creates the RStan package and its dependencies.
2016-07-04 17:30:05 -05:00
Robert D. French
53bbbfbe21 Require libffi, zlib; Make Openssl, readline optional 2016-07-04 15:21:13 -04:00
Todd Gamblin
9fb8030370 Merge pull request #1164 from epfl-scitas/revert-1023-packages/mumps
Revert "Corrected the shared libraries and tests in mumps package"
2016-07-04 10:02:33 -07:00
Nicolas
85982017b6 Revert "Corrected the shared libraries and tests in mumps package" 2016-07-04 18:19:09 +02:00
alalazo
861f174f66 qa : fixed flake8 issues 2016-07-04 10:26:32 +02:00
alalazo
3e8391458c openssl : changed tag for system reserved versions fixes #1150 2016-07-04 10:25:20 +02:00
Todd Gamblin
890df7153a Merge branch 'efischer/160311-StagedPackage' of https://github.com/citibeth/spack into citibeth-efischer/160311-StagedPackage 2016-07-04 00:27:32 -07:00
Todd Gamblin
2143c38ab8 Merge pull request #1158 from glennpj/intelfix
Use Executable to set script for Intel compiler installation
2016-07-03 23:16:32 -07:00
alalazo
6d988dde8d qa : fixed flake8 issues 2016-07-02 12:54:36 +02:00
alalazo
3100c5948a module : added unit tests 2016-07-02 12:14:30 +02:00
Glenn Johnson
729f23b432 Use Executable to set script
Use `Executable("./install.sh")` to set `install_script`. This allows it
to work when the current directory is not on the PATH.
2016-07-01 22:13:40 -05:00
Todd Gamblin
0de4ba738b Merge pull request #1157 from glennpj/envclean
Remove more variables from build environment
2016-07-01 20:13:32 -07:00
Glenn Johnson
31e9ded768 Remove more variables from build environment
Remove the LIBRARY_PATH and CPATH environment variables before building
a package.
2016-07-01 20:59:14 -05:00
alalazo
d10fceaacc spack commands : refactoring of cli arguments and common utiities. Implemented suggestions on spack module loads
- Common cli arguments now are in their own module
 - Moved utilities that can be reused by different commands into spack.cmd.__init__.py
 - Modifications to `spack module loads`
2016-07-01 23:06:07 +02:00
alalazo
0e171127b9 module : reverted typo introduced in a previous commit 2016-07-01 14:30:01 +02:00
alalazo
f0f7b23c8a module : added rm subcommand, encapsulated logic for constraints in argarse.Action subclass 2016-07-01 14:27:55 +02:00
alalazo
fe4ef286f2 module : added the command 'load-list' 2016-07-01 12:38:04 +02:00
Mario Melara
56adb5d9a5 Change arch spec and fix typo
Changed old arch specs to new arch specs. Changed intallation to
installation
2016-06-30 17:03:07 -07:00
Mario Melara
16a4c49f98 Remove Cray examples of config files
Removed examples of Cray config files and added them under Spack on
Cray. Any users of Cray can just look at the Spack on Cray section to
get an idea of what's used. If they want more information they can click
links to the sections.
2016-06-30 17:01:18 -07:00
Mario Melara
d784d561fc Add more documentation fix arch spec
Added more documentation for Spack on Cray. Also fixed the architecture
spec to be linux-debian7-x86_64 since it was reversed in the previous
commit.
2016-06-30 16:59:36 -07:00
Todd Gamblin
e837be1af9 Merge pull request #1153 from tzanio/mfem-3.2-dev
Updating MFEM package with v3.2 info.
2016-06-30 15:41:26 -07:00
Tzanio Kolev
137db14b75 Update package.py 2016-06-30 15:40:02 -07:00
Tzanio
d3b0cb56b7 Updating MFEM package with v3.2 info. 2016-06-30 15:23:30 -07:00
Massimiliano Culpo
6793a54748 --prefix : defaults to empty string 2016-06-30 23:18:32 +02:00
Massimiliano Culpo
ba1ada5424 Merge branch 'develop' of https://github.com/LLNL/spack into features/module_refresh_reworking
Conflicts:
	lib/spack/spack/cmd/module.py
2016-06-30 22:19:46 +02:00
alalazo
a770151359 module : minor improvement to output formatting 2016-06-30 16:49:24 +02:00
Elizabeth Fischer
6327877a6f PEP-8 2016-06-30 09:19:57 -04:00
Elizabeth Fischer
50ac98bc04 Merge remote-tracking branch 'upstream/develop' into efischer/160630-StagedPackage
# Conflicts:
#	lib/spack/docs/packaging_guide.rst
#	lib/spack/spack/package.py

Mostly minor/formatting issues in lib/spack/spack/package.py (the heavyweight merge was already done recently).  Only one serious issue: it looks like the feature branch had accidentally deleted the line `spack.hooks.post_install(self)`.  This got added back in from develop.
2016-06-30 09:13:24 -04:00
alalazo
ba87937fff module : added detection of file name clashes 2016-06-30 13:44:49 +02:00
alalazo
1b7eedbb7d modules.yaml : added hash_length as a new keyword
config :
- added `hash_length` under the modules section

EnvModules :
- take into consideration hash_length when constructing `file_name`
- added logic to warn and skip module file writing in case of file name clash
2016-06-30 12:56:47 +02:00
Todd Gamblin
0e422dec8c Merge pull request #1141 from adamjstewart/fixes/license_docs
Fix missing code blocks in licensed software documentation
2016-06-30 02:22:38 -07:00
Todd Gamblin
bc2fa76588 Merge pull request #1146 from scheibelp/features/doc-caching
added documentation for automatic caching of resources fetched during installs
2016-06-30 02:13:16 -07:00
Todd Gamblin
30d083c6b7 Merge branch 'efischer/160401-RecursiveModules' of https://github.com/citibeth/spack into citibeth-efischer/160401-RecursiveModules 2016-06-30 02:12:00 -07:00
Todd Gamblin
a7b8cb6901 Merge pull request #1145 from davydden/pkg/petsc_tests
petsc: run a test
2016-06-30 01:58:35 -07:00
Denis Davydov
6f4b0e9bda petsc: fix flake8 and ~mpi case in tests 2016-06-30 08:22:01 +02:00
Peter Scheibel
cfd380d514 added documentation for automatic caching of resources fetched during installs 2016-06-29 18:23:40 -07:00
Todd Gamblin
cd943ebe94 Merge pull request #1142 from adamjstewart/features/restview
Add py-restview package
2016-06-29 17:04:30 -07:00
Denis Davydov
37728afada petsc: run a test 2016-06-30 00:19:50 +02:00
Ben Boeckel
5f720f9b7c flake8: appease the style checker 2016-06-29 14:49:58 -04:00
Ben Boeckel
e3e94f0ac9 bootstrap: name the current branch the same as the remote 2016-06-29 14:49:19 -04:00
Ben Boeckel
89bf5f4045 bootstrap: allow using alternate remotes
If you want to bootstrap from a fork, the `--remote` option may be used
to select it.

Also limit the branches to 'develop' and 'master' if the remote is
'origin' since those are the actual integration branches used (other
branches on 'origin' are just PR branches).
2016-06-29 14:49:19 -04:00
Ben Boeckel
7ec191ce0b bootstrap: use the currently checked out branch
The `master` branch is not really where Spack development happens, so
default to it, but use the user's current branch if it's there.
2016-06-29 14:49:19 -04:00
Ben Boeckel
6f69c01915 bootstrap: fall back to the default upstream URL
Fixes #352.
2016-06-29 14:49:19 -04:00
Adam J. Stewart
2fcaa011ce Add py-restview package 2016-06-29 12:57:58 -05:00
Adam J. Stewart
06de8c56af Fix missing code blocks in licensed software documentation 2016-06-29 12:35:38 -05:00
Todd Gamblin
eb388306fd Merge pull request #1112 from adamjstewart/features/dependencies
Make spack create automatically add dependencies for build system
2016-06-29 07:57:33 -07:00
Todd Gamblin
c996632113 Add spack purge --cache to purge local archive cache. 2016-06-29 01:41:55 -07:00
Todd Gamblin
bc1320d83a Merge branch 'features/cache-archives' of https://github.com/scheibelp/spack into scheibelp-features/cache-archives 2016-06-29 00:57:26 -07:00
Todd Gamblin
7df89896f4 Merge pull request #1113 from davydden/octave_extensions
Octave extensions
2016-06-29 00:38:05 -07:00
alalazo
b71d430af6 module : can regenerate single module files, homogenized cli options
spack module :
- refresh accepts a constraint
- find and refresh share common cli options
- ask for confirmation before refreshing
- deleting the module file tree is now optional
2016-06-28 19:28:18 +02:00
Todd Gamblin
0fd58fb585 Merge pull request #1133 from davydden/pkg/dealii_fix_tests
dealii: run more unit tests when building @dev
2016-06-28 10:02:43 -07:00
Denis Davydov
32c801bbf6 dealii: run more unit tests when building @dev 2016-06-28 18:06:56 +02:00
Todd Gamblin
ad48ad7586 Merge pull request #1131 from epfl-scitas/fixes/swift_git_environment_variables
fix : swiftsim will set git environment variables in the appropriate hook
2016-06-28 09:05:26 -07:00
alalazo
5cdd37959a swiftsim : substituted tag with corresponding commit 2016-06-28 18:03:28 +02:00
Todd Gamblin
6810965457 Merge pull request #1130 from davydden/gmsh
Gmsh -- various fixes
2016-06-28 08:49:06 -07:00
alalazo
18612eca59 qa : fixed flake8 issues 2016-06-28 12:59:13 +02:00
alalazo
48888b0f8e swift : setting environment variables in the right place 2016-06-28 12:57:19 +02:00
Denis Davydov
c4c167c1ca octave: rename executable Octave to octave 2016-06-28 11:25:45 +02:00
Denis Davydov
51b0f53b33 gmsh: flake8 fixes 2016-06-28 10:50:35 +02:00
Denis Davydov
06e38d2ca2 gmsh: various fixes
(i) add new version
(ii) add OCE, PETSc and SLEPc as dependencies
(iii) fix Blas/Lapack configuration
(iv) disable internal Metis which does not compile
2016-06-28 10:33:25 +02:00
Todd Gamblin
793c9f5546 Merge pull request #1116 from mwilliammyers/package-lrzip
Add package lrzip & its dependency lzo
2016-06-27 22:32:57 -07:00
mwilliammyers
0384794912 Fix #1019 - cannot create mirror for git spec 2016-06-27 16:00:38 -06:00
Mario Melara
26325fe812 Add missing link to external packages
Adding missing _sec-external_packages to link with external packages
page
2016-06-27 14:35:56 -07:00
mwilliammyers
9bb918915f Add package lrzip & its dependency lzo 2016-06-27 15:19:13 -06:00
Mario Melara
7fb45e4bfd Update documentation for use on Cray
Updating how to use compilers.yaml on Cray as well as setting up
external packages. Also includes what needs to be set up for usage on
Cray and explains what needs to be done to get Spack properly working.
Also explain the architecture spec and what it does.
2016-06-27 13:52:48 -07:00
Todd Gamblin
d7c2f683d9 Merge pull request #1004 from UCL-RITS/bare-eigen
Option to install eigen without dependencies
2016-06-27 13:35:35 -07:00
Todd Gamblin
b80a03e6b6 Merge pull request #1124 from epfl-scitas/packages/fenics
Fenics: Corrections for PETSc 3.7 and detection of PETSC version to enable TAO
2016-06-27 13:32:57 -07:00
Nicolas Richart
9026fb8e8a Corrections for PETSc 3.7 and detection of PETSC version to enable TAO 2016-06-27 20:52:05 +02:00
Todd Gamblin
3ea9d1e665 Merge pull request #1122 from LLNL/bugfix/newarch-sys_type
Bugfix/newarch sys type
2016-06-27 10:07:03 -07:00
Todd Gamblin
bf4eeb48b9 Merge pull request #1099 from adamjstewart/fixes/hdf5
Fix self-check for hdf5@1.10.0-patch1
2016-06-27 09:47:17 -07:00
Todd Gamblin
76458f5bfc Merge pull request #1002 from epfl-scitas/packages/foam-extend
Package foam-extend
2016-06-27 09:40:49 -07:00
Adam J. Stewart
798dabc8f2 Forgot the unknown key/value pair 2016-06-27 09:01:53 -05:00
Denis Davydov
0faa6dd753 octave: make extendable and add a package 2016-06-27 13:44:58 +02:00
Todd Gamblin
0185226042 Merge pull request #1121 from LLNL/bugfix/module-directory-pollution
Make MockPackagesTest use a different module location.
2016-06-27 02:25:32 -07:00
Todd Gamblin
99c3ed56fa Add new sys_type method that prints out the *full* arch descriptor. 2016-06-27 02:19:26 -07:00
Todd Gamblin
305d5698df Rename spack.architecture.sys_type() to spack.architecture.platform() 2016-06-27 02:19:08 -07:00
Todd Gamblin
a15aee5d8e Make MockPackagesTest use a different module location.
- ensures anything tests create is blown away.
2016-06-27 01:22:03 -07:00
Todd Gamblin
d899059075 Merge pull request #1120 from LLNL/bugfix/mockdb-pollution
Fixes #760: spack test leaves builtin.mock packages in DB
2016-06-27 01:07:52 -07:00
Todd Gamblin
b4c36164b5 Fixes #760: spack test leaves builtin.mock packages in DB
- install_layout was redirected by the install test, but not the DB.
- redirect the DB now, as well.
2016-06-27 00:55:16 -07:00
Todd Gamblin
3bc4a38b78 Merge pull request #1118 from epfl-scitas/packages/swift_durham
swift : added new package
2016-06-27 00:39:45 -07:00
alalazo
13fcb3c083 swift : renamed swiftsim 2016-06-27 09:25:58 +02:00
alalazo
f3f309a22a Merge branch 'develop' of https://github.com/LLNL/spack into packages/swift_durham 2016-06-27 09:08:37 +02:00
Todd Gamblin
73213ac59d Merge pull request #984 from epfl-scitas/module_file_explicit_load
module files : explicit load and mnemonic suffixes
2016-06-26 23:33:48 -07:00
Todd Gamblin
a1db306a0c Merge pull request #1009 from epfl-scitas/packages/emacs
Emacs: adding dependencies to be able to build without the system libs
2016-06-26 22:46:45 -07:00
Todd Gamblin
19b69ce3a5 Merge pull request #1097 from citibeth/efischer/160622-DBErrors
Improved Spack database errors to help users fix them.
2016-06-26 22:45:44 -07:00
Todd Gamblin
ece72e5337 Merge pull request #1030 from opoplawski/external
Remove last two remaining from external imports
2016-06-26 22:41:58 -07:00
Todd Gamblin
bad32724ec Merge pull request #1092 from adamjstewart/features/netcdf-f
Add latest version of netcdf-fortran and curl
2016-06-26 22:38:00 -07:00
Todd Gamblin
8f28df1d14 Merge pull request #1094 from epfl-scitas/documentation/remove_packages_yaml_inconsistencies
packages.yaml : removed references to a never implemented feature
2016-06-26 22:37:43 -07:00
Todd Gamblin
8b35940857 Merge pull request #1103 from adamjstewart/features/mpi
Add MPI environment variables to packages
2016-06-26 22:35:39 -07:00
Todd Gamblin
30993357d7 Merge pull request #1105 from adamjstewart/fixes/filter_file
Fix backup logic in filter_file
2016-06-26 22:33:09 -07:00
Todd Gamblin
f86f6c6274 Merge pull request #1104 from mwilliammyers/py-protobuf
Add new package py-protobuf
2016-06-26 22:28:57 -07:00
Todd Gamblin
7d85902f37 Merge pull request #1093 from eschnett/eschnett/julia-update
Update Julia to 0.4.6
2016-06-26 22:28:33 -07:00
Todd Gamblin
c096aa9557 Merge pull request #997 from glennpj/glib_gcc
Get glib to compile with gcc-6.1
2016-06-26 22:28:07 -07:00
Nicolas Richart
f3accb111e correcting flake8 2016-06-27 01:23:14 +02:00
Nicolas Richart
7cf1313572 changes to use from_sourcing_file 2016-06-27 00:55:26 +02:00
Todd Gamblin
18222de7b6 Merge pull request #1119 from epfl-scitas/fixes/moved_packages
fixes : moved packages into builtin/repo
2016-06-26 13:50:00 -07:00
alalazo
9de0503188 qa : flake8 issues 2016-06-26 22:00:10 +02:00
alalazo
11863d2de3 packages : moved adios and mxml into builtin repo 2016-06-26 21:56:06 +02:00
alalazo
a2ba60f6a8 qa : flake8 issues 2016-06-26 17:38:48 +02:00
alalazo
e5b36583b5 swift : added package 2016-06-26 17:36:53 +02:00
alalazo
acd9014553 autotools : set Executable() in dependent modules 2016-06-26 17:36:33 +02:00
Adam J. Stewart
ea88d9cfe9 Make spack create automatically add dependencies for build system 2016-06-24 16:43:31 -05:00
Todd Gamblin
055f7f4ab6 Add package_dir method to package.py. 2016-06-24 12:33:53 -07:00
mwilliammyers
2c6c21a3bf Add new package py-protobuf 2016-06-23 15:54:20 -06:00
Adam J. Stewart
71a297f121 Fix backup logic in filter_file 2016-06-23 16:44:41 -05:00
Adam J. Stewart
8921bf4552 Add MPI environment variables to packages 2016-06-23 10:08:40 -05:00
Todd Gamblin
65e3ac4132 Merge pull request #1102 from LLNL/bugfix/sbang-lua-fix
Make sbang handle lua
2016-06-23 01:20:01 -07:00
Todd Gamblin
27e9bc6d02 Make sbang handle lua
- use --! instead of #! for patched lua scripts.
2016-06-23 00:03:23 -07:00
Adam J. Stewart
d566510a40 Flake8 and url_for_version fixes 2016-06-22 15:22:42 -05:00
Adam J. Stewart
3f4bf04dde Fix self-check for hdf5@1.10.0-patch1 2016-06-22 14:40:51 -05:00
Elizabeth Fischer
8f846d507d Added --prefix to module command. 2016-06-22 15:36:04 -04:00
Elizabeth Fischer
10810482bc Update database.py
PEP8
2016-06-22 14:03:32 -04:00
Elizabeth Fischer
ffe9e77e36 Improved Spack database errors to help users fix them. 2016-06-22 12:11:09 -04:00
Todd Gamblin
86893e3dc4 Merge pull request #1096 from robertdfrench/import-which
Import which from spack.util.executable; Fixes #1095
2016-06-22 09:06:01 -07:00
Robert.French
ff3e56cf9a Import which from spack.util.executable; Fixes #1095 2016-06-22 15:25:32 +00:00
Erik Schnetter
c904a42c5b Address flake errors 2016-06-22 11:09:45 -04:00
alalazo
f29b55957a documentation : removed references to never implemented features 2016-06-22 17:08:02 +02:00
Adam J. Stewart
b66f5b6231 Add latest version of cURL 2016-06-22 10:05:20 -05:00
Erik Schnetter
e398c0dc5b Update Julia to 0.4.6 2016-06-22 11:00:00 -04:00
Adam J. Stewart
060fb596f7 Add latest version of netcdf-fortran 2016-06-22 09:52:17 -05:00
Nicolas Richart
97feca0888 Merge branch 'develop' into packages/foam-extend 2016-06-22 14:51:57 +02:00
Todd Gamblin
e41d67e031 Merge pull request #1078 from adamjstewart/features/pillow
Allow py-pillow to link to Spack-built libraries
2016-06-22 01:11:25 -07:00
Todd Gamblin
8b5467e65d Merge pull request #1049 from glennpj/newR_database
New R database packages
2016-06-21 13:23:58 -07:00
Adam J. Stewart
a7ffb2c1a4 Flake8 2016-06-21 15:21:53 -05:00
Todd Gamblin
bbe2db5814 Merge pull request #1087 from LLNL/bugfix/new-harfbuzz-fix
Bugfix/new harfbuzz fix
2016-06-21 13:10:50 -07:00
Adam J. Stewart
66089c89aa Depend on pil 2016-06-21 14:55:49 -05:00
Adam J. Stewart
2efc67da60 Remove +tk variant, provide pil 2016-06-21 14:50:33 -05:00
Gregory L. Lee
e0fbf14f99 consolidated f2py regex 2016-06-21 09:23:58 -07:00
Gregory L. Lee
8f3954c1bd flake 8 fixes for cairo, freetype, and harfbuzz 2016-06-21 08:47:22 -07:00
Gregory L. Lee
4041f45b6c fixed conflicts in python package 2016-06-21 08:47:11 -07:00
Todd Gamblin
58cff1290d Make environment test less sensitive to user config files. 2016-06-21 00:19:28 -07:00
Todd Gamblin
0521b9bb32 Fix merge error. 2016-06-21 00:08:12 -07:00
Todd Gamblin
f18e1a9371 Merge branch 'features/cantera' of https://github.com/adamjstewart/spack into adamjstewart-features/cantera 2016-06-20 23:53:48 -07:00
Todd Gamblin
3f90fee614 Merge pull request #1085 from NERSC/bugfix/compiler_find
Bugfix/compiler find and gfortran fix.
2016-06-20 23:46:13 -07:00
Glenn Johnson
77cd474a2d Make all packages lowercase. 2016-06-20 20:10:44 -05:00
Todd Gamblin
70a25c4587 Change --insensitive to --sensitive in spack list 2016-06-20 17:17:25 -07:00
Todd Gamblin
cbd5a0a6e3 Merge branch 'list-ext' of https://github.com/trws/spack into trws-list-ext 2016-06-20 17:13:32 -07:00
Todd Gamblin
db81a74d66 Merge pull request #939 from davydden/docs/blas_lapack
document blas and lapack usage in packages
2016-06-20 17:11:09 -07:00
Todd Gamblin
a3431c5a73 Merge pull request #1047 from epfl-scitas/source_diffs_in_environment_modifications
feature : construct environment modifications sourcing files
2016-06-20 16:56:30 -07:00
Mario Melara
d515877d91 Add init_config args in compilers/__init__ 2016-06-20 16:20:52 -07:00
Mario Melara
4c4f3e9747 Add init_config to compiler_find method 2016-06-20 16:20:33 -07:00
Todd Gamblin
76d950b103 Merge pull request #1084 from epfl-scitas/packages/openmpi_without_fortran
OpenMPI : reverts part of #1079
2016-06-20 13:30:54 -07:00
alalazo
5aa3131385 qa : fixed flake8 issues 2016-06-20 21:11:33 +02:00
alalazo
b86e3047f3 openmpi : revert part of #1079 (OpenMPI can be built without fortran)
Building OpenMPI without fortran is possible, and was already handled.
 Raising an install error we effectively renounce at clang+OpenMPI.

 build_environment : sets 'CC', 'CXX', and similar variables only if a compiler is found
2016-06-20 20:46:11 +02:00
Tom Scogland
45482187b4 one more typo issue 2016-06-20 11:42:35 -07:00
Tom Scogland
f6aa864bc4 adding quotes to make sure the glob is interpreted correctly 2016-06-20 11:41:36 -07:00
Tom Scogland
ac728d3e60 fixing capitol->capital typos 2016-06-20 11:38:39 -07:00
Tom Scogland
6180e6c047 automatic case-insensitive like smartsearch, docs
New documentation for the new options, also case insensitive by default
unless the user includes an upper-case character in their pattern.
2016-06-20 11:33:56 -07:00
Mario Melara
6fb7b0fcf7 Merge branch 'develop' of https://github.com/LLNL/spack into bugfix/compiler_find
Forgot to pull branch changes before
2016-06-20 10:59:28 -07:00
Mario Melara
88888f5ba0 Got rid of unnecessary module arg 2016-06-20 10:58:20 -07:00
Mario Melara
1303b5a6a9 Adding more init_config as args to all_compilers,all_compilers_config, and get_compiler_config 2016-06-20 10:57:58 -07:00
Mario Melara
fe30113502 Adding init_config back. Don't initalize config rather let compiler_find do all the work. spack compiler list and spack compilers can do the work 2016-06-20 10:57:10 -07:00
Tom Scogland
0377f3580b switching argument naming 2016-06-20 10:53:19 -07:00
Todd Gamblin
f74d4b0660 Merge pull request #1052 from adamjstewart/features/psi4
Add Psi4 Package
2016-06-20 10:49:45 -07:00
Todd Gamblin
9b299cb2bb Merge pull request #1023 from epfl-scitas/packages/mumps
Corrected the shared libraries and tests in mumps package
2016-06-20 10:48:12 -07:00
Todd Gamblin
cec283f608 Merge pull request #1059 from epfl-scitas/packages/mpi_wrappers_with_rpath
MPI : have wrappers set RPATH instead of RUNPATH
2016-06-20 10:47:24 -07:00
Adam J. Stewart
aa86488fd9 Flake8 2016-06-20 12:47:17 -05:00
Todd Gamblin
c2d0870924 Merge pull request #1063 from eschnett/eschnett/openmpi-1.10.3
Update OpenMPI to 1.10.3
2016-06-20 10:45:56 -07:00
Todd Gamblin
42ff1aaa75 Merge pull request #1064 from LLNL/bugfix/github-1043-script-backup
do not create shebang.bak file
2016-06-20 10:45:42 -07:00
Todd Gamblin
31bb47356f Merge pull request #1022 from glennpj/r-devtools
new package: r-devtools
2016-06-20 10:34:23 -07:00
Todd Gamblin
b3881701c5 Merge pull request #1021 from glennpj/packrat
new package: r-packrat
2016-06-20 10:33:55 -07:00
Todd Gamblin
0fbd2fe224 Merge pull request #1000 from glennpj/new_R
Add version 3.3.0 of R and extensions
2016-06-20 10:33:43 -07:00
Todd Gamblin
c09111bbef Merge pull request #1053 from davydden/pkg/dealii_suite_update
update Petsc, Slepc, Trilinos, Superlu-dist and deal.II
2016-06-20 10:32:52 -07:00
Todd Gamblin
59318f4705 Merge pull request #1081 from mathstuf/pkg-config-path
modules.yaml: use the right envvar for pkg-config
2016-06-20 10:32:03 -07:00
Todd Gamblin
8047edfb56 Merge pull request #1029 from adamjstewart/features/armadillo
Add Armadillo and SuperLU packages
2016-06-20 10:29:29 -07:00
Todd Gamblin
265b9bcb0f Merge pull request #1076 from JRWynneIII/ferret
Added spec to build Ferret
2016-06-20 10:28:42 -07:00
Adam J. Stewart
be407f531e Move around extension logic 2016-06-20 12:24:45 -05:00
Adam J. Stewart
28b2e36230 Add ctest executable 2016-06-20 12:24:45 -05:00
Adam J. Stewart
afff40e584 Flake8 fix for R templates 2016-06-20 12:24:45 -05:00
Adam J. Stewart
c9eb5f8173 Use non-checksummed PyPi download URLs 2016-06-20 12:24:45 -05:00
Adam J. Stewart
5dfc2052bd Flake8 change 2016-06-20 12:24:45 -05:00
Adam J. Stewart
98d03c74e1 Add support for less common compression schemes 2016-06-20 12:24:45 -05:00
Adam J. Stewart
7e1ee463ca Install examples for sundials 2016-06-20 12:24:45 -05:00
Adam J. Stewart
5a55bb3f8d Modify R installation template 2016-06-20 12:24:45 -05:00
Adam J. Stewart
79fae306f6 Add extensions for Python/R and more configurable install 2016-06-20 12:24:45 -05:00
Adam J. Stewart
81ac3b62fc Filter compilers and link boost properly 2016-06-20 12:24:45 -05:00
Adam J. Stewart
9500f2718b More Flake8 2016-06-20 12:24:45 -05:00
Adam J. Stewart
a21e845ce7 Flake8 2016-06-20 12:24:45 -05:00
Adam J. Stewart
2220784eda Add scons support, .zip support, and Cantera package 2016-06-20 12:24:45 -05:00
Peter Scheibel
1dc62e8a19 Merge branch 'develop' into features/cache-archives 2016-06-20 10:16:02 -07:00
Todd Gamblin
12b9d6da10 Merge pull request #1083 from robertdfrench/tmux-2.2
Tmux 2.2
2016-06-20 09:36:55 -07:00
Todd Gamblin
8bdb6695c7 Merge pull request #1079 from davydden/pkg/blas_mpi_fortran
require fortran compilers for Openblas and Openmpi
2016-06-20 09:36:23 -07:00
Todd Gamblin
ce105e9bbe Merge branch 'bugfix/compiler_find' into develop 2016-06-20 09:34:25 -07:00
Todd Gamblin
84e21703bd Test no longer assumes compilers exist in /usr.
- makes a fake gcc instead, and tests that.
2016-06-20 09:28:39 -07:00
Robert.French
83b0c16728 Tmux 2.2 with PEP8
Tmux 2.2

Provide variant to skip utempter

Remove utempter variant; 2.2 doesn't need it

Flake8ify
2016-06-20 16:26:49 +00:00
Ben Boeckel
973caa3a07 modules.yaml: use the right envvar for pkg-config
Fixes #1072.
2016-06-20 11:10:29 -04:00
Erik Schnetter
e43eaad557 New package porta 2016-06-19 14:11:36 -04:00
Erik Schnetter
a0c0728ea8 New package polymake 2016-06-19 13:47:26 -04:00
Erik Schnetter
b4da4425ff Add header files to lrslib install 2016-06-19 13:47:02 -04:00
Erik Schnetter
fa471a4ed1 Add missing header files to Bliss install 2016-06-19 13:46:38 -04:00
Erik Schnetter
d8b9cda632 Build Bliss both with and without GMP 2016-06-19 12:48:47 -04:00
Denis Davydov
cf4a34c657 openmpi: raise an error without Fortran compiler 2016-06-19 11:59:29 +02:00
Denis Davydov
1cc04cff27 openblas: raise an error without Fortran compiler 2016-06-19 11:59:10 +02:00
Erik Schnetter
71e92774eb New package cddlib 2016-06-18 22:47:59 -04:00
Erik Schnetter
8fa8fc239f New package "nauty and Traces" 2016-06-18 22:22:58 -04:00
Erik Schnetter
e5b08544ff New package Panda 2016-06-18 22:02:36 -04:00
Erik Schnetter
2009354719 Add fourier tool to lrslib 2016-06-18 21:38:15 -04:00
Erik Schnetter
a5086f474e New package lrslib 2016-06-18 18:03:09 -04:00
Erik Schnetter
92a7c0ddd5 Update Bliss to use -O3 2016-06-18 18:02:52 -04:00
Erik Schnetter
64aaf7ba81 New package cdd 2016-06-18 16:37:08 -04:00
Erik Schnetter
83d4cdc090 Update Bliss 2016-06-18 16:36:43 -04:00
Erik Schnetter
a07056d67b Add Bliss package 2016-06-18 16:20:37 -04:00
Mario Melara
64c83638ff Adding test to list of test_names 2016-06-18 11:11:46 -07:00
Mario Melara
15e6b88a8b Adding new tests for compiler command for spack's test suite 2016-06-18 10:51:38 -07:00
Mario Melara
36275f8e6e More clean up of init_config, also no need for a different find_compilers function. 2016-06-18 10:50:55 -07:00
Mario Melara
ccb62b4620 Getting rid of no longer used init_config arg 2016-06-18 10:49:39 -07:00
Todd Gamblin
f9efb746d7 Merge pull request #1032 from eschnett/eschnett/cc-quotes
Add quotes around file name
2016-06-18 08:57:18 -07:00
alalazo
9e0c20c794 environment : filter the current environment
Previously only the environment obtained after sourcing the file was filtered.
This caused the appeareance of spurious unset commands in the list.
2016-06-18 13:39:08 +02:00
alalazo
a17d1efe7c Merge branch 'develop' of https://github.com/LLNL/spack into features/source_diffs_in_environment_modifications
Conflicts:
	lib/spack/spack/test/environment.py
2016-06-18 13:31:29 +02:00
alalazo
670669ef80 qa : fixed flake8 issues 2016-06-18 13:10:35 +02:00
alalazo
a33077b77f unit tests : fixed test_alter_environment 2016-06-18 13:07:14 +02:00
alalazo
51cf847647 Merge branch 'develop' of https://github.com/LLNL/spack into features/module_file_explicit_load
Conflicts:
	lib/spack/spack/test/modules.py
2016-06-18 13:06:37 +02:00
Mario Melara
8af1c5fc8f Merge remote-tracking branch 'upstream/develop' into develop
"Updating NERSC branch"
2016-06-18 00:52:06 -07:00
Mario Melara
c703bfb54d Got rid of init_config flag since we don't need it. Instead we update the cache config if there are any changes 2016-06-18 00:48:08 -07:00
Adam J. Stewart
652a5eb592 Allow py-pillow to link to Spack-built libraries 2016-06-17 18:09:03 -05:00
Todd Gamblin
62b2f2a7c9 Merge pull request #1065 from epfl-scitas/packages/espresso_update
espresso : update to 5.4.0
2016-06-17 14:51:45 -07:00
Todd Gamblin
4569df025e Merge pull request #1060 from mathstuf/no-break-long-words
tty: do not break long words
2016-06-17 14:51:26 -07:00
Todd Gamblin
9a8d109650 Merge pull request #1044 from adamjstewart/features/sncosmo
Add py-sncosmo package
2016-06-17 14:50:37 -07:00
Todd Gamblin
d7f48e1ff0 Merge pull request #1061 from mathstuf/reindex-preserve-explicit
reindex: preserve 'explicit' flags
2016-06-17 14:29:47 -07:00
Todd Gamblin
0bbbfc2ef7 Merge pull request #946 from LLNL/features/intel2
Intel software packages and license enhancements
2016-06-17 14:28:39 -07:00
Tom Scogland
8770f2a0ea fixing last flake8 issue 2016-06-17 13:42:27 -07:00
Tom Scogland
0743ef4d0b fixing flake8 issues 2016-06-17 13:32:28 -07:00
Tom Scogland
a4ac99877a cmd/list: adding description search and glob by default 2016-06-17 12:00:35 -07:00
Adam J. Stewart
536fa73d5f Python flake8 overhaul 2016-06-17 13:33:09 -05:00
Robert D. French
448f8c43d4 Added working Ferret spec
Fixed ferret spec. It builds now

Made ferret spec more flake8-y

Fixed homepage and info text about Ferret

Removed vim swap file

Reverted changes to netcdf-fortran spec and added netcdf~mpi dependency to ferret spec to compensate for it

Fixed flake8 issues!
2016-06-17 14:23:50 -04:00
Mario Melara
fe5eec5230 'find and 'add' are options for adding compilers via command line 2016-06-17 09:16:03 -07:00
Adam J. Stewart
80d444624b Fix activation of sites.py for sncosmo 2016-06-17 11:08:16 -05:00
Adam J. Stewart
24f65c502e Add additional Astropy dependencies 2016-06-17 10:45:10 -05:00
Adam J. Stewart
b2aa78d6ab Remove version constraints 2016-06-17 10:45:10 -05:00
Adam J. Stewart
4eeaff175c Allow packages to build 2016-06-17 10:44:28 -05:00
Adam J. Stewart
a660c60eb1 Add py-sncosmo package 2016-06-17 10:43:34 -05:00
Glenn Johnson
8970785d33 Add 'jdk' as a dependency.
Add jdk as a dependency so that R has support for java and allow
packages that need java to work.
2016-06-16 23:08:55 -05:00
Glenn Johnson
a813f03955 Add list_url for old versions. 2016-06-16 23:08:55 -05:00
Glenn Johnson
4850b9d4d1 Make install comment consistent with actual call. 2016-06-16 23:08:55 -05:00
Glenn Johnson
7da405e630 Add validator for bioconductor packages
This commit adds a validator function to make sure the versions of R and
bioconductor are in sync.
2016-06-16 23:08:55 -05:00
Glenn Johnson
7213b12324 Tweak how R packages are built.
Add bzip2 as a dependency to base R.

Switch from installing the R packages from tar files to installing from
the extracted directory. This is more in line with a standard install
and also allows installing from VCS.

Use the Bioconductor version for BiocGenerics and future Bioconductor
packages. Suffix the package with 'bioc-$version' to indicate which
Bioconductor release the package is a part of. This is actually more
important than the actual version attached to individual packages
although those are subject to change within the Bioconductor branch.
2016-06-16 23:08:55 -05:00
Glenn Johnson
0e64c25ffc Fix flake8 errors
Use Bioconductor provided Short URL for homepage in BiocGenerics.
Wrap description text for utf variant in pcre.
2016-06-16 23:08:54 -05:00
Glenn Johnson
37dc13edaf Update version of BiocGenerics
The BioConductor repositories only keep the most recent version so this
has to be bumped.
2016-06-16 23:08:54 -05:00
Glenn Johnson
8704a4ed35 Use configure_args rather than options
Replaced 'options' with 'configure_args'. That seems like a better name
and is consistent with the packaging guide.
2016-06-16 23:08:54 -05:00
Glenn Johnson
fe256870b4 Add variant for UTF support to pcre
This will build PCRE with UTF support by default. That seems to be
reasonable for most environments.
2016-06-16 23:08:54 -05:00
Glenn Johnson
cb3505769b Clean up R extensions
Run the existing R extension packages through autopep8 to clean up.
2016-06-16 23:07:13 -05:00
Glenn Johnson
6649f9edc2 Add version 3.3.0 of R
This commit adds the 3.3.0 version of R and adds dependencies on curl
and pcre.
2016-06-16 23:07:13 -05:00
Glenn Johnson
64acbbfcf0 Clean up R package files
- remove unused imports
- apply pep8
- reformat text strings
2016-06-16 23:07:13 -05:00
Mario Melara
df84fe0b58 Added init_config parameter so we don't initialize the config when user runs spack compiler add. Should ONLY add what user specifies. Find compilers takes in paths parameter. 2016-06-16 18:10:38 -07:00
Todd Gamblin
f351e011d1 Merge pull request #1068 from epfl-scitas/fixes/flake8_no_f405
Flake8: ignore F405
2016-06-16 17:13:01 -07:00
Todd Gamblin
9ee6cbfb40 Merge pull request #944 from adamjstewart/features/bertini
Add bertini package
2016-06-16 16:57:50 -07:00
Todd Gamblin
344280154a Merge pull request #962 from adamjstewart/features/hpl
Add HPL benchmark package
2016-06-16 16:57:24 -07:00
Todd Gamblin
005827ab23 Replace 2.6-incompatible skipIf with a conditional.
- skipIf doesn't work with Python 2.6.
2016-06-16 12:12:29 -07:00
Todd Gamblin
f60ae61652 remove dead code, cleanup. 2016-06-16 10:44:15 -07:00
Todd Gamblin
8867adf942 simplify instance check. 2016-06-16 10:43:36 -07:00
Todd Gamblin
c7dfa1699a rename Mac OS X to macos 2016-06-16 10:43:12 -07:00
alalazo
a5aa159d9d flake8: ignore F405 2016-06-16 19:23:16 +02:00
Mario Melara
6b03770602 Added str method to mac_osx so that whenever we try to access darwins different operating systems we can grab the name correctly. This avoids having to worry whether we have a version attached to it or not. 2016-06-16 09:44:37 -07:00
Todd Gamblin
88b73bacdb Merge branch 'features/newarch' into develop
Conflicts:
	lib/spack/spack/config.py
	var/spack/repos/builtin/packages/lua/package.py
2016-06-16 03:03:26 -07:00
Todd Gamblin
17b868381f Fixes #460: Do not show variants by default in spack find.
This does two things:

1. By default `spack find` no longer shows variants.  You have to
   supply `-v` to get that

2. This improves the `colify` implementation so that it no longer pads
   the rightmost column.  This avoids the issue where if one spec was
   too long in the output, *all* specs would have space padding added
   to that width, and it would look like the output of `spack find`
   was double spaced.  This no longer happens -- the one bad line
   wraps around and the other lines are now single-spaced when you use
   `-v` with boost.
2016-06-16 02:55:33 -07:00
alalazo
a1cbb73f8b qa : fixed flake8 issues 2016-06-16 11:24:18 +02:00
alalazo
8d9ffcf565 espresso : updated to 5.4.0, added Parallel=False 2016-06-16 11:22:26 +02:00
Todd Gamblin
88b671f8b1 Just call old os "unknown" 2016-06-16 02:06:19 -07:00
Todd Gamblin
76dfaa71a7 fix up packages for new architecture. 2016-06-16 01:47:20 -07:00
Todd Gamblin
40d25d9062 Add libxcb dependencies. Fix up packages to get py-basemap and stat to build. 2016-06-16 00:56:53 -07:00
Todd Gamblin
f3d6818d5c be more tolerant when parsing new specs. 2016-06-16 00:55:39 -07:00
Todd Gamblin
c90cc465f5 Add __contains__ to arch to satsify old packages. 2016-06-16 00:54:59 -07:00
Gregory L. Lee
d4df4375d5 removed unused import per flake8 report 2016-06-15 20:32:08 -07:00
Gregory L. Lee
1724ff5658 do not create shebang.bak file 2016-06-15 20:21:02 -07:00
Gregory Becker
3fcd54203c two minor fixes 2016-06-15 16:44:38 -07:00
Gregory Becker
2fc9ac4036 Two minor fixes 2016-06-15 16:39:39 -07:00
Erik Schnetter
a7ab064a9e Update OpenMPI to 1.10.3 2016-06-15 18:05:23 -04:00
Adam J. Stewart
ea80c8d3c3 Ignore E501 for depends_on and extends 2016-06-15 14:38:53 -05:00
Massimiliano Culpo
daa46105a7 mpich based providers : shortened filter_compilers 2016-06-15 21:37:12 +02:00
Adam J. Stewart
44e188f111 Remove MPI support, fix INCLUDE filters 2016-06-15 14:17:30 -05:00
Adam J. Stewart
7b97ea248a More template filtering 2016-06-15 14:17:29 -05:00
Adam J. Stewart
9cf1257be4 Filter compilers 2016-06-15 14:17:29 -05:00
Adam J. Stewart
deb4f919cf Psi4 tweaks 2016-06-15 14:17:29 -05:00
Adam J. Stewart
9d99042fed Add Psi4 package 2016-06-15 14:17:29 -05:00
Ben Boeckel
716f12dd58 reindex: preserve 'explicit' flags
Look up in the old database whether the spec was explicit or not and
preserve it into the new database.

Fixes #1050.
2016-06-15 12:48:40 -04:00
Denis Davydov
0e04e65ae0 trilinos: specify superlu-dist version dependency 2016-06-15 18:44:59 +02:00
Denis Davydov
5fe531050c flake8 fixes for dealii 2016-06-15 18:33:34 +02:00
Denis Davydov
e76083205f flake8 fixes for slepc 2016-06-15 18:33:08 +02:00
Denis Davydov
6390acc660 flake8 fixes for petsc 2016-06-15 18:32:42 +02:00
Denis Davydov
6d714e4425 flake8 fixes for superlu-dist 2016-06-15 18:31:39 +02:00
Denis Davydov
3d3a26cd9a flake8 fixes for filesystem.py 2016-06-15 18:31:10 +02:00
Ben Boeckel
36decbfa69 tty: do not break long words
These "words" tend to be file paths which are best left unbroken.

Fixes #1057.
2016-06-15 12:22:35 -04:00
Denis Davydov
d0d83cfe1e slepc: build by default with Arpack 2016-06-15 18:21:13 +02:00
Denis Davydov
d04dc8440f dealii: specify petsc/slepc version dependencies 2016-06-15 18:21:13 +02:00
Denis Davydov
4d40f86bd3 trilinos: add 12.6.2 and 12.6.3 2016-06-15 18:21:13 +02:00
Denis Davydov
5358ffbe5a slepc: add 3.6.3 and 3.7.1; specify petsc version dependency 2016-06-15 18:21:13 +02:00
Denis Davydov
9ceb8fea78 petsc: add 3.6.4 and 3.7.2; specify superlu-dist version dependency 2016-06-15 18:21:13 +02:00
Denis Davydov
a860a3d614 superlu-dist: avoid harcoding blas/lapack/mpi; remove preferred version 2016-06-15 18:21:13 +02:00
Todd Gamblin
c803f7ae98 Merge pull request #1045 from eschnett/eschnett/openmpi-verbs-usr
Do not pass "/usr" or "/usr/local" as path to configure
2016-06-15 09:06:12 -07:00
Todd Gamblin
4ede87a8b0 Merge pull request #1058 from eschnett/eschnett/blosc
Add packages c-blosc and hdf5-blosc
2016-06-15 09:04:48 -07:00
Todd Gamblin
9dd1f2747a Merge pull request #1028 from JRWynneIII/boost-graph-parallel-fix
Add variant for boost graph and parallel graph
2016-06-15 09:03:01 -07:00
Todd Gamblin
08badb5a35 Merge pull request #1040 from KineticTheory/pkg-trilinos
Make Boost an optional feature of Trilinos.
2016-06-15 08:57:38 -07:00
Todd Gamblin
ff3469385b Merge pull request #1037 from KineticTheory/develop
Package serf also depends on zlib.
2016-06-15 08:57:14 -07:00
Todd Gamblin
bfedeadacb Merge pull request #1031 from opoplawski/pcre
Add patch to compile pcre with Intel 16.0.3 compiler
2016-06-15 08:56:53 -07:00
Todd Gamblin
a19c8b343e Merge pull request #1051 from daboehme/develop
Use https for github in Caliper package
2016-06-15 08:56:11 -07:00
alalazo
b09bee8158 qa : fixed flake8 issues 2016-06-15 13:29:30 +02:00
alalazo
b59d4f243b openmpi, mvapich2, mpich : filtered out "--Wl,--enable-new-dtag" in wrappers, as it turns RPATH into RUNPATH
Apart from that turned `os.path.join` into `join_path` and `os.environ` into `env` in the packages
2016-06-15 13:21:39 +02:00
Erik Schnetter
05d7378da5 Install shared libraries correctly on Linux 2016-06-14 17:13:20 -04:00
Erik Schnetter
ca5180f7a2 Correct Blosc install on Darwin 2016-06-14 17:03:00 -04:00
Erik Schnetter
e6ec372926 Add packages c-blosc and hdf5-blosc
c-blosc provides the Blosc compression filter, and hdf5-blosc provides a plugin for HDF5 to use that filter.
2016-06-14 09:59:48 -04:00
Glenn Johnson
e226837d33 Fix flake8 error. 2016-06-13 23:04:26 -05:00
Glenn Johnson
8861c99333 New package - r-foreign 2016-06-13 22:50:07 -05:00
Glenn Johnson
5ba5ef6c46 Add list_url for older versions. 2016-06-13 17:50:27 -05:00
Glenn Johnson
94d0f21823 New package - r-xlsxjars 2016-06-13 17:50:06 -05:00
Glenn Johnson
4767185082 New package - r-xlsx 2016-06-13 17:48:59 -05:00
Glenn Johnson
5cd09af066 New package - r-XLConnect 2016-06-13 17:48:44 -05:00
Glenn Johnson
3c234a7d3b New package - r-XLConnectJars 2016-06-13 17:36:50 -05:00
Glenn Johnson
450b082daf Do not need to depend on jdk here because R itself does. 2016-06-13 17:35:35 -05:00
Glenn Johnson
427fa7fd0a New package - rJava 2016-06-13 17:26:01 -05:00
David Boehme
52160bff18 Use https for github 2016-06-13 11:47:28 -07:00
Glenn Johnson
d398ebe21f New package - r-RSQLite 2016-06-12 22:06:06 -05:00
Glenn Johnson
b96b32e9ec New package - r-RPostgreSQL 2016-06-12 22:05:45 -05:00
Glenn Johnson
77e8096a6f New package - r-RODBC 2016-06-12 22:05:26 -05:00
Glenn Johnson
bfb0985c38 New package - r-RMySQL 2016-06-12 22:05:10 -05:00
Glenn Johnson
a7a640bfb8 New package - rDBI 2016-06-12 22:04:37 -05:00
Glenn Johnson
b05a565648 New package - mariadb 2016-06-12 22:04:09 -05:00
Glenn Johnson
5d3965c7a6 New package - unixODBC 2016-06-12 22:03:24 -05:00
Glenn Johnson
7727f6fc7e New package - libaio 2016-06-12 22:02:46 -05:00
Glenn Johnson
4dcb15cf6d Ran through autopep8 and cleaned up. 2016-06-12 22:00:49 -05:00
Glenn Johnson
bdb9af63ed Add version 9.5.3 and add readline as a dependency. 2016-06-12 21:58:41 -05:00
Glenn Johnson
8ff7cbb9ce Run binutils/package.py through autopep8. 2016-06-12 21:57:03 -05:00
Glenn Johnson
1601cf1b14 Patch binutils
This commit adds a patch to update symbol versions from linker scripts.
This is seen with libmysqlclient.so which has to maintain compatibility
across two versions. Only one can be the default.

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=544ddf9322b1b83982e5cb84a54d084ee7e718ea
2016-06-12 21:46:11 -05:00
Kelly (KT) Thompson
31d2c38687 Update formatting to meet code style requirements. 2016-06-12 19:56:29 -06:00
Kelly (KT) Thompson
b89bcdff62 Make Boost an optional feature of Trilinos.
I have been unable to build Boost with some toolset/platform combinations. The
users I support don't need the Boost features in Trilinos, so I have been
manually hacking trilinos/package.py to disable boost. I would like to propose
that these changes be added to the released version.

+ Add boost as a variant, default to true so there is no change to existing
  behavior.
+ Move the CMake configure options related to Boost into a conditional block
  that is triggered by "if '+boost' in spec".
2016-06-12 19:48:45 -06:00
Tom Scogland
1b28991e0a Merge pull request #1026 from epfl-scitas/packages/lmod
lmod : updated package and dependencies
2016-06-12 17:01:41 -07:00
Massimiliano Culpo
30c9d976f6 environment : added more logic to treat append and prepend path 2016-06-12 18:54:56 +02:00
alalazo
5300ffac7f qa : fixed flak8 checks 2016-06-12 15:11:26 +02:00
alalazo
a6681f2d7f environment modules : added function to construct them from source files 2016-06-12 15:06:17 +02:00
Glenn Johnson
59c9816dbf Make quotations in variables consistent. 2016-06-11 16:01:23 -05:00
Glenn Johnson
0e9f8bd38d Add list_url for old versions. 2016-06-11 15:53:28 -05:00
Erik Schnetter
953b65abcc Do not pass "/usr" or "/usr/local" as path to configure 2016-06-11 16:41:39 -04:00
Glenn Johnson
6c0ea77d1d Add list_url for older versions. 2016-06-11 15:36:43 -05:00
alalazo
3737169450 qa : fixed style and a bug reported by flake8
lib/spack/spack/test/versions.py:313: [F811] redefinition of unused 'test_union_with_containment' from line 306
Flake8 found errors.
2016-06-11 12:57:46 +02:00
alalazo
eb9b00b210 versions : added unit tests for the new properties 2016-06-11 12:44:21 +02:00
Gregory Becker
0fea167f97 I made a hash of that minor merge
Merge commit '4eeb' into features/newarch
2016-06-10 16:28:09 -07:00
Gregory Becker
992bcac794 changed compiler yaml format 2016-06-10 16:26:02 -07:00
Adam J. Stewart
85502e34f9 CMake knows how to create PIC 2016-06-10 14:35:19 -05:00
Todd Gamblin
bc038eb7c3 Merge pull request #1020 from LLNL/bugfix/libdwarf_versions
put older versions back + version-specific dwarfdump dir
2016-06-10 05:47:04 -07:00
Kelly (KT) Thompson
883f601bca Fix style issues. 2016-06-09 19:18:25 -06:00
Kelly (KT) Thompson
915115386a Package serf also depends on zlib.
+ Add zlib as a required dependency.
+ Point scons build system to the spack provided zlib installation.
2016-06-09 18:30:28 -06:00
Erik Schnetter
2a4d440003 Add quotes around file name
$input_log will expand to file names with special characters (e.g. "@"), thus bash requires quotes.
2016-06-08 19:14:01 -04:00
Orion Poplawski
454acf58af Add additional blank line for flake8 2016-06-08 16:49:42 -06:00
Orion Poplawski
e3ca5e6676 Add patch to compile pcre with Intel 16.0.3 compiler 2016-06-08 16:23:04 -06:00
Orion Poplawski
4952c4c7de Also remove from external from bin/spack 2016-06-08 14:22:26 -06:00
Orion Poplawski
7ce08c4216 Remove last two remaining from external imports 2016-06-08 13:51:31 -06:00
Adam J. Stewart
65896ff2ed Add Armadillo and SuperLU packages 2016-06-08 14:11:14 -05:00
James Riley Wynne III
4b9707f8ea Fixed flake8 formatting problems 2016-06-08 14:36:45 -04:00
Peter Scheibel
3b71d78f3c rename URLMirrorFetchStrategy to CacheURLFetchStrategy since it isnt used to manage all mirror URLs - just the cache (the specific behavior that a URL may refer to a stale resource doesn't necessarily apply to mirrors) 2016-06-08 09:57:56 -07:00
James Riley Wynne III
42a10d5690 Fixes issue #438 2016-06-08 12:43:05 -04:00
Nicolas Richart
2d21693b9d Missing file to patch mumps 2016-06-08 17:09:13 +02:00
alalazo
564483936f qa : fixed flake8 issues 2016-06-08 16:33:49 +02:00
alalazo
4a61efe641 lmod : fixed issues with LUA_PATH during installation 2016-06-08 16:21:09 +02:00
alalazo
f4a39457de lmod : updated package and dependencies 2016-06-08 15:35:15 +02:00
Nicolas Richart
165411f4a5 bug fix in the +mpi case 2016-06-08 15:17:12 +02:00
Nicolas Richart
498c098d11 Cleaning flake warnings in mumps package 2016-06-08 14:57:54 +02:00
Nicolas Richart
e124c86a4f Corrected the shared libraries and tests in mumps package 2016-06-08 14:17:46 +02:00
Glenn Johnson
bb19dffb26 Fix flake8 error. 2016-06-07 23:40:12 -05:00
Glenn Johnson
ad0cfa41aa Fix flake8 errors 2016-06-07 23:37:49 -05:00
Glenn Johnson
738720a000 new package: r-devtools
This PR brings in the R devtools package and it dependencies.
2016-06-07 23:20:46 -05:00
Greg Lee
bb57b82794 flake8 fixes 2016-06-07 20:15:02 -07:00
Glenn Johnson
2262bc95f1 new package: r-packrat
Manage the R packages your project depends on in an isolated, portable,
and reproducible way.
https://github.com/rstudio/packrat/
2016-06-07 22:04:11 -05:00
Greg Lee
25b2f7b1d7 put older versions back + version-specific dwarfdump dir 2016-06-07 20:02:38 -07:00
Peter Scheibel
a2754894ea (1) FsCache store now takes a fetcher vs. just a copy command (2) use [1] to conditionally cache resource: only save it if there is a feature which identifies it uniquely (for example do not cache a repository if it pulls the latest state vs. a particular tag/commit) 2016-06-07 16:26:54 -07:00
Mario Melara
5715799d4e Added to_dict back into operating system 2016-06-07 14:15:28 -07:00
Mario Melara
4925be0bc4 Load external modules 2016-06-07 13:22:47 -07:00
Peter Scheibel
de1ec4be8b change source archive caching to omit digest from name and instead calculate and compare the checksum. This achieves the original goal of discarding stale cache files without preserving multiple files for the same version. 2016-06-06 12:26:13 -07:00
Mario Melara
196737c217 Changed to passing full architecture spec to function rather than just platform_os so we can grab the operating system from the platform getters 2016-06-06 10:29:19 -07:00
Mario Melara
835982faed Changed OS name to CNL10 so that we properly find the compilers for the test platform 2016-06-06 09:08:59 -07:00
Mario Melara
864191b6ed Got rid of unnecessary global keyword 2016-06-06 09:06:58 -07:00
Mario Melara
5b023bb0a1 Passing through full arch instead of just operating sysystem so that we can use the platform to get the operating system 2016-06-06 09:05:14 -07:00
Mario Melara
c7b48f6fef Passing full arch for proper compiler spec so that we can use the platform to get the operating system 2016-06-06 09:04:24 -07:00
Mario Melara
f751d68177 Passing architecture to functions to find compiler. We can use the platform name if provided to find the operating system. Also changed error to operating system instead of target since operating system is now in charge of compiler finding. 2016-06-06 09:03:32 -07:00
Tom Scogland
30e8e77fb6 Merge pull request #869 from brettviren/feature/views
Feature/views
2016-06-05 11:31:48 -07:00
alalazo
bdd874eb7f autopep8 2016-06-04 18:09:28 +02:00
alalazo
02cadb882b unit test : suffixes 2016-06-04 18:09:06 +02:00
alalazo
669caefccb unit test : wrong naming scheme in conflict 2016-06-04 18:00:18 +02:00
alalazo
d43cfefa43 autopep8 2016-06-04 17:24:52 +02:00
alalazo
2d6db06fca unit test : prerequisites 2016-06-04 17:24:27 +02:00
alalazo
ffa6fed3a3 unit test : custom module file load 2016-06-04 17:20:06 +02:00
alalazo
422d3d4db6 unit test : write a whitelisted module 2016-06-04 16:46:15 +02:00
alalazo
09b1daa7b9 unit test : write a blacklisted module 2016-06-04 16:23:41 +02:00
alalazo
408aa10210 unit test : whitelist 2016-06-04 16:18:15 +02:00
alalazo
a3f39c2315 autopep8 : fixed style issues 2016-06-04 11:23:23 +02:00
alalazo
97e2834816 unit test : wrong tag for dependencies 2016-06-04 11:20:35 +02:00
alalazo
2207ab8f23 unit test : inspect_path 2016-06-04 10:44:37 +02:00
alalazo
0e71b5dde8 unit test : update dictionary extending lists 2016-06-04 10:07:13 +02:00
Mario Melara
30c204a0a5 Made a merge commit earlier with Todd fixing all_platforms, but changed how architecture looks in spec.yaml. Just three strings. Also made some flake8 formatting changes 2016-06-03 16:16:59 -07:00
Mario Melara
bc557cc765 Merge branch 'features/newarch' of https://github.com/NERSC/spack into features/newarch 2016-06-03 15:59:00 -07:00
Mario Melara
24d160e93e Changed how architecture looks like in spec.yaml. Now it's only three strings, platform, os, target in spec.yaml. Also did some flake8 formatting changes 2016-06-03 15:57:54 -07:00
Mayeul d'Avezac
0b5ce9e16a 💄 style points requested by flake8 2016-06-03 11:52:19 +01:00
Nicolas Richart
8b6035ab82 Making emacs dependent on internal packages 2016-06-03 00:24:00 +02:00
Todd Gamblin
9d04dccb79 Update version to correspond to master. 2016-06-02 01:20:40 -07:00
Todd Gamblin
3d2b25e45c Merge pull request #1014 from epfl-scitas/packages/mvapich2
Changes to take into account slurm in version @2.1: of mvapich2
2016-06-02 01:08:28 -07:00
Todd Gamblin
27bc49d8c8 Merge pull request #1001 from ashkan2200/develop
Dealii, fixed issue with tests
2016-06-02 01:01:29 -07:00
Todd Gamblin
b843b73bb5 Merge pull request #1005 from eschnett/eschnett/hdf5-update
Update HDF5 to version 1.10.0-patch1
2016-06-02 00:57:15 -07:00
Todd Gamblin
552cfac6ed Merge pull request #1008 from LLNL/features/cflags-fix
Fixed config format to allow default compiler flags
2016-06-02 00:56:44 -07:00
Todd Gamblin
1fb4fa02e3 Merge pull request #1010 from epfl-scitas/packages/tetgen
Adding a version to tetgen
2016-06-02 00:54:09 -07:00
Todd Gamblin
fca8034578 Merge pull request #1011 from epfl-scitas/packages/fenics
Adding package FEniCS
2016-06-02 00:53:47 -07:00
Nicolas Richart
53dcc39b72 removing useless selfs 2016-06-01 17:33:54 +02:00
Nicolas Richart
3ab8468e73 Correcting the flake8 warnings 2016-06-01 16:43:08 +02:00
Nicolas Richart
0451c8e55f Addapting the mvapich2@2.1: configure options for slurm 2016-06-01 15:58:00 +02:00
Nicolas Richart
d802144f39 Introduced a bug by correcting flake8 warnings 2016-06-01 03:31:29 +02:00
Nicolas Richart
5d4a0e4050 Corrections for flake8 2016-06-01 03:28:42 +02:00
Nicolas Richart
97bad2c1ac Corrections for flake8 2016-06-01 03:25:37 +02:00
Nicolas Richart
58052e6632 Adding package fenics 2016-06-01 03:20:56 +02:00
Nicolas Richart
cb673765c2 Adding a version to tetgen 2016-06-01 03:02:48 +02:00
Nicolas Richart
0df0677d5b Adding a variant to link against the spack libraries instead of the system ones 2016-06-01 03:00:03 +02:00
Nicolas Richart
9db8dc1895 Removing extra dependencies + minor fix according to remarks on #1002 2016-06-01 00:57:01 +02:00
Gregory Becker
817f43f927 Fixed config format to allow default compiler flags 2016-05-31 13:39:25 -07:00
Erik Schnetter
c03c689cb2 Update HDF5 to version 1.10.0-patch1 2016-05-31 12:18:17 -04:00
Adam J. Stewart
564e7f5e5b Don't build in parallel 2016-05-31 09:32:24 -05:00
Todd Gamblin
7bdf63a0fa Fix some bugs in architecture. 2016-05-31 03:01:05 -07:00
Mayeul d'Avezac
29b85fbce0 Eigen can be installed with dependencies 2016-05-31 10:10:12 +01:00
Ali Dorostkar
6f96484f83 Spacing correction
More spacing correction
2016-05-31 09:58:29 +02:00
Ali Dorostkar
e82fb5b58f Fixed spacing
Replaced tabs with spaces
2016-05-31 08:44:46 +02:00
Todd Gamblin
24ee32d7b0 More flexible reading of specs from DB, formatting. 2016-05-30 22:02:22 -07:00
Todd Gamblin
f3f0122f11 Merge branch 'develop' into features/newarch 2016-05-30 13:54:53 -07:00
Mario Melara
b14ba31250 Quick fix for mock compilers.yaml to work on linux machines. 2016-05-30 13:22:08 -07:00
Mario Melara
716991775d Added extra check on linux machines, since most linux machines don't have module system 2016-05-30 13:09:41 -07:00
Mario Melara
08a9d80ebc Changed platform to py_platform to avoid name collisions. The naming collisions resulted in an error on linux machines 2016-05-30 13:07:20 -07:00
Mario Melara
f96c979024 Added a conditional to check if package is external 2016-05-30 13:05:49 -07:00
Ali Dorostkar
c4d5bd13c7 dealii, Added comment
Added comment for why step-40 is done differently for dealii 8.4.0 and
later
2016-05-30 18:11:34 +02:00
Nicolas Richart
fd345c8ef0 Merge branch 'packages/foam-extend' of github.com:epfl-scitas/spack into packages/foam-extend 2016-05-30 17:04:21 +02:00
Nicolas Richart
9f4e599232 Ignoring the flake8 error for a line too long 2016-05-30 16:58:06 +02:00
Nicolas Richart
08c8d1d1f7 limiting package to foam-extend to start 2016-05-30 16:49:25 +02:00
Nicolas Richart
4122ecbc80 First try at OpenFOAM-extend 2016-05-30 16:49:25 +02:00
Ali Dorostkar
4f591a6fe3 Step-40 test for 8.3.0 and earlier
Integrated part of step-40 to be tested for earlier versions of dealii
2016-05-30 16:42:24 +02:00
Nicolas Richart
fe79e43459 limiting package to foam-extend to start 2016-05-30 15:46:39 +02:00
Ali Dorostkar
d7e84fe07c dealii, test for specific version
Specified that test case “step-40” is only to be run when using dealii
version 8.4.0 or later
2016-05-30 14:03:27 +02:00
Ali Dorostkar
04061ece4f Merge remote-tracking branch 'LLNL/develop' into develop 2016-05-30 14:03:02 +02:00
Glenn Johnson
66aaaa1751 Add a comment regarding the reason for the patch. 2016-05-29 15:30:09 -05:00
Todd Gamblin
1eed2ee985 Merge pull request #999 from ashkan2200/develop
Dealii, Versions added
2016-05-29 10:56:00 -05:00
Ali Dorostkar
c2ac47235f additional versions for Dealii
Included additional versions for Deal.II package.
2016-05-29 13:22:19 +02:00
Todd Gamblin
e8b4d5fb6f Performance boost: reduce instantiations of re.Scanner
- Lexer is the same for every Spec parser in spack, so don't build it
  every time.

- This improves time to import package.py files a lot, as a Lexer
  doesn't have to be constructed for every spc in the packages.

- To concretize dealii:
  - Before: ~20 sec
  - After:  ~6 sec
2016-05-28 23:05:23 -07:00
Glenn Johnson
c16d7c481c Get glib to compile with gcc-6.1
This commit adds a patch to fix the case where gcc-6.1 emits an error
for string format literal that was a warning in previous versions of
gcc. The patch reference is
https://bugzilla.gnome.org/show_bug.cgi?id=761550

Also ran the package file through autopep8.
2016-05-28 23:30:56 -05:00
Mario Melara
22ca72e7b9 Added conditional skipIf to test_external_modules, darwin machines don't have tcl modules so skip this test and let user know why 2016-05-28 12:40:29 -07:00
Mario Melara
69585cb6e3 Added elcap compilers 2016-05-28 12:39:43 -07:00
Mario Melara
33e1dcc476 Adding mock package file for external module 2016-05-28 10:14:40 -07:00
Mario Melara
f0a9c45207 Adding external to mock config 2016-05-28 10:13:57 -07:00
Mario Melara
98a4a9f2cc Adding test for external modules 2016-05-28 10:13:22 -07:00
Mario Melara
becec8ac7e Added external module check in normalize to avoid infinite loop 2016-05-28 10:12:53 -07:00
Gregory Becker
9dad7c2ace re-merged mainline develop 2016-05-27 13:13:19 -07:00
Greg Lee
6dcdb50a3e Merge branch 'develop' of https://github.com/llnl/spack into develop 2016-05-27 12:44:57 -07:00
Greg Lee
0ae1298d25 updated libdwarf version and dwarfdump build 2016-05-27 12:43:13 -07:00
Gregory Becker
f49644cdea Fixed typo in linux platform 2016-05-27 12:37:58 -07:00
Gregory Becker
023504ed64 Fixed the external modules bug 2016-05-27 12:26:59 -07:00
Adam J. Stewart
dd5a6914f1 Undo changes to flex 2016-05-27 12:56:43 -05:00
Todd Gamblin
f6a0cd1bf8 Merge pull request #973 from eschnett/eschnett/openmpi-verbs
Auto-detect verbs location
2016-05-27 11:01:44 -05:00
Todd Gamblin
285646bbfa Merge pull request #981 from epfl-scitas/tests/unit_test_for_968
find : add unit tests
2016-05-27 11:00:45 -05:00
Todd Gamblin
2f18a34458 Merge pull request #989 from LLNL/features/cflags-documentation
updated documentation for cflags PR
2016-05-27 10:59:40 -05:00
Todd Gamblin
7b063e3e6c Merge pull request #975 from adamjstewart/features/stream
Add STREAM benchmark package
2016-05-27 10:59:13 -05:00
Gregory Becker
a2f90453f4 Fixed backwards compatibility for compilers.yaml config file 2016-05-26 20:30:05 -07:00
Todd Gamblin
dc4ca26441 Merge pull request #992 from davydden/update/dealii
Update/dealii
2016-05-26 17:39:37 -05:00
Todd Gamblin
96f65479e7 Merge pull request #993 from xjrc/packages/metis
Update Package : METIS/ParMETIS
2016-05-26 17:37:33 -05:00
Joseph Ciurej
e95eedb165 Added a style checking exemption for lambda expressions. 2016-05-26 14:27:15 -07:00
Denis Davydov
040c122719 dealii: formatting 2016-05-26 23:00:22 +02:00
Mario Melara
9c1da4fa4c Corrected parantheses wrapping 2016-05-26 13:58:17 -07:00
Gregory Becker
189e8b3f34 fixed compiler config init logic 2016-05-26 13:17:01 -07:00
Gregory Becker
88bec814eb Allow 'arch=' syntax for specs to allow copying from output 2016-05-26 12:10:41 -07:00
Gregory Becker
c0661744cc fixed compatibility work 2016-05-26 11:38:40 -07:00
Gregory Becker
b968603a57 made yaml format backwards compatible 2016-05-26 11:14:05 -07:00
Mario Melara
3b675d8b70 Changed comparison operator so that we don't get caught in an infinite loop 2016-05-26 11:09:14 -07:00
Denis Davydov
0036483ded dealii: don't hardcode blas and mpi; minor fixes to dependencies 2016-05-26 18:07:27 +02:00
Gregory Becker
c30fe932d9 fixed mock config to use truncated versions of linux distro versions 2016-05-25 16:34:45 -07:00
Gregory Becker
8f99334f11 Fixed test config to work on yosemite 2016-05-25 16:06:14 -07:00
Todd Gamblin
76d42b5200 Merge pull request #982 from trws/rust
Rust
2016-05-25 15:15:51 -05:00
Gregory Becker
0f40174723 added test platform 2016-05-25 12:28:59 -07:00
Joseph Ciurej
734fb459a4 Fixing a small bug with metis@4+shared installs on the Mac platform. 2016-05-25 12:27:52 -07:00
Gregory Becker
3a68dd2011 (hopefully) final fixes of the merge 2016-05-25 12:22:16 -07:00
Gregory Becker
74dc7ffe4d updated documentation for cflags PR 2016-05-25 10:56:12 -07:00
Peter Scheibel
dd26c0bbcc merge from develop 2016-05-24 18:56:44 -07:00
Joseph Ciurej
483ec0d762 Added preliminary improved testing code for METIS@:4. 2016-05-24 16:13:52 -07:00
Joseph Ciurej
c9ba73d931 Added staging support and improved error handling for METIS@:4 installs. 2016-05-24 16:05:29 -07:00
Joseph Ciurej
b5d0a38860 Fixed a few linking/testing bugs in the METIS@:4 install method. 2016-05-24 15:03:21 -07:00
Greg Lee
1bca69f272 updated launchmon url and version 2016-05-24 14:54:09 -07:00
Joseph Ciurej
064d3584c0 Updating 'metis' and 'parmetis' to conform to PEP8 standards. 2016-05-24 12:28:05 -07:00
Joseph Ciurej
0ef6843d85 Improved MPI path specification for ParMETIS using PR #893 features. 2016-05-24 12:28:05 -07:00
Joseph Ciurej
9c95ec0b29 Updated and added new versions to the METIS/ParMETIS packages.
- Added a 'url_for_version' function to the METIS/ParMETIS packages.
- Added installation support for METIS@5.0.2 and ParMETIS@4.0.2.
- Changed the 'double' variant to 'real64' to make it more consistent
  with the 'idx64' variant naming.
- Removed an unnecessary dependency on gdb.
2016-05-24 12:28:05 -07:00
alalazo
561a4fbeea Merge branch 'develop' of https://github.com/LLNL/spack into features/module_file_explicit_load 2016-05-24 15:48:02 +02:00
alalazo
84707ed926 modules : it's possible to add suffixes to module files based on constraint 2016-05-24 15:23:52 +02:00
Todd Gamblin
6fba102d7d Merge pull request #985 from davydden/update/octave
octave: add missing dependencies and update to 4.0.2
2016-05-24 01:24:31 -05:00
Gregory Becker
513aae5ef8 fixed bug where earlier test was blowing away environment, causing an error on which('modulecmd') 2016-05-23 17:39:06 -07:00
Gregory Becker
1da6bbd146 Fixed a couple more bugs 2016-05-23 17:25:54 -07:00
Gregory Becker
d438ea0880 'Ugly merge because I mishandled git
Merge branch 'save' into features/newarch
2016-05-23 16:57:54 -07:00
Gregory Becker
d7612e7aaa Fixed errors caught by spec and concretize tests 2016-05-23 16:54:41 -07:00
Mario Melara
6c352132d0 Started writing documentation for architecture. Might need a couple more drafts 2016-05-23 14:28:00 -07:00
Denis Davydov
c78349a3a4 octave: fix formatting 2016-05-23 15:08:10 +02:00
Denis Davydov
ce3146e91a octave: add missing dependencies and update to 4.0.2 2016-05-23 14:50:06 +02:00
alalazo
0890ac4507 modules : explicit module file load from configuration files 2016-05-23 10:54:48 +02:00
Todd Gamblin
3ab56a188e Fixes #980: really slow spack spec performance
- `spack spec dealii` now takse seconds rather than 18 minutes.

- Slow hash (`dag_hash`) was accidentally inserted into the fast hash
  (`__hash__`).

- Do not put the slow hash in the fast hash.
2016-05-22 18:33:13 -07:00
Tom Scogland
00de72272d rust compiler/builder package, new llvm variants 2016-05-22 11:16:00 -07:00
Tom Scogland
9bd4bc02d6 fixing warning for package fetch 2016-05-22 11:16:00 -07:00
Tom Scogland
425beb4d97 updates for rust-bindgen 2016-05-22 11:16:00 -07:00
Tom Scogland
404b7c7c4f initial rust support 2016-05-22 11:16:00 -07:00
Nicolas Richart
4c87ef915f First try at OpenFOAM-extend 2016-05-22 18:55:29 +02:00
Todd Gamblin
d087086581 update documentation. 2016-05-21 14:33:05 -07:00
Mario Melara
c3767d593d compiler list is sorted in descending order, in order to get most up to date version we check from the beginning of the list 2016-05-20 15:48:13 -07:00
Erik Schnetter
09eed08b9c Auto-detect verbs location 2016-05-20 16:24:48 -04:00
alalazo
7303c387e8 autopep8 : fixed style 2016-05-20 10:34:11 +02:00
alalazo
b485ca8198 find : added unit tests, exits with 1 if -E and -e are given 2016-05-20 10:32:46 +02:00
Todd Gamblin
d94972503a Merge pull request #964 from davydden/update/tbb
tbb: add 4.4.4; raise InstallError when building 4.4.3 with GCC6.1
2016-05-19 22:44:03 -07:00
Todd Gamblin
0514dd5ebd Merge pull request #979 from epfl-scitas/packages/scotch+metis
Adding `+metis` variant to scotch + changes for esmumps
2016-05-19 20:06:47 -07:00
Mario Melara
175a042fd3 Changed rpaths method so that it only grabs rpaths using the compiler module name instead of PrgEnv-x module name 2016-05-19 16:42:13 -07:00
Nicolas Richart
2e77cc635e missing @ in version definition 2016-05-20 00:51:58 +02:00
Nicolas Richart
a233ed2de7 changes scotch package to make he coverage test pass 2016-05-20 00:42:34 +02:00
Nicolas Richart
a51566ec6e changes to simplify the esmumps variant for version < 6.0.0 + typos corrections, according to the remarks on PR #979 2016-05-20 00:31:12 +02:00
Mario Melara
36450b9bc9 Adding link_paths to craype compilers 2016-05-19 14:25:50 -07:00
Gregory Becker
19c8a52fe1 fixed spec syntax test 2016-05-19 09:53:49 -07:00
Nicolas Richart
1bf306bbbd Adding +metis variant to scotch + minor changes 2016-05-19 17:26:44 +02:00
Brett Viren
126fc10b9d Remove view print for now. 2016-05-19 08:36:18 -06:00
Gregory Becker
63459ab0c7 Fixed some of the bugs 2016-05-18 18:21:52 -07:00
Gregory Becker
01d5ffcd87 Fixed the first set of merge bugs 2016-05-18 17:42:11 -07:00
Mario Melara
16431f7a4c Merge branch 'features/newarch' of https://github.com/NERSC/spack into features/newarch 2016-05-18 17:26:30 -07:00
Mario Melara
b25da51638 Changed unsatisfiable architecture test 2016-05-18 17:26:06 -07:00
Mario Melara
6926f4d0da Changed arch tests to new spec target= os= 2016-05-18 17:23:10 -07:00
Gregory Becker
5417f1cdc6 more merge work 2016-05-18 17:21:03 -07:00
Gregory Becker
b1e5eafb80 more merge work 2016-05-18 17:18:26 -07:00
Gregory Becker
deb5011d08 more merge work 2016-05-18 17:14:16 -07:00
Mario Melara
b4b7942230 Moved searching of flags into get compilers in compilers_for_spec 2016-05-18 17:07:23 -07:00
Mario Melara
9f8ff32bcc Got rid of ifdefs, changed parameters for Compiler: added kwargs 2016-05-18 17:05:11 -07:00
Mario Melara
faa0f2a13c got rid of ifdef 2016-05-18 17:01:59 -07:00
Gregory Becker
80310a3b7c Finished merge on these files 2016-05-18 16:50:50 -07:00
Todd Gamblin
c53b1be8b4 Merge pull request #977 from trws/explicit-docs
initial docs for find and flake8 cleanup
2016-05-18 15:20:23 -07:00
Gregory Becker
9f59c128be Partial merge of mainline develop 2016-05-18 15:13:40 -07:00
Tom Scogland
a1f8cc2817 peren-nesting fix in spec 2016-05-18 14:24:16 -07:00
Tom Scogland
29635b7bbd initial docs for find and flake8 cleanup 2016-05-18 14:04:39 -07:00
Adam J. Stewart
434ff28af4 Add STREAM benchmark package 2016-05-18 15:14:21 -05:00
Todd Gamblin
d391670755 Merge pull request #966 from verolero86/develop
Add option to disable VT support in openmpi package
2016-05-18 08:36:23 -07:00
Todd Gamblin
78c46aab35 Merge pull request #969 from Rombur/boost
Add boost 1.61.0
2016-05-18 08:35:51 -07:00
Todd Gamblin
637da63506 Merge pull request #948 from davydden/bugfix/astyle
astyle: fix filter command which failed on OSX with python 2.7.10
2016-05-18 08:35:01 -07:00
Todd Gamblin
af7785727b Merge pull request #968 from epfl-scitas/find_always_zero_pkgs
Fix : spack find
2016-05-18 08:25:04 -07:00
Bruno Turcksin
bbbffe7423 Add boost 1.61.0 2016-05-18 08:51:22 -04:00
alalazo
23c7089789 fixes #967, flake8 approved 2016-05-18 11:52:27 +02:00
alalazo
fcc30cbf30 fixes #967 2016-05-18 11:48:03 +02:00
Denis Davydov
267666cd97 formatting 2016-05-18 08:35:47 +02:00
Greg Lee
582d01784a added newdtags variant, default to false (i.e., remove --enable-new-dtags) 2016-05-17 21:18:34 -07:00
Todd Gamblin
d592a1655f Merge pull request #961 from xjrc/features/flake8-improvements
Enhancement Proposal: Exempt '@when' Functions from Style Redefinition Errors
2016-05-17 17:00:49 -07:00
Todd Gamblin
502420ceff Merge branch 'features/cflags' into develop
Conflicts:
	lib/spack/spack/cmd/find.py
	var/spack/repos/builtin/packages/ghostscript/package.py
2016-05-17 16:44:54 -07:00
Denis Davydov
1a187e73ae tbb: add 4.4.4; raise InstallError when building 4.4.3 with GCC6.1 2016-05-17 22:57:32 +02:00
Veronica G. Vergara Larrea
6c95a5d496 the right flag here is +, the default behavior is controlled in the variant 2016-05-17 14:37:36 -04:00
Adam J. Stewart
f16228d811 Add more install directories 2016-05-17 13:36:38 -05:00
Adam J. Stewart
631cbdbda8 Flake8 2016-05-17 13:22:00 -05:00
Adam J. Stewart
7b9b18f03c Add HPL benchmark package 2016-05-17 13:14:59 -05:00
Veronica G. Vergara Larrea
471950434e add a flag to openmpi to allow users to disable vt support 2016-05-17 13:40:01 -04:00
Joseph Ciurej
761c5c8450 Added line limit exemptions for 'variant' and 'version' directives.
Updated the 'scotch' package to use oneline 'variant' directives.
2016-05-16 12:14:57 -07:00
Joseph Ciurej
52c8bedb9c Updated style checking to ignore refinition errors for '@when' fxns.
Updated the Scotch package to conform to PEP8 standards and to test style checking improvements.
2016-05-16 11:09:44 -07:00
Gregory Becker
0fd9cdb861 Fixed config tests for new compiler config format 2016-05-16 09:56:07 -07:00
Gregory Becker
7705603f73 Added more compilers to mock packages tests 2016-05-16 09:43:46 -07:00
Brett Viren
1bbe6409e1 Merge remote-tracking branch 'upstream/develop' into view-fix-merge 2016-05-16 10:09:31 -04:00
Brett Viren
77a34ebdf9 flake8-clean. 2016-05-16 10:08:59 -04:00
Greg Lee
c2ca5f44b4 flake8 fixes 2016-05-15 08:19:55 -07:00
Elizabeth Fischer
efa506b235 Preparing spack setup command for merge. Try this out for a while... 2016-05-14 17:09:11 -04:00
Brett Viren
b3ede099e2 Document command. 2016-05-14 13:15:25 -04:00
Brett Viren
c98afe2205 Pick a better name for the 'spec' parameters. 2016-05-14 13:14:51 -04:00
Brett Viren
8078845273 Remove problematic tests, deal with this issue outside of PR #869. 2016-05-14 09:11:41 -04:00
Brett Viren
8ddc1f8977 Move from str.format() to string.Template. 2016-05-14 09:11:04 -04:00
Gregory L. Lee
e3cd0a67d0 address flake8 issues 2016-05-13 16:12:48 -07:00
Gregory L. Lee
e9b71872a8 addressed PR#946 comments from @adamjstewart 2016-05-13 15:16:07 -07:00
Mario Melara
fce6ecb05c Changed _proper_compiler_spec to return filtered list. Apparently filter returns a list rather than filtering the original list. Lead to compiler finding problems if user specified frontend compilers 2016-05-13 15:04:06 -07:00
Gregory Becker
f43cab0951 fixed pkgconfig issue 2016-05-13 14:39:20 -07:00
Denis Davydov
67999d1b1c astyle: fix filter command which failed on OSX with python 2.7.10 2016-05-13 17:13:45 +02:00
Gregory L. Lee
b8a91db089 Intel software packages and license enhancements 2016-05-12 20:04:45 -07:00
Gregory Becker
4c9dd028d2 Fixed error causing hang in env/cc 2016-05-12 17:20:48 -07:00
Adam J. Stewart
088dce709e Make flake8 happy 2016-05-12 16:33:37 -05:00
Adam J. Stewart
ab41fd6692 Add bertini package
Also add missing dependency. Flex would not build for me without bison.
It complained about not being able to find `yacc`.
2016-05-12 16:21:06 -05:00
Denis Davydov
68c681bb78 document blas and lapack usage in packages 2016-05-12 08:59:17 +02:00
Gregory Becker
45bf93405a Changed spec syntax for new parts from modules feature 2016-05-11 16:23:13 -07:00
Gregory Becker
2e1810e3a7 re-merging develop 2016-05-11 15:26:09 -07:00
Gregory Becker
566fec4015 Fixed variants in new format and removed print statements from debugging 2016-05-11 14:56:41 -07:00
Gregory Becker
0b5836cfce Fixed flipped conditional in satisfies 2016-05-11 10:51:52 -07:00
Gregory Becker
c6ac709d70 WIP fixing all the things that broke when I changed the anonymous spec names 2016-05-09 17:06:21 -07:00
Gregory Becker
a7026da45c cleanup 2016-05-09 16:24:26 -07:00
Gregory Becker
222c84d9be Changed anonymous specs to have name=None instead of empty string 2016-05-09 16:22:17 -07:00
Todd Gamblin
73107d6b0f cleanup 2016-05-09 03:40:34 -07:00
Todd Gamblin
0c853ac3ea Make _hash private to discourage access; fix dag_hash length handling. 2016-05-09 03:39:08 -07:00
Todd Gamblin
7151fd8836 Restore cc from mainline; clean up some cflags stuff. 2016-05-09 03:37:27 -07:00
Brett Viren
f1900f6a7b Add a 'print' view allowing genreation of arbitrary strings based on format using package/spec parameters. 2016-05-08 10:25:21 -04:00
Brett Viren
2d1430da13 Address all coments in @trws's latest comment in PR #869.
I addressed them by factoring the code better to follow the visitor
pattern.  This will allow actions to be easily added in the future.
These may not even be file sytsem views.  One could add actions to
generate shell init scripts, JSON DAG-dumpers, GraphViz DOT file
generators, etc (yes, some of these are alread in there - just to give
the idea).

Also added is a top-level test

 $ source share/spack/setup-env.sh
 $ ./share/spack/examples/test_view.sh

Read the top of that script first.
2016-05-07 18:24:24 -04:00
Gregory Becker
d392056457 Cleaning up print statements for debugging 2016-05-06 18:05:30 -07:00
Gregory Becker
1523ebe9f7 Working properly to display but not reuse old specs from yaml 2016-05-06 18:03:43 -07:00
Gregory Becker
06b9433351 Fixed previous commit 2016-05-06 12:35:43 -07:00
Gregory Becker
bc087cfefb Fixed database to account for hashes when reading install records 2016-05-06 12:28:46 -07:00
Gregory Becker
9f37e4c907 Made spec hashes immutable once concrete -- improved 2016-05-06 12:05:51 -07:00
Gregory Becker
addcde4f35 Made spec hashes immutable once concrete 2016-05-06 12:05:27 -07:00
Gregory Becker
2f821b9e9b temp 2016-05-05 18:13:56 -07:00
Gregory Becker
9a39ccea8f Every old spec has empty compiler flags 2016-05-05 17:49:30 -07:00
Gregory Becker
1bb7bfaf7f Versioning the database -- automatic reindex 2016-05-05 17:38:51 -07:00
Gregory Becker
3fc1344865 temp 2016-05-05 17:11:09 -07:00
Gregory Becker
11b62114bb versioning the database 2016-05-05 16:58:00 -07:00
Gregory Becker
44f089508b Changed other packages to fit new syntax 2016-05-05 15:40:22 -07:00
Gregory Becker
d45b2c7947 Fixed openssl to work with new syntax 2016-05-05 15:36:48 -07:00
Elizabeth Fischer
6a48385111 Keep users environment in the spack setup script (spconfig.py). This is important to avoid breaking things that require module loads to work; for example, non-activate Python packages. 2016-05-05 17:48:24 -04:00
Todd Gamblin
9fb1a9537d Merge branch 'develop' into features/cflags 2016-05-05 10:49:15 -07:00
Gregory Becker
90b7b7ba5c Reworked compiler finding/storing/format to allow for multiple compilers with the same spec for different operating systems. TODO: fix config tests. All others up to date 2016-05-04 21:42:59 -07:00
Elizabeth F
2243de9e2f Make quiet mode default for spack spconfig 2016-05-04 23:39:27 -04:00
Brett Viren
26c5bc9d97 A few minimal test packages, fodder for testing 'spack view' command. 2016-05-01 17:13:44 -04:00
Brett Viren
346f102234 Bug fixes, tty tweaks. 2016-05-01 17:13:44 -04:00
Brett Viren
8c140f4725 Change the action from parameter to subcommand to fit Spack convention. 2016-05-01 17:13:43 -04:00
Brett Viren
a2b9a000dc Add add removal and status actions in addition to link and add various ways to filter what is done. 2016-04-29 15:12:09 -04:00
Gregory Becker
4ba73dac34 Unit tests for cflags PR 2016-04-28 14:01:38 -07:00
Todd Gamblin
8cd13d4b35 Make arch command print out the platform. 2016-04-28 12:49:21 -07:00
Brett Viren
49956faab9 First try to make file system views of specs. 2016-04-28 14:54:14 -04:00
Gregory Becker
3b84345b77 Changed yaml format for node_dicts to mitigate future incompatibilities 2016-04-28 11:05:59 -07:00
Gregory Becker
ae5198e5e7 Merged in current develop to cflags 042716 2016-04-27 19:38:51 -07:00
Elizabeth F
4d466fe879 spack setup: Fix broken module convenience settings. 2016-04-27 20:57:04 -04:00
Mario Melara
3a281b2399 Commented out the add_x_from_string methods since we don't need to worry about it. Also, changed the way architecture is set. Todd wanted to have users be able to input just frontend and/or backend in the architecture spec. This will be able to parse those inputs. 2016-04-08 12:46:44 -07:00
Mario Melara
01a36ab333 Changed the logic of concretize. We don't have to worry about whether the part of the spec is a string since any string parsed is made into an object via the Arch constructor. Any dependencies will take the root arch spec as well 2016-04-08 12:44:27 -07:00
Mario Melara
5bcd1e7ccd If we already have the name and the platform, then we should probably go ahead and concretize it in the constructor. Else leave it as None and concretize it later. 2016-04-08 12:43:08 -07:00
Mario Melara
618b3f5f2d Changed default to default_target so the tests can pass 2016-04-08 11:18:30 -07:00
Mario Melara
277efc1dfb Added test that works on every type of combination the user could possibly enter for arch spec 2016-04-08 11:17:56 -07:00
Mario Melara
0d1a1b7526 Changed _set_architecture so if user inputs only the target, then os is None. This prevents the os being referenced before assignment error 2016-04-08 10:29:37 -07:00
Mario Melara
6ff6c805af Assigned self.front_os, and back_os to self.default. Helps with testing. If we're on a darwin or linux machine, chances are there is no back end or front end operating system, but rather than have those as None, I just assign them the default which is detected via python platform. 2016-04-08 10:28:30 -07:00
Mario Melara
7b777568ed Added new concretization of architecture tests, test each combination of user input to make sure the correct os and target are chosen 2016-04-07 14:38:43 -07:00
Mario Melara
0ad317213c Changed architecture parser so that if user just enters in frontend or backend, then both the os and target will take those names. In the concretize method the frontend target/os and backend target/os will be picked to match each other 2016-04-07 14:38:04 -07:00
Mario Melara
07df403203 Cleaned up the concretize_architecture method by removing commented out code 2016-04-07 14:37:00 -07:00
Mario Melara
143a4d7f76 Changed default to default_target, also added frontend and backend to operating system 2016-04-07 14:36:26 -07:00
Mario Melara
99117cbc90 pulled from current repo the build_environment.py. Added module loading methods from our cray port 2016-04-06 14:07:22 -07:00
Mario Melara
918ad28a93 Changed all target values to architecture. Also added a sort_key method so that older architecture specs can be sorted with the newer ones 2016-04-06 13:58:29 -07:00
Mario Melara
749508af01 Found loops calling all_compilers that were always reading in the config file which lead to a slowdown, the fix is to cache the config file so we don't waste time re-reading the config file in again. 2016-04-06 12:05:29 -07:00
Mario Melara
3bf75fab3f Cleaned up architecture. Changed operating_system from dictionary method 2016-04-06 12:03:26 -07:00
Mario Melara
9bfc83ac5c Changed so that py_platform.dist() grabs the major version number. 2016-04-04 15:36:10 -07:00
Mario Melara
6d73c86209 Gives error on cori that [PrgEnv-xx, gcc/x.x.x] is not part of the schema. Changed it to oneOf : type : array to get rid of the error. 2016-04-04 13:45:15 -07:00
Mario Melara
9c071ea40d Changed modulecmd parameters. return_oe is not one of the parameters in the mainline spack repo. Changed the args to the appropriate ones in the new spack 2016-04-04 13:44:24 -07:00
citibeth
281835887a Added documentation for recursive modules 2016-04-01 22:54:49 -04:00
Elizabeth F
c6d8208150 Added recursive module loading 2016-04-01 22:54:42 -04:00
Peter Scheibel
9eb314fcaa merge from develop 2016-03-31 12:56:34 -07:00
Peter Scheibel
a0c42a3fd1 removed stale TODO 2016-03-29 18:58:18 -07:00
Peter Scheibel
c40559433b added docstring 2016-03-29 18:54:24 -07:00
Peter Scheibel
03d907e1e5 in the case of multiple digests, avoid creating different mirror filenames from run to run (as long as the available digests do not change) 2016-03-29 18:48:25 -07:00
Peter Scheibel
ce4de6227e (1) access package via spec property (2) use any digest to form archive filename 2016-03-29 18:45:58 -07:00
Peter Scheibel
bee224c567 mirror archive filename now includes the digest type as well as the digest 2016-03-29 18:25:22 -07:00
Gregory Becker
7e9baf9e25 Made architecture test robust for more architectures 2016-03-29 11:23:36 -07:00
citibeth
4a6b5d5247 Update to documentation formatting. 2016-03-27 00:14:10 -04:00
citibeth
a1c965d70d Fixed imports to make `git spconfig` work after recent merge from develop. 2016-03-26 20:40:22 -04:00
Peter Scheibel
06c98320a8 handle case where file contents change but resource name does not (e.g. if resource maintainer uses same name for each new version of a package) 2016-03-25 18:38:26 -07:00
Gregory Becker
57ced37229 Fixed a bug in the testing 2016-03-25 17:03:49 -07:00
Gregory Becker
618a9b2d7b Fixed bug in platform names that I introduced yesterday 2016-03-25 15:41:22 -07:00
Elizabeth F
9889b1a5fe Added documentation for StagedPackage, etc. 2016-03-25 17:15:15 -04:00
Elizabeth F
8f675b0ee8 Made StagedPackage user-visible. 2016-03-25 17:15:06 -04:00
citibeth
358b387283 Merge remote-tracking branch 'upstream/develop' into efischer/160311-StagedPackage 2016-03-25 17:14:35 -04:00
citibeth
8019748396 Merge remote-tracking branch 'upstream/develop' into efischer/160311-StagedPackage
# Conflicts:
#	lib/spack/spack/package.py
2016-03-25 15:36:54 -04:00
Peter Scheibel
bd5abb2922 spacing issue 2016-03-24 19:48:15 -07:00
Peter Scheibel
6423eab917 implemented cache_local method for DIY stage (as a noop) 2016-03-24 19:45:10 -07:00
Peter Scheibel
142d1f5cbc stage creates cache fetcher with cache object (so it can be mocked for tests) 2016-03-24 19:28:21 -07:00
Gregory Becker
315623d361 Fixed things from merge. 2016-03-24 16:55:46 -07:00
Peter Scheibel
fe71ba992d remove unused import 2016-03-24 12:16:50 -07:00
Peter Scheibel
13bf7d4ff1 (1) move definition of MockCache to test command (no definitions or extra work is required in MockPackagesTest) (2) removing outdated logic (which originated in this branch) and minor cleanup 2016-03-24 12:02:39 -07:00
Peter Scheibel
dbfa6c925e replace references to cache directory with references to new cache object. tests may assign a mock cache but by default it is None (this will avoid any implicit caching behavior confusing unit tests) 2016-03-23 20:18:58 -07:00
Peter Scheibel
ed0f6f75a7 clear test cache before and after each MockPackagesTest (I think Ive got a better way to avoid test fragility but Ill add this for now) 2016-03-23 19:49:28 -07:00
Gregory Becker
688eca23ff cleanup 2016-03-23 09:54:57 -07:00
Peter Scheibel
cb9fba98d8 (1) relocate cache for tests (2) initial approach for restoring unit tests (just for git tests although the same concept applies to the other unit tests which are failing - namely those for svn and hg) 2016-03-22 19:37:47 -07:00
Gregory Becker
7c729d4c3c Merged newarch into merge 2016-03-22 15:22:51 -07:00
Peter Scheibel
75460d8586 URLFetchStrategy.archive does a copy vs. a move now 2016-03-22 10:43:43 -07:00
Peter Scheibel
41a97c8f80 temporarily wrap archiving with conditional to avoid moving (this still causes a failure on the initial download) 2016-03-21 20:55:23 -07:00
Peter Scheibel
b255f02762 undoing whitespace-only diff 2016-03-21 20:50:26 -07:00
Peter Scheibel
ee5e507ff6 pursuing a strategy using fetch.archive and treating var/spack/cache as a mirror. this should support both URLFetchStrategy as well as VCSFetchStrategy (the previous strategy supported only the former). this won't work until URLFetchStrategy.archive is updated 2016-03-21 20:48:12 -07:00
Peter Scheibel
d632266a40 move cache to var/spack/cache 2016-03-18 17:15:45 -07:00
Peter Scheibel
fd067dd8b8 since only archives with checksums can be retrieved from the cache, make sure that an archive without a checksum isnt placed there (this wouldn't cause an error but does waste space and might be confusing) 2016-03-18 17:00:13 -07:00
Peter Scheibel
ac7323118e rename for clarity 2016-03-18 16:34:45 -07:00
Peter Scheibel
16fa40b893 (1) add a var/cache directory under spack. (2) downloads from URLFetchStrategy check the cache and skip the download if the source is available there. 2016-03-18 15:50:24 -07:00
Elizabeth F
6f26c45143 Fixed typo bug. Made error comment more explicit 2016-03-13 19:41:09 -04:00
Elizabeth F
0426796d9f Fixed typo 2016-03-13 18:14:38 -04:00
Elizabeth F
030e8dd1ac Removed Python 2.7-style string formatting 2016-03-13 18:04:23 -04:00
Elizabeth F
4c9a52044a Fixed CMakePackage import 2016-03-13 15:18:24 -04:00
citibeth
857f791286 Add missing import. 2016-03-13 00:40:50 -05:00
citibeth
9885f1a19e Fix for Python 2.6 2016-03-13 00:34:46 -05:00
citibeth
003957a689 Reverted bad change 2016-03-13 00:33:13 -05:00
Elizabeth F
c1a8574d8f Fixed for Python 2.6 2016-03-13 00:29:40 -05:00
citibeth
4236157823 (1) Added "spack spconfig" command.
(2) Neatened up the spconfig.py auto-generated file.
2016-03-13 00:13:00 -05:00
Elizabeth F
90bb855ffa A new subclass StagedPackage(Package) is introduced. This PR should
not change the behavior for existing packages that subclass from
spack.Package.

If a package subclasses spack.StagedPackage instead of spack.Package,
the install() phase (run inside a forked process) is now separated
into sub-stages:

    a) spconfig: Generate a script spconfig.py that will configure the
       package (eg by running CMake or ./configure) This is for use if
       the user wishes to build externally from Spack.  Therefore, the
       Spack compiler wrappers are NOT used here.  Currently, that
       means that RPATH support is up to the user.

    b) configure: Configure the project (eg: runs configure, CMake,
       etc).  This will configure it for use within Spack, using the
       Spack wrapper.

    c) build: eg: "make"

    d) install: eg: "install"

If one chooses to use StagedPackage instead of Package, then one must
implement each of the install sub-stages as a separate method.
StagedPackage.install() then calls each of the sub-stages as
appropriate.

StagedPackage can be configured to only run certain sub-stages.  This
is done by setting the optional kwarg install_phases when calling
do_install().  Setting install_phases() ONLY has an effect on
StagedPackage, not on any existing packages.  By default,
install_phases is set to make StagedPackage run the same stages that
are normally run for any package: configure, build, install (and NOT
spconfig).

The ability for Spack to run stages selectively for StagedPackage
instances will enable new functionality.  For example, explicit
CMake/Autotools helpers that allow Spack to help configure a user's
project without fetching, building or installing it.

-------------

One implementation of StagedPackage is provided, CMakePackage.  This
has the following advantage for CMake-based projects over using the
standard Package class:

  a) By separating out the phases, it enables future new functionality
     for packages that use it.

  b) It provides an implementation of intall_spconfig(), which will
     help users configure their CMake-based projects.

CMakePackage expects users to implement configure_args() and
configure_env().  These methods provide the package-specific arguments
and environment needed to properly configure the package.  They are
placed in separated functions because they are used in both the
spconfig and configure stages.

TODO:

1. Generate spconfig.py scripts that are more readable.  This allows
   the users to understand how their project is configured.

2. Provide a practical way for the user to ACCESS the spconfig stage
   without building the project through Spack.

3. The CMAKE_TRANSITIVE_INCLUDE_PATH stuff needs to be reworked; it
   should be considered provisional for now.

4. User of Autotools might wish to make a similar ConfigurePackage
   subclass of StagedPackage.

---------------

One package using CMakePackage is introduced.  See ibmisc/package.py.
2016-03-11 23:30:38 -05:00
Gregory Becker
4f9a309de8 made spack more conservative in compiler strategies attempted 2016-03-02 16:35:02 -08:00
Gregory Becker
487b2495a1 made spack more conservative in compiler strategies attempted 2016-03-02 16:33:10 -08:00
Mario Melara
2b48728741 Changed os subclasses CNL to change attribute to MODULES 2016-03-02 16:15:34 -08:00
Mario Melara
58efe1550d Default PATH arg 2016-03-02 16:14:42 -08:00
Gregory Becker
16d8c25b23 fixed floating 'target' 2016-03-02 16:12:32 -08:00
Gregory Becker
65d4169f00 fixed type/bug 2016-03-02 16:03:11 -08:00
Gregory Becker
ffb9574312 fixed type/bug 2016-03-02 15:59:23 -08:00
Gregory Becker
6e7b00a0f6 Made module handling much saner and safer 2016-03-02 15:54:23 -08:00
Mario Melara
b4298979fe Merge branch 'features/newarch' of https://github.com/NERSC/spack into features/newarch 2016-03-02 14:18:19 -08:00
Gregory Becker
676591ffc0 fixed a bug and a test bug 2016-03-02 14:17:46 -08:00
Mario Melara
975cba295b Added 'better' tests 2016-03-02 14:16:57 -08:00
Mario Melara
e46bac19fa Changed architecture to dict 2016-03-02 12:09:02 -08:00
Mario Melara
90e90f61c1 Got rid of the compiler strategy from target 2016-03-02 12:08:43 -08:00
Mario Melara
47c8e1366f Changed to_dictionary and from_dictionary methods 2016-03-02 12:08:17 -08:00
Gregory Becker
25f20b1967 bug hunting 2016-03-02 11:40:21 -08:00
Mario Melara
340ecf6e9a Merge branch 'features/newarch' of https://github.com/NERSC/spack into features/newarch 2016-03-02 11:07:52 -08:00
Gregory Becker
86e90bba87 another partial, narrowing in on proper arch 2016-03-02 11:05:05 -08:00
Mario Melara
81e236b2de Changed Arch to class instead of namedtuple. Now platform is automatically set upon creation of class 2016-03-02 11:04:55 -08:00
Gregory Becker
45887dec8e partial work on bug hunting 2016-03-02 10:56:46 -08:00
Mario Melara
f27f2f8e49 Fixed some indentation errors 2016-03-02 10:27:12 -08:00
Mario Melara
4d74784209 Changed add_architecture_from_string and split the work done into two methods add_target_from_string and add_operating_system_from_string 2016-03-02 10:27:00 -08:00
Mario Melara
527bb7abfe Changed _cmp_key 2016-03-02 10:26:09 -08:00
Gregory Becker
615ea969f8 made arch instantiate as a tuple 2016-03-02 10:14:50 -08:00
Gregory Becker
4601c36f57 cleaned up concretize architecture 2016-03-02 09:55:44 -08:00
Mario Melara
b591d2b501 Changed operating_system path 2016-02-25 18:49:52 -08:00
Mario Melara
ccd4a79b39 changed architecture.target to architecture.platform_os, so that compiler_for_spec uses operating system strategy 2016-02-25 18:49:27 -08:00
Mario Melara
eb96f38298 Got rid of debug comment 2016-02-25 18:48:25 -08:00
Mario Melara
f0149faf88 Added doc strings to functions in architecture.py 2016-02-25 18:48:00 -08:00
Mario Melara
ac55ce989d Changed compiler finding strategy to come from operating system instead of target 2016-02-25 18:47:41 -08:00
Mario Melara
5989e3f65d Changed from_dict to arch_from_dict method 2016-02-25 11:53:02 -08:00
Mario Melara
5e4d3e7b82 Changed naming convention of operating_system, makes it easier to create instance from dictionary just using name without the version attached. Object will stil display as name+version 2016-02-25 11:48:43 -08:00
Mario Melara
550df4cdd6 Some cleaning up. Finally got arch_from_dict working successfully. 2016-02-25 11:47:27 -08:00
Mario Melara
9ac2556285 Deleted old operating_system (without the s) file 2016-02-25 10:41:28 -08:00
Mario Melara
b43a5498a1 Changed import path to operating_systems 2016-02-25 10:36:47 -08:00
Mario Melara
f161609929 Renamed operating_system to operating_systems 2016-02-25 10:36:12 -08:00
Mario Melara
34be473b7c Deleted files 2016-02-25 10:35:58 -08:00
Mario Melara
863a5bc4fa Fix for 'Parent module spack.operating_systems not found while handling absolute import' 2016-02-25 10:34:55 -08:00
Mario Melara
8d1c06d141 Changed to dict method. Didn't realize this was being assigned to a dictionary already so got rid of d['architecture'] 2016-02-24 15:38:33 -08:00
Mario Melara
bd7c189c12 Added more comments 2016-02-24 15:37:50 -08:00
Mario Melara
5c3c6e7f06 Got rid of print statements 2016-02-24 15:34:32 -08:00
Mario Melara
234681306c Changed to appropriate class names for operating system 2016-02-24 15:32:23 -08:00
Mario Melara
2de81cfc62 Changed name to appropriate camelcase 2016-02-24 15:31:21 -08:00
Mario Melara
9e844d974c Added comments. Need to figure out how to make arch_tuple from_dict 2016-02-24 15:30:20 -08:00
Mario Melara
7779974143 arch_from_dict worked on 2016-02-24 15:02:40 -08:00
Mario Melara
339f4bfd23 Added unit testing for to_dict method 2016-02-24 12:16:09 -08:00
Mario Melara
5d5d3c5858 Added to dictionary method 2016-02-24 12:15:52 -08:00
Mario Melara
cfa7c4feb8 Added CNL10 as back_os and default_os 2016-02-22 16:18:25 -08:00
Mario Melara
083b7b46d9 Added more tests 2016-02-22 16:17:54 -08:00
Mario Melara
3c87d137a3 Added compiler strategy entry and also added new operating system subclass called CNL for compute node linux (name will probably change because I can't find docs on the EXACT name) 2016-02-22 16:17:33 -08:00
Mario Melara
ebc5e26c2d Added compiler strategy field to Operating System class 2016-02-22 16:16:20 -08:00
Mario Melara
a385dae1ae Unit tests to test operating system subclass creation and whether compiler strategy is set correctly 2016-02-22 14:54:30 -08:00
Mario Melara
1367ccab93 New folder that will hold operating system subclasses 2016-02-22 14:53:55 -08:00
Mario Melara
22bf4bc080 import linux distro subclass. Added method to add operating system to platform dictionary 2016-02-22 14:53:16 -08:00
Mario Melara
1a7d6ed49a import MacOSX subclass and added add_operating_system method to use subclass 2016-02-22 14:52:52 -08:00
Mario Melara
725d6d5fce import linux distro operating system subclass, set front-end os to LinuxDistro() 2016-02-22 14:52:09 -08:00
Mario Melara
a8de45ce28 Got rid of methods used to detect mac osx and linux osx. Now those methods are used my operating system subclasses 2016-02-22 14:50:51 -08:00
Mario Melara
18ddbae60e Added new module path to operating system file 2016-02-22 14:49:53 -08:00
Mario Melara
28218755a5 Changed spec.target to spec.architecture 2016-02-18 13:06:55 -08:00
Mario Melara
3558404c03 Check difference by using arch tuple rather than .target 2016-02-17 14:54:39 -08:00
Mario Melara
0a6b54a8c4 Added module compilers so that no CompilerSpecError is thrown 2016-02-17 14:53:56 -08:00
Mario Melara
93a92a00ee Changed abstract.target to abstract.architecture.target and abstract.architecture.target.concrete 2016-02-17 14:53:09 -08:00
Mario Melara
d9e8bf1807 Added ARCHITECTURE field when showing specs 2016-02-17 14:51:14 -08:00
Mario Melara
54042e399b Changed target to architecture.target 2016-02-17 14:50:10 -08:00
Mario Melara
1d484dbe5f Changed so that modules use correct file path with spec.architecture instead of spec.target 2016-02-17 14:49:36 -08:00
Mario Melara
ab4006ee2c Changed so that directory layout uses the platform-os-target string version of the arch tuple 2016-02-17 14:48:53 -08:00
Mario Melara
524e9b372e From now on all targets are now architecture. Architecture is a named tuple so any time we need access to target we do architecture.target. 2016-02-17 14:47:29 -08:00
Mario Melara
2c20fc2ebf Changed module loading to use arch tuple instead of regular target.module 2016-02-17 14:45:53 -08:00
Mario Melara
2a79537ba1 Fixed silly typo that gave errors in tests 2016-02-17 14:44:38 -08:00
Mario Melara
a3039c4c67 Changed add_architecture_from_string, it now loops through the string and checks whether each piece of string is a valid platform, operating system and target. If the operating system or target are none it will use the defaults. Updated the documentation for that method. One thing that bothers me is how to account for the multitude of operating systems when cross compiling. If someone wants to compile with another operating system not found on current platform. How can spack check to see if it is valid? 2016-02-16 15:26:07 -08:00
Mario Melara
62b0293963 Cleaned up the file. Got rid of commented out sections of code since they weren't going to be used anyway 2016-02-16 15:23:38 -08:00
Mario Melara
31ab238306 Beginning attemps to fix concretization method to account for the new tuple architecture 2016-02-16 15:22:23 -08:00
Mario Melara
19dca4bcc9 Added some _cmp_key methods to OperatingSystem class, and also changed the way Platforms are compared. Created a mini inherited class named Arch that inherits from namedtuple. The reason for this is to override the namedtuple __str__ method to make arch tuples look prettier when printed out. Rather than Arch(platform= ... ) it prints to platform-os-target which makes directory paths to packages look cleaner. 2016-02-16 15:21:36 -08:00
Mario Melara
35a602baaf Changed target checking to architecture checking for abi compatible 2016-02-16 15:17:57 -08:00
Mario Melara
c799301011 Changed the method in which architecture is converted from string to namedtuple. Also added some TODO comments to later consider changing how architecture is handled 2016-02-13 14:37:07 -08:00
Mario Melara
7732f375d2 Changed operating system getter so that linux and darwin autodetected operating systems are set as class default_os 2016-02-13 14:36:01 -08:00
Mario Melara
8e8c63bd67 Using pylint, fixed some of the indentation and spacing errors 2016-02-11 11:47:39 -08:00
Mario Melara
3e1be63b0f Changed some variables to account for the fact that target is now a tuple 2016-02-11 11:15:50 -08:00
Mario Melara
b9d09202c9 changed some variables to account for the fact that target is now a tuple 2016-02-11 11:15:19 -08:00
Mario Melara
77e93e1b79 Added add_os method to platform subclasses 2016-02-10 16:16:58 -08:00
Mario Melara
cb8d5ab183 Added new add_os method 2016-02-10 16:16:35 -08:00
Mario Melara
fb234205c2 Added method to concretize target and os pair 2016-02-10 16:16:11 -08:00
Mario Melara
d0ae6dd401 Changed add_target_from_string to include methods to concretize operating_system 2016-02-10 16:15:25 -08:00
Mario Melara
2650c60374 Added operating system class prototype and some autodetect features for operating system 2016-02-10 16:14:50 -08:00
Mario Melara
21a5a34041 Revert "new branch and also pushing some architecture changes where os is detected by linux and darwin and manually set by cray and bgq"
This reverts commit 70088be24b.
2016-02-10 10:59:16 -08:00
Mario Melara
0358522533 new branch and also pushing some architecture changes where os is detected by linux and darwin and manually set by cray and bgq 2016-02-06 15:41:22 -08:00
Mario Melara
840b41c450 Removed unneccessary $. Still learning regexp 2016-01-20 10:36:15 -08:00
Mario Melara
15713219e5 Better regular expression searching. Tested on edison was finding test compilers and then spack was giving multiple compiler match errors 2016-01-20 10:32:56 -08:00
Gregory Becker
8e54babf10 minor parsing bug fix 2016-01-15 17:21:32 -08:00
Gregory Becker
e1a0af8745 cleanup 2016-01-15 16:51:41 -08:00
Gregory Becker
16e9d658d5 Fixed the way flags on deps are attached so that they aren't moved onto the root before normalize/concretize 2016-01-15 16:18:40 -08:00
Gregory Becker
342f4bc2e0 Fixed virtual/cflag combination bug 2016-01-15 14:27:50 -08:00
Gregory Becker
848728858c Removed extra plus signs from command line syntax. Did not yet remove them from printed format 2016-01-12 18:34:26 -08:00
Gregory Becker
5e3c883f2c Cleanup and proper flag satisfaction for partial specs 2016-01-12 16:25:54 -08:00
Gregory Becker
528f9cd583 Implemented flags as lists for subsetting 2016-01-12 15:22:15 -08:00
Gregory Becker
2ac5ea42af Fixed concretization 2016-01-11 13:55:11 -08:00
Mario Melara
aab1a67d05 Adding needed import modules. Changed platform_name to platform to prevent syntax errors 2016-01-09 09:42:36 -08:00
Gregory Becker
9615efd940 cleanup: Removing an unnecessary line in an otherwise unchanged file 2016-01-08 18:53:19 -08:00
Gregory Becker
41046499c6 minor bug chasing 2016-01-08 18:51:38 -08:00
Gregory Becker
6e5238d037 Fixing the fix and removing debug printing 2016-01-08 17:44:16 -08:00
Gregory Becker
2b2d4bae4e Fixing multimethod test for new platforms 2016-01-08 17:38:37 -08:00
Gregory Becker
2b4dd8b9af Fixed target satisfaction and updated tests accordingly 2016-01-08 16:30:27 -08:00
Gregory Becker
aa28e4e81f Improved error messages for compiler_for_spec when either zero or multiple compilers returned. 2016-01-08 15:13:48 -08:00
Gregory Becker
6da1a105cb Revert "adding python_recipe_parser as a submodule under the folder utils"
This reverts commit 1501786fd9.
2016-01-08 15:03:34 -08:00
Gregory Becker
6ca1e5c4b0 Revert "added a bunch of packages and added submodule"
This reverts commit 79808da760.
2016-01-08 15:02:29 -08:00
Gregory Becker
86230b9ac8 Revert "make sure submodule is added in the correct location"
This reverts commit e9f7d033ff.
2016-01-08 15:01:46 -08:00
Gregory Becker
d3d37ad0ce removed the submodule as part of reversion of extraneous commits 2016-01-08 14:29:42 -08:00
Gregory Becker
a9e9f9afb0 Revert "removed package for python packages with problematic / duplicate names"
This reverts commit f3254ff02d.
2016-01-08 14:14:26 -08:00
Gregory Becker
1b0d064743 Revert "clean up package.py file and remove duplicate file"
This reverts commit c809cc9273.
2016-01-08 14:13:33 -08:00
Gregory Becker
d2da41b0bd More file permissions chasing 2016-01-08 12:12:03 -08:00
Gregory Becker
49908386ef changing problematic package.py file permissions back to 0644 2016-01-08 11:48:59 -08:00
Gregory Becker
ba63111f45 brought the architecture test up to date with new changes 2016-01-07 13:05:58 -08:00
Gregory Becker
53d4f82ce1 Improved cray architecture class 2016-01-07 13:01:05 -08:00
Gregory Becker
83917c4c30 Improved target specification 2016-01-07 12:43:39 -08:00
Gregory Becker
6ccd9d6fa4 Cleaned up naming conventions for architecture, split into platform and target 2016-01-07 11:49:01 -08:00
Gregory Becker
b4a0004f44 Improved target cmp_key and to/from yaml functions 2016-01-06 14:50:31 -08:00
Gregory Becker
51bd91edc0 made the compiler strategy more easily controllable 2016-01-06 13:00:22 -08:00
Gregory Becker
61b03b72b0 improved concretize efficiency for determining whether compilers come from the proper strategy 2016-01-05 19:03:25 -08:00
Gregory Becker
93c9c45580 minor tweak of compiler priority while waiting for customizable compiler priorities 2016-01-05 17:19:04 -08:00
Gregory Becker
29e0ff61d7 fixed compiler finding so as not to identify non-existent versions of the intel compiler based on the version numbers of the PrgEnv-intel module 2016-01-05 17:14:35 -08:00
Gregory Becker
c649610473 fixed concretization to only consider compilers found by the proper strategy 2016-01-05 17:00:28 -08:00
Gregory Becker
d6768cf921 minor bug fix 2016-01-05 16:23:32 -08:00
Gregory Becker
48b9023de4 removed debug printing 2016-01-05 14:51:18 -08:00
Gregory Becker
751503c434 fixed haswell targeting bug 2016-01-05 14:47:14 -08:00
Gregory Becker
1edbaa4e62 removed debug printing 2016-01-05 14:13:09 -08:00
Gregory Becker
9848ad32fd fixed errors caused by crayport on linux and added a darwin architecture 2016-01-05 13:39:53 -08:00
Gregory Becker
d2c2c46541 bug hunting 2016-01-05 11:12:14 -08:00
Gregory Becker
751208cedf pick last compiler instead of first, will be overwritten by more advanced preferences as mentioned in the email group 2016-01-04 16:35:06 -08:00
Gregory Becker
53808f254e Support for cray external dependencies implemented in modules 2016-01-04 12:36:48 -08:00
Gregory Becker
ff82e41404 Merge branch 'externals' into crayport 2016-01-04 10:46:25 -08:00
Gregory Becker
217a2d9ea5 fixed yaml error 2015-12-17 15:26:27 -08:00
Mario Melara
b5216f6ec8 Commented out cxxflag. Not 100% sure it's needed 2015-12-11 12:07:32 -08:00
Mario Melara
31df2dd9dd Fixed targets ti be x86_64, important note: have not tested this on linux machine 2015-12-11 12:04:47 -08:00
Mario Melara
fee88d289d Rewrote docstrings for sys_type() and got rid of unused functions 2015-12-11 12:03:13 -08:00
Mario Melara
028cca16e6 Got rid of the unusued default strategy=None 2015-12-02 10:15:33 -08:00
Mario Melara
0544b164fc Updated script of mini-xml for adios package 2015-12-01 11:59:49 -08:00
Mario Melara
4e0d47f1dd building with GCC needs special variables added. Intel compilers build just fine 2015-12-01 11:59:19 -08:00
Mario Melara
d7fdb8e015 Got rid of hard coded strings for adding default 2015-12-01 11:57:54 -08:00
Mario Melara
58f2b39bc8 Changed default to CPU_TARGET env var. Helps deal with target differences between cori and edison 2015-12-01 11:57:17 -08:00
Mario Melara
89fbe4fdfa Changed add_target to include variables rather than hard-coded strings 2015-12-01 11:55:38 -08:00
Mario Melara
8f56f5cfcc Added path to netcdf and hdf5 using the env vars NETCDF_DIR and HDF5_DIR. 2015-11-23 14:02:59 -08:00
Mario Melara
fceb5a75b0 Adding new files to compilers 2015-11-13 11:53:38 -08:00
Mario Melara
bfd05d3d27 Changed name of file and class to craype to avoid spack freaking out about versions 2015-11-13 11:48:49 -08:00
Mario Melara
72fa3c0492 Added craype support 2015-11-13 11:48:15 -08:00
Mario Melara
9458f7c7d0 Got rid of my old method of finding in LOADEDMODULES 2015-11-13 11:47:36 -08:00
Mario Melara
a5ba69d68d Added a _cmp_key for the architecture class 2015-11-13 11:46:13 -08:00
Mario Melara
9dc05a57ec Merge branch 'features/spackathon' of https://github.com/NERSC/spack into features/spackathon 2015-11-12 15:15:07 -08:00
Gregory Becker
7c89f9d18c Added the basic ouline of a cray compiler class in lib/spack/spack/compilers/cray.py 2015-11-12 14:31:41 -08:00
Mario Melara
8c259859ab Merge branch 'features/spackathon' of https://github.com/NERSC/spack into features/spackathon 2015-11-12 13:34:56 -08:00
Mario Melara
297cebd833 Got rid of print statement 2015-11-12 13:34:40 -08:00
Gregory Becker
e78b8c16be used key_comparator decorator from util.lang to compare targets. Fixes find bug 2015-11-12 13:27:10 -08:00
Gregory Becker
eb2c083159 Fixed the to_dict from_dict for targets on cray. First version to build/find properly on Cray 2015-11-11 17:29:47 -08:00
Gregory Becker
185f40eb8b fixed my git problems 2015-11-11 16:33:22 -08:00
Gregory Becker
3067705c10 made a to_dict for targets. Also a from_dict for sanity 2015-11-11 16:16:47 -08:00
Gregory Becker
8a13d344a8 bug fix in spec.py 2015-11-11 15:07:57 -08:00
Gregory Becker
271a839957 First possibly working version of the crayport. Not sufficiently tested at all. 2015-11-11 14:22:07 -08:00
Gregory Becker
95a34628a3 Add modules to compilers. Changed compiler to take paths as a list. Changed compiler_for_spec to be aware of different compiler stratigies 2015-11-11 11:32:18 -08:00
Gregory Becker
7e6fc79eb2 Merge branch 'features/spackathon' of github.com:NERSC/spack into crayport
Conflicts:
	lib/spack/spack/compiler.py
2015-11-11 10:35:59 -08:00
Gregory Becker
5347f460b4 adding module find to find command 2015-11-11 10:31:37 -08:00
Gregory Becker
cd69681ae5 merged in work from other computer and starting to track down bugs 2015-11-11 10:09:03 -08:00
Todd Gamblin
5417a514e9 Eliminated two bugs found by spack test and rewrote the parser to be more sane 2015-11-10 18:44:01 -08:00
Gregory Becker
5e75a5c81c Fixed bug that spack.db.exists() returned True for anonymous specs 2015-11-10 15:45:22 -08:00
Gregory Becker
6f339939c4 Removed "any-pkg-name" and replaced it with empty string. Also changed cflag concretizer to concretize each flag individually, allowing us to have unconcretized FlagMap objects for find and uninstall. Now empty flags in find match any, whereas specifying +cflags=\'\' matches only those with empty strings for flags 2015-11-10 15:45:22 -08:00
Gregory Becker
6fa0bb991a Removed cflags from default format string and made them an option within the compiler string. Added -f option to find command; with -f, find prints flags 2015-11-10 15:45:22 -08:00
Gregory Becker
5a9394c65f added default compilers into spec and fixed constrain/concretize bug 2015-11-10 15:45:22 -08:00
Gregory Becker
cb5bc242db Changed flag default to "". Updated printing and other logic to match. Seems to have solved error in normalize. 2015-11-10 15:45:22 -08:00
Gregory Becker
2d77173dfa partial commit of cflags for debugging 2015-11-10 15:45:22 -08:00
Gregory Becker
42b5b7d2dd Commit of compiler flags addition:
Flags are passed from the command line all the way through
build environments to environment variables.
      Flags are specified using +name=value and values are quoted
using escaped quotes when necessary.

Future work includes using the flags in the compiler wrapper script
and hopefully updating the parser for a gentler user experience of
the spec language.
2015-11-10 15:45:22 -08:00
Gregory Becker
db1b21b9aa reclaimed the = sign. Architectures now specified by +arch= instead. Decided to prepend flag names with + for clarity in spec names and ease of parsing. Also generalized variants, although there is not yet a way to specify a generalized (name=value) variant. 2015-11-10 15:45:22 -08:00
Gregory Becker
7989a7f903 Headless specs and /hash spec specification 2015-11-10 15:42:10 -08:00
Gregory Becker
f9c8c4d216 partial commit to merge database 2015-11-10 15:40:00 -08:00
Gregory Becker
4ed22ad932 partial commit of cflags work 2015-11-10 15:39:27 -08:00
Mario Melara
e0498ce54a mxml is adios's package dependency 2015-11-05 13:43:11 -08:00
Mario Melara
0fcb368f47 Adding adios package to spack's package list 2015-11-05 13:42:50 -08:00
Gregory Becker
08729315c6 Added bgq architecture subclass: may require additional functionality to support 2015-11-05 09:21:56 -08:00
Mario Melara
b61d554dc8 Fixed architecture.py file so it doesn't have the weird merge changes i.e <<<HEAD etc. Also added target method of recognizing it's own architecture 2015-11-04 13:28:12 -08:00
Mario Melara
2bc73b4a27 Merge branch 'features/spackathon' of https://github.com/NERSC/spack into features/spackathon 2015-11-04 13:21:33 -08:00
Gregory Becker
3a73ae1683 Fixed the previous commit 2015-11-04 13:12:11 -08:00
Mario Melara
9bf8e8573c generic linux architecture subclass 2015-11-04 13:08:48 -08:00
Mario Melara
e3a02ea5c7 Merge branch 'features/spackathon' of https://github.com/NERSC/spack into features/spackathon
Conflicts:
	lib/spack/spack/architecture.py
2015-11-04 13:06:56 -08:00
Gregory Becker
35532d6b0a Changed cray architecture subclass to add proper targets for front at back end nodes 2015-11-04 13:00:35 -08:00
Mario Melara
37260962e5 changed some potential syntax errors and added a way for target to recognize class 2015-11-04 12:57:29 -08:00
Gregory Becker
5ac974c9b2 Enforced that the architecture subclass cannot add a target that shares a name with a target alias 2015-11-04 12:50:22 -08:00
Mario Melara
058e72d29c Added default target and also front end and back end targets 2015-11-02 11:08:55 -08:00
Mario Melara
eb2cf1698f Fixed some issues with naming 2015-11-02 11:08:08 -08:00
Mario Melara
9a91da9ccd Added arch_path to list of modules path 2015-10-30 15:59:28 -07:00
Mario Melara
e39586c81d Reverted back all architecture way of finding modules 2015-10-30 15:58:49 -07:00
Mario Melara
2d87bb92ed Changed front-end and back-end to front_end and back_end to avoid error 2015-10-30 15:58:20 -07:00
Mario Melara
db0695e46a architectures folder where the Architecture subclasses reside 2015-10-30 15:57:00 -07:00
Gregory Becker
6e56070386 improved aliasing in target method in architecture.py 2015-10-30 15:15:36 -07:00
Gregory Becker
d177184777 added target method to architecture.py and minor cleanup 2015-10-30 15:12:29 -07:00
Mario Melara
0a004e0fce Merge branch 'features/spackathon' of https://github.com/NERSC/spack into features/spackathon
Merge Gregory Becker's commits with my own architecture commits
2015-10-30 14:53:49 -07:00
Mario Melara
7ab921ff02 Changed architecture class and added class Target 2015-10-30 14:46:26 -07:00
Gregory Becker
382d8478bf prototype of new architecture concretization saved as new_concretize_architecture in concretize.py 2015-10-30 10:23:33 -07:00
Gregory Becker
09597fe8dc updated the executible to return stderr when specified. Added load_module to build_environment.py, loads target 2015-10-30 09:44:28 -07:00
Mario Melara
38508c5a3f Created a control flow logic that will loop through the strategies and find compilers using that. TODO: Need to find a way to locate their executables 2015-10-22 12:02:26 -07:00
Mario Melara
a89abb435f Changed structure of class, add compiler strategy is a method and can create a dict 2015-10-21 11:32:59 -07:00
Mario Melara
9b387e7682 Added strategy method in init 2015-10-21 11:09:05 -07:00
Gregory Becker
51b69ef00b initial fetch on crayport 2015-10-21 09:27:57 -07:00
Mario Melara
c31da9bc8f Made sure architecture works with yaml file 2015-10-20 14:10:54 -07:00
Mario Melara
ca3cc5b23e Refactored architecture class. Now it will automagically create a dict upon instantiation. 2015-10-20 13:37:06 -07:00
Mario Melara
3ba2842b53 Got Architecture class working the way i wanted to. Next to write tests 2015-10-20 13:33:21 -07:00
Mario Melara
fec197ccac Fixed the output of sys_type(), might need to add back the error handling part 2015-10-15 15:25:13 -07:00
Mario Melara
ccdf105759 Commented out a long list of tests to just include my arch test 2015-10-15 12:48:12 -07:00
Mario Melara
d328f4c3b6 Test suite for architecture class and functions 2015-10-15 12:47:26 -07:00
Mario Melara
29e03ac851 Added __eq__ testing method. Created tests for it in test/ folder 2015-10-15 12:46:44 -07:00
Mario Melara
4f21344e87 Started created the Architecture class for Spack to use 2015-10-14 19:41:07 -07:00
Mario Melara
b6d2a12ceb Started changing the find in modules method written by Todd 2015-10-07 15:57:29 -07:00
Mario Melara
06fe879745 Merge branch 'features/crayproto' of https://github.com/scalability-llnl/spack into develop 2015-10-07 14:55:05 -07:00
karenyyng
f4e72f33c8 added dependencies for py-h5py 2015-10-05 08:24:33 -07:00
Todd Gamblin
d00314c621 Protptype cray compiler detection and support 2015-10-05 01:30:25 -07:00
karenyyng
c809cc9273 clean up package.py file and remove duplicate file 2015-10-03 19:24:15 -07:00
karenyyng
f3254ff02d removed package for python packages with problematic / duplicate names 2015-10-03 19:22:53 -07:00
karenyyng
e9f7d033ff make sure submodule is added in the correct location 2015-10-03 19:13:08 -07:00
karenyyng
79808da760 added a bunch of packages and added submodule 2015-10-03 18:47:36 -07:00
karenyyng
1501786fd9 adding python_recipe_parser as a submodule under the folder utils 2015-10-03 13:04:37 -07:00
Mario Melara
c6cd8ae243 Use more recent version of libffi. 3.1 has a known bug that is fixed in current version 2015-10-01 21:35:25 -07:00
994 changed files with 42514 additions and 7331 deletions

View File

@@ -8,6 +8,9 @@
# - E221: multiple spaces before operator
# - E241: multiple spaces after ,
#
# Let people use terse Python features:
# - E731 : lambda expressions
#
# Spack allows wildcard imports:
# - F403: disable wildcard import
#
@@ -16,5 +19,5 @@
# - F999: name name be undefined or undefined from star imports.
#
[flake8]
ignore = E221,E241,F403,F821,F999
ignore = E129,E221,E241,E272,E731,F403,F821,F999,F405
max-line-length = 79

8
.gitignore vendored
View File

@@ -1,10 +1,14 @@
/var/spack/stage
/var/spack/cache
/var/spack/repos/*/index.yaml
/var/spack/repos/*/lock
*.pyc
/opt/
/opt
*~
.DS_Store
.idea
/etc/spack/*
/etc/spack/licenses
/etc/spack/*.yaml
/etc/spackconfig
/share/spack/dotkit
/share/spack/modules

View File

@@ -1,7 +1,17 @@
language: python
python:
- "2.6"
- "2.7"
env:
- TEST_TYPE=unit
- TEST_TYPE=flake8
# Exclude flake8 from python 2.6
matrix:
exclude:
- python: "2.6"
env: TEST_TYPE=flake8
# Use new Travis infrastructure (Docker can't sudo yet)
sudo: false
@@ -20,20 +30,13 @@ before_install:
- git fetch origin develop:develop
script:
# Regular spack setup and tests
- . share/spack/setup-env.sh
- spack compilers
- spack config get compilers
- spack install -v libdwarf
# Run unit tests with code coverage
- coverage run bin/spack test
# Run unit tests with code coverage plus install libdwarf
- 'if [ "$TEST_TYPE" = "unit" ]; then share/spack/qa/run-unit-tests; fi'
# Run flake8 code style checks.
- share/spack/qa/run-flake8
- 'if [ "$TEST_TYPE" = "flake8" ]; then share/spack/qa/run-flake8; fi'
after_success:
- coveralls
- 'if [ "$TEST_TYPE" = "unit" ] && [ "$TRAVIS_PYTHON_VERSION" = "2.7" ]; then coveralls; fi'
notifications:
email:

View File

@@ -58,17 +58,24 @@ can join it here:
### Contributions
At the moment, contributing to Spack is relatively simple. Just send us
a [pull request](https://help.github.com/articles/using-pull-requests/).
Contributing to Spack is relatively easy. Just send us a
[pull request](https://help.github.com/articles/using-pull-requests/).
When you send your request, make ``develop`` the destination branch on the
[Spack repository](https://github.com/LLNL/spack).
Your contribution will need to pass all the tests run by the `spack test`
command, as well as the formatting checks in `share/spack/qa/run-flake8`.
You should run both of these before submitting your pull request, to
ensure that the online checks succeed.
Before you send a PR, your code should pass the following checks:
Spack is using a rough approximation of the [Git
* Your contribution will need to pass the `spack test` command.
Run this before submitting your PR.
* Also run the `share/spack/qa/run-flake8` script to check for PEP8 compliance.
To encourage contributions and readability by a broad audience,
Spack uses the [PEP8](https://www.python.org/dev/peps/pep-0008/) coding
standard with [a few exceptions](https://github.com/LLNL/spack/blob/develop/.flake8).
We enforce these guidelines with [Travis CI](https://travis-ci.org/LLNL/spack).
Spack uses a rough approximation of the [Git
Flow](http://nvie.com/posts/a-successful-git-branching-model/)
branching model. The ``develop`` branch contains the latest
contributions, and ``master`` is always tagged and points to the

View File

@@ -79,6 +79,15 @@
# Obviously, for this to work, `sbang` needs to have a short enough
# path that *it* will run without hitting OS limits.
#
# For Lua, scripts the second line can't start with #!, as # is not
# the comment character in lua (even though lua ignores #! on the
# *first* line of a script). So, instrument a lua script like this,
# using -- instead of # on the second line:
#
# 1 #!/bin/bash /path/to/sbang
# 2 --!/long/path/to/lua with arguments
# 3
# 4 print "success!"
#
# How it works
# -----------------------------
@@ -95,6 +104,8 @@ lines=0
while read line && ((lines < 2)) ; do
if [[ "$line" = '#!'* ]]; then
interpreter="${line#\#!}"
elif [[ "$line" = '--!'*lua* ]]; then
interpreter="${line#--!}"
fi
lines=$((lines+1))
done < "$script"

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python
# flake8: noqa
##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
@@ -24,9 +25,10 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import sys
if not sys.version_info[:2] >= (2,6):
if not sys.version_info[:2] >= (2, 6):
v_info = sys.version_info[:3]
sys.exit("Spack requires Python 2.6 or higher. This is Python %d.%d.%d." % v_info)
sys.exit("Spack requires Python 2.6 or higher. "
"This is Python %d.%d.%d." % v_info)
import os
@@ -62,7 +64,8 @@ for pyc_file in orphaned_pyc_files:
try:
os.remove(pyc_file)
except OSError as e:
print "WARNING: Spack may fail mysteriously. Couldn't remove orphaned .pyc file: %s" % pyc_file
print ("WARNING: Spack may fail mysteriously. "
"Couldn't remove orphaned .pyc file: %s" % pyc_file)
# If there is no working directory, use the spack prefix.
try:
@@ -77,7 +80,7 @@ import llnl.util.tty as tty
from llnl.util.tty.color import *
import spack
from spack.error import SpackError
from external import argparse
import argparse
# Command parsing
parser = argparse.ArgumentParser(
@@ -128,6 +131,7 @@ if len(sys.argv) == 1:
# actually parse the args.
args = parser.parse_args()
def main():
# Set up environment based on args.
tty.set_verbose(args.verbose)
@@ -138,6 +142,9 @@ def main():
import spack.util.debug as debug
debug.register_interrupt_handler()
from spack.yaml_version_check import check_yaml_versions
check_yaml_versions()
spack.spack_working_dir = working_dir
if args.mock:
from spack.repository import RepoPath
@@ -145,7 +152,7 @@ def main():
# If the user asked for it, don't check ssl certs.
if args.insecure:
tty.warn("You asked for --insecure, which does not check SSL certificates.")
tty.warn("You asked for --insecure. Will NOT check SSL certificates.")
spack.curl.add_default_arg('-k')
# Try to load the particular command asked for and run it
@@ -164,11 +171,12 @@ def main():
elif isinstance(return_val, int):
sys.exit(return_val)
else:
tty.die("Bad return value from command %s: %s" % (args.command, return_val))
tty.die("Bad return value from command %s: %s"
% (args.command, return_val))
if args.profile:
import cProfile
cProfile.run('main()', sort='tottime')
cProfile.run('main()', sort='time')
elif args.pdb:
import pdb
pdb.run('main()')

View File

@@ -0,0 +1,40 @@
# -------------------------------------------------------------------------
# This is the default configuration for Spack's module file generation.
#
# Settings here are versioned with Spack and are intended to provide
# sensible defaults out of the box. Spack maintainers should edit this
# file to keep it current.
#
# Users can override these settings by editing the following files.
#
# Per-spack-instance settings (overrides defaults):
# $SPACK_ROOT/etc/spack/modules.yaml
#
# Per-user settings (overrides default and site settings):
# ~/.spack/modules.yaml
# -------------------------------------------------------------------------
modules:
enable:
- tcl
- dotkit
prefix_inspections:
bin:
- PATH
man:
- MANPATH
share/man:
- MANPATH
lib:
- LIBRARY_PATH
- LD_LIBRARY_PATH
lib64:
- LIBRARY_PATH
- LD_LIBRARY_PATH
include:
- CPATH
lib/pkgconfig:
- PKG_CONFIG_PATH
lib64/pkgconfig:
- PKG_CONFIG_PATH
'':
- CMAKE_PREFIX_PATH

View File

@@ -0,0 +1,21 @@
# -------------------------------------------------------------------------
# This file controls default concretization preferences for Spack.
#
# Settings here are versioned with Spack and are intended to provide
# sensible defaults out of the box. Spack maintainers should edit this
# file to keep it current.
#
# Users can override these settings by editing the following files.
#
# Per-spack-instance settings (overrides defaults):
# $SPACK_ROOT/etc/spack/packages.yaml
#
# Per-user settings (overrides default and site settings):
# ~/.spack/packages.yaml
# -------------------------------------------------------------------------
packages:
all:
providers:
mpi: [openmpi, mpich]
blas: [openblas]
lapack: [openblas]

View File

@@ -0,0 +1,14 @@
# -------------------------------------------------------------------------
# This is the default spack repository configuration. It includes the
# builtin spack package repository.
#
# Users can override these settings by editing the following files.
#
# Per-spack-instance settings (overrides defaults):
# $SPACK_ROOT/etc/spack/repos.yaml
#
# Per-user settings (overrides default and site settings):
# ~/.spack/repos.yaml
# -------------------------------------------------------------------------
repos:
- $spack/var/spack/repos/builtin

View File

@@ -1,29 +0,0 @@
# -------------------------------------------------------------------------
# This is the default spack module files generation configuration.
#
# Changes to this file will affect all users of this spack install,
# although users can override these settings in their ~/.spack/modules.yaml.
# -------------------------------------------------------------------------
modules:
enable:
- tcl
- dotkit
prefix_inspections:
bin:
- PATH
man:
- MANPATH
lib:
- LIBRARY_PATH
- LD_LIBRARY_PATH
lib64:
- LIBRARY_PATH
- LD_LIBRARY_PATH
include:
- CPATH
lib/pkgconfig:
- PKGCONFIG
lib64/pkgconfig:
- PKGCONFIG
'':
- CMAKE_PREFIX_PATH

View File

@@ -1,8 +0,0 @@
# -------------------------------------------------------------------------
# This is the default spack repository configuration.
#
# Changes to this file will affect all users of this spack install,
# although users can override these settings in their ~/.spack/repos.yaml.
# -------------------------------------------------------------------------
repos:
- $spack/var/spack/repos/builtin

View File

@@ -6,6 +6,15 @@ Basic usage
The ``spack`` command has many *subcommands*. You'll only need a
small subset of them for typical usage.
Note that Spack colorizes output. ``less -R`` should be used with
Spack to maintian this colorization. Eg::
spack find | less -R
It is recommend that the following be put in your ``.bashrc`` file::
alias less='less -R'
Listing available packages
------------------------------
@@ -24,12 +33,29 @@ Spack can install:
.. command-output:: spack list
The packages are listed by name in alphabetical order. You can also
do wildcats searches using ``*``:
The packages are listed by name in alphabetical order. If you specify a
pattern to match, it will follow this set of rules. A pattern with no
wildcards, ``*`` or ``?``, will be treated as though it started and ended with
``*``, so ``util`` is equivalent to ``*util*``. A pattern with no capital
letters will be treated as case-insensitive. You can also add the ``-i`` flag
to specify a case insensitive search, or ``-d`` to search the description of
the package in addition to the name. Some examples:
.. command-output:: spack list m*
All packages whose names contain "sql" case insensitive:
.. command-output:: spack list *util*
.. command-output:: spack list sql
All packages whose names start with a capital M:
.. command-output:: spack list 'M*'
All packages whose names or descriptions contain Documentation:
.. command-output:: spack list -d Documentation
All packages whose names contain documentation case insensitive:
.. command-output:: spack list -d documentation
.. _spack-info:
@@ -97,13 +123,13 @@ that the packages is installed:
$ spack install mpileaks
==> Installing mpileaks
==> mpich is already installed in /home/gamblin2/spack/opt/chaos_5_x86_64_ib/gcc@4.4.7/mpich@3.0.4.
==> callpath is already installed in /home/gamblin2/spack/opt/chaos_5_x86_64_ib/gcc@4.4.7/callpath@1.0.2-5dce4318.
==> adept-utils is already installed in /home/gamblin2/spack/opt/chaos_5_x86_64_ib/gcc@4.4.7/adept-utils@1.0-5adef8da.
==> mpich is already installed in /home/gamblin2/spack/opt/linux-debian7-x86_64/gcc@4.4.7/mpich@3.0.4.
==> callpath is already installed in /home/gamblin2/spack/opt/linux-debian7-x86_64/gcc@4.4.7/callpath@1.0.2-5dce4318.
==> adept-utils is already installed in /home/gamblin2/spack/opt/linux-debian7-x86_64/gcc@4.4.7/adept-utils@1.0-5adef8da.
==> Trying to fetch from https://github.com/hpc/mpileaks/releases/download/v1.0/mpileaks-1.0.tar.gz
######################################################################## 100.0%
==> Staging archive: /home/gamblin2/spack/var/spack/stage/mpileaks@1.0%gcc@4.4.7=chaos_5_x86_64_ib-59f6ad23/mpileaks-1.0.tar.gz
==> Created stage in /home/gamblin2/spack/var/spack/stage/mpileaks@1.0%gcc@4.4.7=chaos_5_x86_64_ib-59f6ad23.
==> Staging archive: /home/gamblin2/spack/var/spack/stage/mpileaks@1.0%gcc@4.4.7 arch=linux-debian7-x86_64-59f6ad23/mpileaks-1.0.tar.gz
==> Created stage in /home/gamblin2/spack/var/spack/stage/mpileaks@1.0%gcc@4.4.7 arch=linux-debian7-x86_64-59f6ad23.
==> No patches needed for mpileaks.
==> Building mpileaks.
@@ -111,7 +137,7 @@ that the packages is installed:
==> Successfully installed mpileaks.
Fetch: 2.16s. Build: 9.82s. Total: 11.98s.
[+] /home/gamblin2/spack/opt/chaos_5_x86_64_ib/gcc@4.4.7/mpileaks@1.0-59f6ad23
[+] /home/gamblin2/spack/opt/linux-debian7-x86_64/gcc@4.4.7/mpileaks@1.0-59f6ad23
The last line, with the ``[+]``, indicates where the package is
installed.
@@ -132,10 +158,10 @@ sites, as installing a version that one user needs will not disrupt
existing installations for other users.
In addition to different versions, Spack can customize the compiler,
compile-time options (variants), and platform (for cross compiles) of
an installation. Spack is unique in that it can also configure the
*dependencies* a package is built with. For example, two
configurations of the same version of a package, one built with boost
compile-time options (variants), compiler flags, and platform (for
cross compiles) of an installation. Spack is unique in that it can
also configure the *dependencies* a package is built with. For example,
two configurations of the same version of a package, one built with boost
1.39.0, and the other version built with version 1.43.0, can coexist.
This can all be done on the command line using the *spec* syntax.
@@ -166,7 +192,7 @@ To uninstall a package and every package that depends on it, you may give the
spack uninstall --dependents mpich
will display a list of all the packages that depends on `mpich` and, upon confirmation,
will display a list of all the packages that depend on `mpich` and, upon confirmation,
will uninstall them in the right order.
A line like
@@ -213,7 +239,7 @@ Running ``spack find`` with no arguments lists installed packages:
$ spack find
==> 74 installed packages.
-- chaos_5_x86_64_ib / gcc@4.4.7 --------------------------------
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
ImageMagick@6.8.9-10 libdwarf@20130729 py-dateutil@2.4.0
adept-utils@1.0 libdwarf@20130729 py-ipython@2.3.1
atk@2.14.0 libelf@0.8.12 py-matplotlib@1.4.2
@@ -239,13 +265,19 @@ Running ``spack find`` with no arguments lists installed packages:
lcms@2.6 pixman@0.32.6 xz@5.2.0
libdrm@2.4.33 py-dateutil@2.4.0 zlib@1.2.8
-- chaos_5_x86_64_ib / gcc@4.9.2 --------------------------------
-- linux-debian7-x86_64 / gcc@4.9.2 --------------------------------
libelf@0.8.10 mpich@3.0.4
Packages are divided into groups according to their architecture and
compiler. Within each group, Spack tries to keep the view simple, and
only shows the version of installed packages.
``spack find`` can filter the package list based on the package name, spec, or
a number of properties of their installation status. For example, missing
dependencies of a spec can be shown with ``-m``, packages which were
explicitly installed with ``spack install <package>`` can be singled out with
``-e`` and those which have been pulled in only as dependencies with ``-E``.
In some cases, there may be different configurations of the *same*
version of a package installed. For example, there are two
installations of of ``libdwarf@20130729`` above. We can look at them
@@ -256,7 +288,7 @@ in more detail using ``spack find -d``, and by asking only to show
$ spack find --deps libdwarf
==> 2 installed packages.
-- chaos_5_x86_64_ib / gcc@4.4.7 --------------------------------
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
libdwarf@20130729-d9b90962
^libelf@0.8.12
libdwarf@20130729-b52fac98
@@ -272,7 +304,7 @@ want to know whether two packages' dependencies differ, you can use
$ spack find -l libdwarf
==> 2 installed packages.
-- chaos_5_x86_64_ib / gcc@4.4.7 --------------------------------
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
libdwarf@20130729-d9b90962 libdwarf@20130729-b52fac98
Now the ``libwarf`` installs have hashes after their names. These are
@@ -286,14 +318,14 @@ use ``spack find -p``:
$ spack find -p
==> 74 installed packages.
-- chaos_5_x86_64_ib / gcc@4.4.7 --------------------------------
ImageMagick@6.8.9-10 /home/gamblin2/spack/opt/chaos_5_x86_64_ib/gcc@4.4.7/ImageMagick@6.8.9-10-4df950dd
adept-utils@1.0 /home/gamblin2/spack/opt/chaos_5_x86_64_ib/gcc@4.4.7/adept-utils@1.0-5adef8da
atk@2.14.0 /home/gamblin2/spack/opt/chaos_5_x86_64_ib/gcc@4.4.7/atk@2.14.0-3d09ac09
boost@1.55.0 /home/gamblin2/spack/opt/chaos_5_x86_64_ib/gcc@4.4.7/boost@1.55.0
bzip2@1.0.6 /home/gamblin2/spack/opt/chaos_5_x86_64_ib/gcc@4.4.7/bzip2@1.0.6
cairo@1.14.0 /home/gamblin2/spack/opt/chaos_5_x86_64_ib/gcc@4.4.7/cairo@1.14.0-fcc2ab44
callpath@1.0.2 /home/gamblin2/spack/opt/chaos_5_x86_64_ib/gcc@4.4.7/callpath@1.0.2-5dce4318
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
ImageMagick@6.8.9-10 /home/gamblin2/spack/opt/linux-debian7-x86_64/gcc@4.4.7/ImageMagick@6.8.9-10-4df950dd
adept-utils@1.0 /home/gamblin2/spack/opt/linux-debian7-x86_64/gcc@4.4.7/adept-utils@1.0-5adef8da
atk@2.14.0 /home/gamblin2/spack/opt/linux-debian7-x86_64/gcc@4.4.7/atk@2.14.0-3d09ac09
boost@1.55.0 /home/gamblin2/spack/opt/linux-debian7-x86_64/gcc@4.4.7/boost@1.55.0
bzip2@1.0.6 /home/gamblin2/spack/opt/linux-debian7-x86_64/gcc@4.4.7/bzip2@1.0.6
cairo@1.14.0 /home/gamblin2/spack/opt/linux-debian7-x86_64/gcc@4.4.7/cairo@1.14.0-fcc2ab44
callpath@1.0.2 /home/gamblin2/spack/opt/linux-debian7-x86_64/gcc@4.4.7/callpath@1.0.2-5dce4318
...
And, finally, you can restrict your search to a particular package
@@ -302,10 +334,10 @@ by supplying its name:
.. code-block:: sh
$ spack find -p libelf
-- chaos_5_x86_64_ib / gcc@4.4.7 --------------------------------
libelf@0.8.11 /home/gamblin2/spack/opt/chaos_5_x86_64_ib/gcc@4.4.7/libelf@0.8.11
libelf@0.8.12 /home/gamblin2/spack/opt/chaos_5_x86_64_ib/gcc@4.4.7/libelf@0.8.12
libelf@0.8.13 /home/gamblin2/spack/opt/chaos_5_x86_64_ib/gcc@4.4.7/libelf@0.8.13
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
libelf@0.8.11 /home/gamblin2/spack/opt/linux-debian7-x86_64/gcc@4.4.7/libelf@0.8.11
libelf@0.8.12 /home/gamblin2/spack/opt/linux-debian7-x86_64/gcc@4.4.7/libelf@0.8.12
libelf@0.8.13 /home/gamblin2/spack/opt/linux-debian7-x86_64/gcc@4.4.7/libelf@0.8.13
``spack find`` actually does a lot more than this. You can use
*specs* to query for specific configurations and builds of each
@@ -315,7 +347,7 @@ package. If you want to find only libelf versions greater than version
.. code-block:: sh
$ spack find libelf@0.8.12:
-- chaos_5_x86_64_ib / gcc@4.4.7 --------------------------------
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
libelf@0.8.12 libelf@0.8.13
Finding just the versions of libdwarf built with a particular version
@@ -325,139 +357,17 @@ of libelf would look like this:
$ spack find -l libdwarf ^libelf@0.8.12
==> 1 installed packages.
-- chaos_5_x86_64_ib / gcc@4.4.7 --------------------------------
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
libdwarf@20130729-d9b90962
We can also search for packages that have a certain attribute. For example,
``spack find -l libdwarf +debug`` will show only installations of libdwarf
with the 'debug' compile-time option enabled, while ``spack find -l +debug``
will find every installed package with a 'debug' compile-time option enabled.
The full spec syntax is discussed in detail in :ref:`sec-specs`.
Compiler configuration
-----------------------------------
Spack has the ability to build packages with multiple compilers and
compiler versions. Spack searches for compilers on your machine
automatically the first time it is run. It does this by inspecting
your path.
.. _spack-compilers:
``spack compilers``
~~~~~~~~~~~~~~~~~~~~~~~
You can see which compilers spack has found by running ``spack
compilers`` or ``spack compiler list``::
$ spack compilers
==> Available compilers
-- gcc ---------------------------------------------------------
gcc@4.9.0 gcc@4.8.0 gcc@4.7.0 gcc@4.6.2 gcc@4.4.7
gcc@4.8.2 gcc@4.7.1 gcc@4.6.3 gcc@4.6.1 gcc@4.1.2
-- intel -------------------------------------------------------
intel@15.0.0 intel@14.0.0 intel@13.0.0 intel@12.1.0 intel@10.0
intel@14.0.3 intel@13.1.1 intel@12.1.5 intel@12.0.4 intel@9.1
intel@14.0.2 intel@13.1.0 intel@12.1.3 intel@11.1
intel@14.0.1 intel@13.0.1 intel@12.1.2 intel@10.1
-- clang -------------------------------------------------------
clang@3.4 clang@3.3 clang@3.2 clang@3.1
-- pgi ---------------------------------------------------------
pgi@14.3-0 pgi@13.2-0 pgi@12.1-0 pgi@10.9-0 pgi@8.0-1
pgi@13.10-0 pgi@13.1-1 pgi@11.10-0 pgi@10.2-0 pgi@7.1-3
pgi@13.6-0 pgi@12.8-0 pgi@11.1-0 pgi@9.0-4 pgi@7.0-6
Any of these compilers can be used to build Spack packages. More on
how this is done is in :ref:`sec-specs`.
.. _spack-compiler-add:
``spack compiler add``
~~~~~~~~~~~~~~~~~~~~~~~
An alias for ``spack compiler find``.
.. _spack-compiler-find:
``spack compiler find``
~~~~~~~~~~~~~~~~~~~~~~~
If you do not see a compiler in this list, but you want to use it with
Spack, you can simply run ``spack compiler find`` with the path to
where the compiler is installed. For example::
$ spack compiler find /usr/local/tools/ic-13.0.079
==> Added 1 new compiler to /Users/gamblin2/.spack/compilers.yaml
intel@13.0.079
Or you can run ``spack compiler find`` with no arguments to force
auto-detection. This is useful if you do not know where compilers are
installed, but you know that new compilers have been added to your
``PATH``. For example, using dotkit, you might do this::
$ module load gcc-4.9.0
$ spack compiler find
==> Added 1 new compiler to /Users/gamblin2/.spack/compilers.yaml
gcc@4.9.0
This loads the environment module for gcc-4.9.0 to add it to
``PATH``, and then it adds the compiler to Spack.
.. _spack-compiler-info:
``spack compiler info``
~~~~~~~~~~~~~~~~~~~~~~~
If you want to see specifics on a particular compiler, you can run
``spack compiler info`` on it::
$ spack compiler info intel@15
intel@15.0.0:
cc = /usr/local/bin/icc-15.0.090
cxx = /usr/local/bin/icpc-15.0.090
f77 = /usr/local/bin/ifort-15.0.090
fc = /usr/local/bin/ifort-15.0.090
This shows which C, C++, and Fortran compilers were detected by Spack.
Notice also that we didn't have to be too specific about the
version. We just said ``intel@15``, and information about the only
matching Intel compiler was displayed.
Manual compiler configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If auto-detection fails, you can manually configure a compiler by
editing your ``~/.spack/compilers.yaml`` file. You can do this by running
``spack config edit compilers``, which will open the file in your ``$EDITOR``.
Each compiler configuration in the file looks like this::
...
chaos_5_x86_64_ib:
...
intel@15.0.0:
cc: /usr/local/bin/icc-15.0.024-beta
cxx: /usr/local/bin/icpc-15.0.024-beta
f77: /usr/local/bin/ifort-15.0.024-beta
fc: /usr/local/bin/ifort-15.0.024-beta
...
The chaos_5_x86_64_ib string is an architecture string, and multiple
compilers can be listed underneath an architecture. The architecture
string may be replaced with the string 'all' to signify compilers that
work on all architectures.
For compilers, like ``clang``, that do not support Fortran, put
``None`` for ``f77`` and ``fc``::
clang@3.3svn:
cc: /usr/bin/clang
cxx: /usr/bin/clang++
f77: None
fc: None
Once you save the file, the configured compilers will show up in the
list displayed by ``spack compilers``.
.. _sec-specs:
Specs & dependencies
@@ -469,12 +379,12 @@ Spack, that descriptor is called a *spec*. Spack uses specs to refer
to a particular build configuration (or configurations) of a package.
Specs are more than a package name and a version; you can use them to
specify the compiler, compiler version, architecture, compile options,
and dependency options for a build. In this section, we'll go over
and dependency options for a build. In this section, we\'ll go over
the full syntax of specs.
Here is an example of a much longer spec than we've seen thus far::
Here is an example of a much longer spec than we\'ve seen thus far::
mpileaks @1.2:1.4 %gcc@4.7.5 +debug -qt =bgqos_0 ^callpath @1.1 %gcc@4.7.2
mpileaks @1.2:1.4 %gcc@4.7.5 +debug -qt arch=bgq_os ^callpath @1.1 %gcc@4.7.2
If provided to ``spack install``, this will install the ``mpileaks``
library at some version between ``1.2`` and ``1.4`` (inclusive),
@@ -492,8 +402,13 @@ More formally, a spec consists of the following pieces:
* ``%`` Optional compiler specifier, with an optional compiler version
(``gcc`` or ``gcc@4.7.3``)
* ``+`` or ``-`` or ``~`` Optional variant specifiers (``+debug``,
``-qt``, or ``~qt``)
* ``=`` Optional architecture specifier (``bgqos_0``)
``-qt``, or ``~qt``) for boolean variants
* ``name=<value>`` Optional variant specifiers that are not restricted to
boolean variants
* ``name=<value>`` Optional compiler flag specifiers. Valid flag names are
``cflags``, ``cxxflags``, ``fflags``, ``cppflags``, ``ldflags``, and ``ldlibs``.
* ``target=<value> os=<value>`` Optional architecture specifier
(``target=haswell os=CNL10``)
* ``^`` Dependency specs (``^callpath@1.1``)
There are two things to notice here. The first is that specs are
@@ -573,7 +488,7 @@ compilers, variants, and architectures just like any other spec.
Specifiers are associated with the nearest package name to their left.
For example, above, ``@1.1`` and ``%gcc@4.7.2`` associates with the
``callpath`` package, while ``@1.2:1.4``, ``%gcc@4.7.5``, ``+debug``,
``-qt``, and ``=bgqos_0`` all associate with the ``mpileaks`` package.
``-qt``, and ``target=haswell os=CNL10`` all associate with the ``mpileaks`` package.
In the diagram above, ``mpileaks`` depends on ``mpich`` with an
unspecified version, but packages can depend on other packages with
@@ -629,22 +544,25 @@ based on site policies.
Variants
~~~~~~~~~~~~~~~~~~~~~~~
.. Note::
Variants are not yet supported, but will be in the next Spack
release (0.9), due in Q2 2015.
Variants are named options associated with a particular package, and
they can be turned on or off. For example, above, supplying
``+debug`` causes ``mpileaks`` to be built with debug flags. The
names of particular variants available for a package depend on what
was provided by the package author. ``spack info <package>`` will
Variants are named options associated with a particular package. They are
optional, as each package must provide default values for each variant it
makes available. Variants can be specified using
a flexible parameter syntax ``name=<value>``. For example,
``spack install libelf debug=True`` will install libelf build with debug
flags. The names of particular variants available for a package depend on
what was provided by the package author. ``spack into <package>`` will
provide information on what build variants are available.
Depending on the package a variant may be on or off by default. For
``mpileaks`` here, ``debug`` is off by default, and we turned it on
with ``+debug``. If a package is on by default you can turn it off by
either adding ``-name`` or ``~name`` to the spec.
For compatibility with earlier versions, variants which happen to be
boolean in nature can be specified by a syntax that represents turning
options on and off. For example, in the previous spec we could have
supplied ``libelf +debug`` with the same effect of enabling the debug
compile time option for the libelf package.
Depending on the package a variant may have any default value. For
``libelf`` here, ``debug`` is ``False`` by default, and we turned it on
with ``debug=True`` or ``+debug``. If a package is ``True`` by default
you can turn it off by either adding ``-name`` or ``~name`` to the spec.
There are two syntaxes here because, depending on context, ``~`` and
``-`` may mean different things. In most shells, the following will
@@ -656,7 +574,7 @@ result in the shell performing home directory substitution:
mpileaks~debug # use this instead
If there is a user called ``debug``, the ``~`` will be incorrectly
expanded. In this situation, you would want to write ``mpileaks
expanded. In this situation, you would want to write ``libelf
-debug``. However, ``-`` can be ambiguous when included after a
package name without spaces:
@@ -671,25 +589,49 @@ package, not a request for ``mpileaks`` built without ``debug``
options. In this scenario, you should write ``mpileaks~debug`` to
avoid ambiguity.
When spack normalizes specs, it prints them out with no spaces and
uses only ``~`` for disabled variants. We allow ``-`` and spaces on
the command line is provided for convenience and legibility.
When spack normalizes specs, it prints them out with no spaces boolean
variants using the backwards compatibility syntax and uses only ``~``
for disabled boolean variants. We allow ``-`` and spaces on the command
line is provided for convenience and legibility.
Architecture specifier
Compiler Flags
~~~~~~~~~~~~~~~~~~~~~~~
.. Note::
Compiler flags are specified using the same syntax as non-boolean variants,
but fulfill a different purpose. While the function of a variant is set by
the package, compiler flags are used by the compiler wrappers to inject
flags into the compile line of the build. Additionally, compiler flags are
inherited by dependencies. ``spack install libdwarf cppflags=\"-g\"`` will
install both libdwarf and libelf with the ``-g`` flag injected into their
compile line.
Architecture specifiers are part of specs but are not yet
functional. They will be in Spack version 1.0, due in Q3 2015.
Notice that the value of the compiler flags must be escape quoted on the
command line. From within python files, the same spec would be specified
``libdwarf cppflags="-g"``. This is necessary because of how the shell
handles the quote symbols.
The architecture specifier starts with a ``=`` and also comes after
some package name within a spec. It allows a user to specify a
particular architecture for the package to be built. This is mostly
used for architectures that need cross-compilation, and in most cases,
users will not need to specify the architecture when they install a
package.
The six compiler flags are injected in the order of implicit make commands
in gnu autotools. If all flags are set, the order is
``$cppflags $cflags|$cxxflags $ldflags command $ldlibs`` for C and C++ and
``$fflags $cppflags $ldflags command $ldlibs`` for fortran.
Architecture specifiers
~~~~~~~~~~~~~~~~~~~~~~~
The architecture can be specified by using the reserved
words ``target`` and/or ``os`` (``target=x86-64 os=debian7``). You can also
use the triplet form of platform, operating system and processor.
.. code-block:: sh
spack install libelf arch=cray_xc-CNL10-haswell
Users on non-Cray systems won't have to worry about specifying the architecture.
Spack will autodetect what kind of operating system is on your machine as well
as the processor. For more information on how the architecture can be
used on Cray machines, check here :ref:`spack-cray`
.. _sec-virtual-dependencies:
@@ -767,6 +709,23 @@ any MPI implementation will do. If another package depends on
error. Likewise, if you try to plug in some package that doesn't
provide MPI, Spack will raise an error.
Specifying Specs by Hash
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Complicated specs can become cumbersome to enter on the command line,
especially when many of the qualifications are necessary to
distinguish between similar installs, for example when using the
``uninstall`` command. To avoid this, when referencing an existing spec,
Spack allows you to reference specs by their hash. We previously
discussed the spec hash that Spack computes. In place of a spec in any
command, substitute ``/<hash>`` where ``<hash>`` is any amount from
the beginning of a spec hash. If the given spec hash is sufficient
to be unique, Spack will replace the reference with the spec to which
it refers. Otherwise, it will prompt for a more qualified hash.
Note that this will not work to reinstall a depencency uninstalled by
``spack uninstall -f``.
.. _spack-providers:
``spack providers``
@@ -798,47 +757,18 @@ Integration with module systems
interface and/or generated module names may change in future
versions.
Spack provides some integration with
`Environment Modules <http://modules.sourceforge.net/>`_
and `Dotkit <https://computing.llnl.gov/?set=jobs&page=dotkit>`_ to make
it easier to use the packages it installed.
Spack provides some integration with `Environment Modules
<http://modules.sourceforge.net/>`_ to make it easier to use the
packages it installs. If your system does not already have
Environment Modules, see InstallEnvironmentModules_.
.. note::
Spack also supports `Dotkit
<https://computing.llnl.gov/?set=jobs&page=dotkit>`_, which is used
by some systems. If you system does not already have a module
system installed, you should use Environment Modules or LMod.
Installing Environment Modules
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In order to use Spack's generated environment modules, you must have
installed the *Environment Modules* package. On many Linux
distributions, this can be installed from the vendor's repository:
.. code-block:: sh
yum install environment-modules # (Fedora/RHEL/CentOS)
apt-get install environment-modules # (Ubuntu/Debian)
If your Linux distribution does not have
Environment Modules, you can get it with Spack:
.. code-block:: sh
spack install environment-modules
In this case to activate it automatically you need to add the following two
lines to your ``.bashrc`` profile (or similar):
.. code-block:: sh
MODULES_HOME=`spack location -i environment-modules`
source ${MODULES_HOME}/Modules/init/bash
If you use a Unix shell other than ``bash``, modify the commands above
accordingly and source the appropriate file in
``${MODULES_HOME}/Modules/init/``.
.. TODO : Add a similar section on how to install dotkit ?
Spack and module systems
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -892,7 +822,7 @@ of installed packages.
$ module avail
------- /home/gamblin2/spack/share/spack/modules/chaos_5_x86_64_ib --------
------- /home/gamblin2/spack/share/spack/modules/linux-debian7-x86_64 --------
adept-utils@1.0%gcc@4.4.7-5adef8da libelf@0.8.13%gcc@4.4.7
automaded@1.0%gcc@4.4.7-d9691bb0 libelf@0.8.13%intel@15.0.0
boost@1.55.0%gcc@4.4.7 mpc@1.0.2%gcc@4.4.7-559607f5
@@ -963,7 +893,7 @@ Spack. For example, this will add the ``mpich`` package built with
$ spack use mpich %gcc@4.4.7
Prepending: mpich@3.0.4%gcc@4.4.7 (ok)
$ which mpicc
~/src/spack/opt/chaos_5_x86_64_ib/gcc@4.4.7/mpich@3.0.4/bin/mpicc
~/src/spack/opt/linux-debian7-x86_64/gcc@4.4.7/mpich@3.0.4/bin/mpicc
Or, similarly with modules, you could type:
@@ -996,8 +926,8 @@ than one installed package matches it), then Spack will warn you:
$ spack load libelf
==> Error: Multiple matches for spec libelf. Choose one:
libelf@0.8.13%gcc@4.4.7=chaos_5_x86_64_ib
libelf@0.8.13%intel@15.0.0=chaos_5_x86_64_ib
libelf@0.8.13%gcc@4.4.7 arch=linux-debian7-x86_64
libelf@0.8.13%intel@15.0.0 arch=linux-debian7-x86_64
You can either type the ``spack load`` command again with a fully
qualified argument, or you can add just enough extra constraints to
@@ -1038,6 +968,80 @@ of module files:
"""Set up the compile and runtime environments for a package."""
pass
Recursive Modules
``````````````````
In some cases, it is desirable to load not just a module, but also all
the modules it depends on. This is not required for most modules
because Spack builds binaries with RPATH support. However, not all
packages use RPATH to find their dependencies: this can be true in
particular for Python extensions, which are currently *not* built with
RPATH.
Modules may be loaded recursively with the ``load`` command's
``--dependencies`` or ``-r`` argument:
.. code-block:: sh
$ spack load --dependencies <spec> ...
More than one spec may be placed on the command line here.
Module Commands for Shell Scripts
``````````````````````````````````
Although Spack is flexible, the ``module`` command is much faster.
This could become an issue when emitting a series of ``spack load``
commands inside a shell script. The ``spack module loads`` may also
be used to generate code that can be cut-and-pasted into a shell
script. For example:
.. code-block:: sh
$ spack module loads --dependencies py-numpy git
# bzip2@1.0.6%gcc@4.9.3=linux-x86_64
module load bzip2-1.0.6-gcc-4.9.3-ktnrhkrmbbtlvnagfatrarzjojmkvzsx
# ncurses@6.0%gcc@4.9.3=linux-x86_64
module load ncurses-6.0-gcc-4.9.3-kaazyneh3bjkfnalunchyqtygoe2mncv
# zlib@1.2.8%gcc@4.9.3=linux-x86_64
module load zlib-1.2.8-gcc-4.9.3-v3ufwaahjnviyvgjcelo36nywx2ufj7z
# sqlite@3.8.5%gcc@4.9.3=linux-x86_64
module load sqlite-3.8.5-gcc-4.9.3-a3eediswgd5f3rmto7g3szoew5nhehbr
# readline@6.3%gcc@4.9.3=linux-x86_64
module load readline-6.3-gcc-4.9.3-se6r3lsycrwxyhreg4lqirp6xixxejh3
# python@3.5.1%gcc@4.9.3=linux-x86_64
module load python-3.5.1-gcc-4.9.3-5q5rsrtjld4u6jiicuvtnx52m7tfhegi
# py-setuptools@20.5%gcc@4.9.3=linux-x86_64
module load py-setuptools-20.5-gcc-4.9.3-4qr2suj6p6glepnedmwhl4f62x64wxw2
# py-nose@1.3.7%gcc@4.9.3=linux-x86_64
module load py-nose-1.3.7-gcc-4.9.3-pwhtjw2dvdvfzjwuuztkzr7b4l6zepli
# openblas@0.2.17%gcc@4.9.3+shared=linux-x86_64
module load openblas-0.2.17-gcc-4.9.3-pw6rmlom7apfsnjtzfttyayzc7nx5e7y
# py-numpy@1.11.0%gcc@4.9.3+blas+lapack=linux-x86_64
module load py-numpy-1.11.0-gcc-4.9.3-mulodttw5pcyjufva4htsktwty4qd52r
# curl@7.47.1%gcc@4.9.3=linux-x86_64
module load curl-7.47.1-gcc-4.9.3-ohz3fwsepm3b462p5lnaquv7op7naqbi
# autoconf@2.69%gcc@4.9.3=linux-x86_64
module load autoconf-2.69-gcc-4.9.3-bkibjqhgqm5e3o423ogfv2y3o6h2uoq4
# cmake@3.5.0%gcc@4.9.3~doc+ncurses+openssl~qt=linux-x86_64
module load cmake-3.5.0-gcc-4.9.3-x7xnsklmgwla3ubfgzppamtbqk5rwn7t
# expat@2.1.0%gcc@4.9.3=linux-x86_64
module load expat-2.1.0-gcc-4.9.3-6pkz2ucnk2e62imwakejjvbv6egncppd
# git@2.8.0-rc2%gcc@4.9.3+curl+expat=linux-x86_64
module load git-2.8.0-rc2-gcc-4.9.3-3bib4hqtnv5xjjoq5ugt3inblt4xrgkd
The script may be further edited by removing unnecessary modules.
This script may be directly executed in bash via
.. code-block :: sh
source <( spack module loads --dependencies py-numpy git )
Regenerating Module files
~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
@@ -1065,6 +1069,108 @@ overrides ``setup_dependent_environment`` in the following way:
to insert the appropriate ``PYTHONPATH`` modifications in the module
files of python packages.
Recursive Modules
``````````````````
In some cases, it is desirable to load not just a module, but also all
the modules it depends on. This is not required for most modules
because Spack builds binaries with RPATH support. However, not all
packages use RPATH to find their dependencies: this can be true in
particular for Python extensions, which are currently *not* built with
RPATH.
Modules may be loaded recursively with the command:
.. code-block:: sh
$ module load `spack module tcl --dependencies <spec>...
More than one spec may be placed on the command line here.
Module Comamnds for Shell Scripts
``````````````````````````````````
Although Spack is flexbile, the ``module`` command is much faster.
This could become an issue when emitting a series of ``spack load``
commands inside a shell script. By adding the ``--shell`` flag,
``spack module find`` may also be used to generate code that can be
cut-and-pasted into a shell script. For example:
.. code-block:: sh
$ spack module loads --dependencies py-numpy git
# bzip2@1.0.6%gcc@4.9.3=linux-x86_64
module load bzip2-1.0.6-gcc-4.9.3-ktnrhkrmbbtlvnagfatrarzjojmkvzsx
# ncurses@6.0%gcc@4.9.3=linux-x86_64
module load ncurses-6.0-gcc-4.9.3-kaazyneh3bjkfnalunchyqtygoe2mncv
# zlib@1.2.8%gcc@4.9.3=linux-x86_64
module load zlib-1.2.8-gcc-4.9.3-v3ufwaahjnviyvgjcelo36nywx2ufj7z
# sqlite@3.8.5%gcc@4.9.3=linux-x86_64
module load sqlite-3.8.5-gcc-4.9.3-a3eediswgd5f3rmto7g3szoew5nhehbr
# readline@6.3%gcc@4.9.3=linux-x86_64
module load readline-6.3-gcc-4.9.3-se6r3lsycrwxyhreg4lqirp6xixxejh3
# python@3.5.1%gcc@4.9.3=linux-x86_64
module load python-3.5.1-gcc-4.9.3-5q5rsrtjld4u6jiicuvtnx52m7tfhegi
# py-setuptools@20.5%gcc@4.9.3=linux-x86_64
module load py-setuptools-20.5-gcc-4.9.3-4qr2suj6p6glepnedmwhl4f62x64wxw2
# py-nose@1.3.7%gcc@4.9.3=linux-x86_64
module load py-nose-1.3.7-gcc-4.9.3-pwhtjw2dvdvfzjwuuztkzr7b4l6zepli
# openblas@0.2.17%gcc@4.9.3+shared=linux-x86_64
module load openblas-0.2.17-gcc-4.9.3-pw6rmlom7apfsnjtzfttyayzc7nx5e7y
# py-numpy@1.11.0%gcc@4.9.3+blas+lapack=linux-x86_64
module load py-numpy-1.11.0-gcc-4.9.3-mulodttw5pcyjufva4htsktwty4qd52r
# curl@7.47.1%gcc@4.9.3=linux-x86_64
module load curl-7.47.1-gcc-4.9.3-ohz3fwsepm3b462p5lnaquv7op7naqbi
# autoconf@2.69%gcc@4.9.3=linux-x86_64
module load autoconf-2.69-gcc-4.9.3-bkibjqhgqm5e3o423ogfv2y3o6h2uoq4
# cmake@3.5.0%gcc@4.9.3~doc+ncurses+openssl~qt=linux-x86_64
module load cmake-3.5.0-gcc-4.9.3-x7xnsklmgwla3ubfgzppamtbqk5rwn7t
# expat@2.1.0%gcc@4.9.3=linux-x86_64
module load expat-2.1.0-gcc-4.9.3-6pkz2ucnk2e62imwakejjvbv6egncppd
# git@2.8.0-rc2%gcc@4.9.3+curl+expat=linux-x86_64
module load git-2.8.0-rc2-gcc-4.9.3-3bib4hqtnv5xjjoq5ugt3inblt4xrgkd
The script may be further edited by removing unnecessary modules.
This script may be directly executed in bash via
.. code-block :: sh
source <( spack module loads --dependencies py-numpy git )
Module Prefixes
````````````````
On some systems, modules are automatically prefixed with a certain
string; ``spack module loads`` needs to know about that prefix when it
issues ``module load`` commands. Add the ``--prefix`` option to your
``spack module loads`` commands if this is necessary.
For example, consider the following on one system:
..code-block:: sh
$ module avail
linux-SuSE11-x86_64/antlr-2.7.7-gcc-5.3.0-bdpl46y
$ spack module loads antlr # WRONG!
# antlr@2.7.7%gcc@5.3.0~csharp+cxx~java~python arch=linux-SuSE11-x86_64
module load antlr-2.7.7-gcc-5.3.0-bdpl46y
$ spack module loads --prefix linux-SuSE11-x86_64/ antlr
# antlr@2.7.7%gcc@5.3.0~csharp+cxx~java~python arch=linux-SuSE11-x86_64
module load linux-SuSE11-x86_64/antlr-2.7.7-gcc-5.3.0-bdpl46y
Regenerating Module files
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Module and dotkit files are generated when packages are installed, and
are placed in the directory ``share/spack/modules`` under the Spack
root. The command ``spack refresh`` will regenerate them all without
re-building the packages; for example, if module format or options
have changed.
Configuration files
^^^^^^^^^^^^^^^^^^^
@@ -1245,6 +1351,10 @@ regenerate all module and dotkit files from scratch:
.. _extensions:
Extensions & Python support
------------------------------------
@@ -1263,7 +1373,7 @@ an *extension*. Suppose you have Python installed like so:
$ spack find python
==> 1 installed packages.
-- chaos_5_x86_64_ib / gcc@4.4.7 --------------------------------
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
python@2.7.8
.. _spack-extensions:
@@ -1276,7 +1386,7 @@ You can find extensions for your Python installation like this:
.. code-block:: sh
$ spack extensions python
==> python@2.7.8%gcc@4.4.7=chaos_5_x86_64_ib-703c7a96
==> python@2.7.8%gcc@4.4.7 arch=linux-debian7-x86_64-703c7a96
==> 36 extensions:
geos py-ipython py-pexpect py-pyside py-sip
py-basemap py-libxml2 py-pil py-pytz py-six
@@ -1288,7 +1398,7 @@ You can find extensions for your Python installation like this:
py-h5py py-numpy py-pyqt py-shiboken
==> 12 installed:
-- chaos_5_x86_64_ib / gcc@4.4.7 --------------------------------
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
py-dateutil@2.4.0 py-nose@1.3.4 py-pyside@1.2.2
py-dateutil@2.4.0 py-numpy@1.9.1 py-pytz@2014.10
py-ipython@2.3.1 py-pygments@2.0.1 py-setuptools@11.3.1
@@ -1304,8 +1414,8 @@ prefixes, and you can see this with ``spack find -p``:
$ spack find -p py-numpy
==> 1 installed packages.
-- chaos_5_x86_64_ib / gcc@4.4.7 --------------------------------
py-numpy@1.9.1 /g/g21/gamblin2/src/spack/opt/chaos_5_x86_64_ib/gcc@4.4.7/py-numpy@1.9.1-66733244
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
py-numpy@1.9.1 /g/g21/gamblin2/src/spack/opt/linux-debian7-x86_64/gcc@4.4.7/py-numpy@1.9.1-66733244
However, even though this package is installed, you cannot use it
directly when you run ``python``:
@@ -1366,9 +1476,9 @@ installation:
.. code-block:: sh
$ spack activate py-numpy
==> Activated extension py-setuptools@11.3.1%gcc@4.4.7=chaos_5_x86_64_ib-3c74eb69 for python@2.7.8%gcc@4.4.7.
==> Activated extension py-nose@1.3.4%gcc@4.4.7=chaos_5_x86_64_ib-5f70f816 for python@2.7.8%gcc@4.4.7.
==> Activated extension py-numpy@1.9.1%gcc@4.4.7=chaos_5_x86_64_ib-66733244 for python@2.7.8%gcc@4.4.7.
==> Activated extension py-setuptools@11.3.1%gcc@4.4.7 arch=linux-debian7-x86_64-3c74eb69 for python@2.7.8%gcc@4.4.7.
==> Activated extension py-nose@1.3.4%gcc@4.4.7 arch=linux-debian7-x86_64-5f70f816 for python@2.7.8%gcc@4.4.7.
==> Activated extension py-numpy@1.9.1%gcc@4.4.7 arch=linux-debian7-x86_64-66733244 for python@2.7.8%gcc@4.4.7.
Several things have happened here. The user requested that
``py-numpy`` be activated in the ``python`` installation it was built
@@ -1383,7 +1493,7 @@ packages listed as activated:
.. code-block:: sh
$ spack extensions python
==> python@2.7.8%gcc@4.4.7=chaos_5_x86_64_ib-703c7a96
==> python@2.7.8%gcc@4.4.7 arch=linux-debian7-x86_64-703c7a96
==> 36 extensions:
geos py-ipython py-pexpect py-pyside py-sip
py-basemap py-libxml2 py-pil py-pytz py-six
@@ -1395,14 +1505,14 @@ packages listed as activated:
py-h5py py-numpy py-pyqt py-shiboken
==> 12 installed:
-- chaos_5_x86_64_ib / gcc@4.4.7 --------------------------------
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
py-dateutil@2.4.0 py-nose@1.3.4 py-pyside@1.2.2
py-dateutil@2.4.0 py-numpy@1.9.1 py-pytz@2014.10
py-ipython@2.3.1 py-pygments@2.0.1 py-setuptools@11.3.1
py-matplotlib@1.4.2 py-pyparsing@2.0.3 py-six@1.9.0
==> 3 currently activated:
-- chaos_5_x86_64_ib / gcc@4.4.7 --------------------------------
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
py-nose@1.3.4 py-numpy@1.9.1 py-setuptools@11.3.1
@@ -1431,7 +1541,7 @@ dependencies, you can use ``spack activate -f``:
.. code-block:: sh
$ spack activate -f py-numpy
==> Activated extension py-numpy@1.9.1%gcc@4.4.7=chaos_5_x86_64_ib-66733244 for python@2.7.8%gcc@4.4.7.
==> Activated extension py-numpy@1.9.1%gcc@4.4.7 arch=linux-debian7-x86_64-66733244 for python@2.7.8%gcc@4.4.7.
.. _spack-deactivate:
@@ -1463,7 +1573,7 @@ Spack currently needs to be run from a filesystem that supports
``flock`` locking semantics. Nearly all local filesystems and recent
versions of NFS support this, but parallel filesystems may be mounted
without ``flock`` support enabled. You can determine how your
filesystems are mounted with ``mount -p``. The output for a Lustre
filesystems are mounted with ``mount -p``. The output for a Lustre
filesystem might look like this:
.. code-block:: sh
@@ -1484,7 +1594,7 @@ This issue typically manifests with the error below:
Traceback (most recent call last):
File "./spack", line 176, in <module>
main()
File "./spack", line 154, in main
File "./spack", line 154,' in main
return_val = command(parser, args)
File "./spack/lib/spack/spack/cmd/find.py", line 170, in find
specs = set(spack.installed_db.query(**q_args))
@@ -1502,6 +1612,10 @@ This issue typically manifests with the error below:
A nicer error message is TBD in future versions of Spack.
.. _spack-cray:
Getting Help
-----------------------

View File

@@ -0,0 +1,167 @@
Using Spack for CMake-based Development
==========================================
These are instructions on how to use Spack to aid in the development
of a CMake-based project. Spack is used to help find the dependencies
for the project, configure it at development time, and then package it
it in a way that others can install. Using Spack for CMake-based
development consists of three parts:
1. Setting up the CMake build in your software
2. Writing the Spack Package
3. Using it from Spack.
Setting Up the CMake Build
---------------------------------------
You should follow standard CMake conventions in setting up your
software, your CMake build should NOT depend on or require Spack to
build. See here for an example:
https://github.com/citibeth/icebin
Note that there's one exception here to the rule I mentioned above.
In ``CMakeLists.txt``, I have the following line::
include_directories($ENV{CMAKE_TRANSITIVE_INCLUDE_PATH})
This is a hook into Spack, and it ensures that all transitive
dependencies are included in the include path. It's not needed if
everything is in one tree, but it is (sometimes) in the Spack world;
when running without Spack, it has no effect.
Note that this "feature" is controversial, could break with future
versions of GNU ld, and probably not the best to use. The best
practice is that you make sure that anything you #include is listed as
a dependency in your CMakeLists.txt.
To be more specific: if you #inlcude something from package A and an
installed HEADER FILE in A #includes something from package B, then
you should also list B as a dependency in your CMake build. If you
depend on A but header files exported by A do NOT #include things from
B, then you do NOT need to list B as a dependency --- even if linking
to A links in libB.so as well.
I also recommend that you set up your CMake build to use RPATHs
correctly. Not only is this a good idea and nice, but it also ensures
that your package will build the same with or without ``spack
install``.
Writing the Spack Package
---------------------------------------
Now that you have a CMake build, you want to tell Spack how to
configure it. This is done by writing a Spack package for your
software. See here for example:
https://github.com/citibeth/spack/blob/efischer/develop/var/spack/repos/builtin/packages/icebin/package.py
You need to subclass ``CMakePackage``, as is done in this example.
This enables advanced features of Spack for helping you in configuring
your software (keep reading...). Instead of an ``install()`` method
used when subclassing ``Package``, you write ``configure_args()``.
See here for more info on how this works:
https://github.com/LLNL/spack/pull/543/files
NOTE: if your software is not publicly available, you do not need to
set the URL or version. Or you can set up bogus URLs and
versions... whatever causes Spack to not crash.
Using it from Spack
--------------------------------
Now that you have a Spack package, you can get Spack to setup your
CMake project for you. Use the following to setup, configure and
build your project::
cd myproject
spack spconfig myproject@local
mkdir build; cd build
../spconfig.py ..
make
make install
Everything here should look pretty familiar here from a CMake
perspective, except that ``spack spconfig`` creates the file
``spconfig.py``, which calls CMake with arguments appropriate for your
Spack configuration. Think of it as the equivalent to running a bunch
of ``spack location -i`` commands. You will run ``spconfig.py``
instead of running CMake directly.
If your project is publicly available (eg on GitHub), then you can
ALSO use this setup to "just install" a release version without going
through the manual configuration/build step. Just do:
1. Put tag(s) on the version(s) in your GitHub repo you want to be release versions.
2. Set the ``url`` in your ``package.py`` to download a tarball for
the appropriate version. (GitHub will give you a tarball for any
version in the repo, if you tickle it the right way). For example::
https://github.com/citibeth/icebin/tarball/v0.1.0
Set up versions as appropriate in your ``package.py``. (Manually
download the tarball and run ``md5sum`` to determine the
appropriate checksum for it).
3. Now you should be able to say ``spack install myproject@version``
and things "just work."
NOTE... in order to use the features outlined in this post, you
currently need to use the following branch of Spack:
https://github.com/citibeth/spack/tree/efischer/develop
There is a pull request open on this branch (
https://github.com/LLNL/spack/pull/543 ) and we are working to get it
integrated into the main ``develop`` branch.
Activating your Software
-------------------------------------
Once you've built your software, you will want to load it up. You can
use ``spack load mypackage@local`` for that in your ``.bashrc``, but
that is slow. Try stuff like the following instead:
The following command will load the Spack-installed packages needed
for basic Python use of IceBin::
module load `spack module find tcl icebin netcdf cmake@3.5.1`
module load `spack module find --dependencies tcl py-basemap py-giss`
You can speed up shell startup by turning these into ``module load`` commands.
1. Cut-n-paste the script ``make_spackenv``::
#!/bin/sh
#
# Generate commands to load the Spack environment
SPACKENV=$HOME/spackenv.sh
spack module find --shell tcl git icebin@local ibmisc netcdf cmake@3.5.1 >$SPACKENV
spack module find --dependencies --shell tcl py-basemap py-giss >>$SPACKENV
2. Add the following to your ``.bashrc`` file::
source $HOME/spackenv.sh
# Preferentially use your checked-out Python source
export PYTHONPATH=$HOME/icebin/pylib:$PYTHONPATH
3. Run ``sh make_spackenv`` whenever your Spack installation changes (including right now).
Giving Back
-------------------
If your software is publicly available, you should submit the
``package.py`` for it as a pull request to the main Spack GitHub
project. This will ensure that anyone can install your software
(almost) painlessly with a simple ``spack install`` command. See here
for how that has turned into detailed instructions that have
successfully enabled collaborators to install complex software:
https://github.com/citibeth/icebin/blob/develop/README.rst

View File

@@ -51,7 +51,8 @@
os.environ['PATH'] += os.pathsep + '$SPACK_ROOT/bin'
spack_version = subprocess.Popen(
['spack', '-V'], stderr=subprocess.PIPE).communicate()[1].strip().split('.')
[spack_root + '/bin/spack', '-V'],
stderr=subprocess.PIPE).communicate()[1].strip().split('.')
# Set an environment variable so that colify will print output like it would to
# a terminal.

View File

@@ -1,6 +1,6 @@
.. _site-configuration:
.. _configuration:
Site configuration
Configuration
===================================
.. _temp-space:
@@ -53,9 +53,10 @@ in the first directory it finds to which it has write access. Add
more elements to the list to indicate where your own site's temporary
directory is.
.. _sec-external_packages:
External Packages
~~~~~~~~~~~~~~~~~~~~~
----------------------------
Spack can be configured to use externally-installed
packages rather than building its own packages. This may be desirable
if machines ship with system packages, such as a customized MPI
@@ -70,20 +71,20 @@ directory. Here's an example of an external configuration:
packages:
openmpi:
paths:
openmpi@1.4.3%gcc@4.4.7=chaos_5_x86_64_ib: /opt/openmpi-1.4.3
openmpi@1.4.3%gcc@4.4.7=chaos_5_x86_64_ib+debug: /opt/openmpi-1.4.3-debug
openmpi@1.6.5%intel@10.1=chaos_5_x86_64_ib: /opt/openmpi-1.6.5-intel
openmpi@1.4.3%gcc@4.4.7 arch=linux-x86_64-debian7: /opt/openmpi-1.4.3
openmpi@1.4.3%gcc@4.4.7 arch=linux-x86_64-debian7+debug: /opt/openmpi-1.4.3-debug
openmpi@1.6.5%intel@10.1 arch=linux-x86_64-debian7: /opt/openmpi-1.6.5-intel
This example lists three installations of OpenMPI, one built with gcc,
one built with gcc and debug information, and another built with Intel.
If Spack is asked to build a package that uses one of these MPIs as a
dependency, it will use the the pre-installed OpenMPI in
the given directory.
the given directory. Packages.yaml can also be used to specify modules
Each ``packages.yaml`` begins with a ``packages:`` token, followed
by a list of package names. To specify externals, add a ``paths``
by a list of package names. To specify externals, add a ``paths`` or ``modules``
token under the package name, which lists externals in a
``spec : /path`` format. Each spec should be as
``spec: /path`` or ``spec: module-name`` format. Each spec should be as
well-defined as reasonably possible. If a
package lacks a spec component, such as missing a compiler or
package version, then Spack will guess the missing component based
@@ -108,9 +109,9 @@ be:
packages:
openmpi:
paths:
openmpi@1.4.3%gcc@4.4.7=chaos_5_x86_64_ib: /opt/openmpi-1.4.3
openmpi@1.4.3%gcc@4.4.7=chaos_5_x86_64_ib+debug: /opt/openmpi-1.4.3-debug
openmpi@1.6.5%intel@10.1=chaos_5_x86_64_ib: /opt/openmpi-1.6.5-intel
openmpi@1.4.3%gcc@4.4.7 arch=linux-x86_64-debian7: /opt/openmpi-1.4.3
openmpi@1.4.3%gcc@4.4.7 arch=linux-x86_64-debian7+debug: /opt/openmpi-1.4.3-debug
openmpi@1.6.5%intel@10.1 arch=linux-x86_64-debian7: /opt/openmpi-1.6.5-intel
buildable: False
The addition of the ``buildable`` flag tells Spack that it should never build
@@ -118,13 +119,75 @@ its own version of OpenMPI, and it will instead always rely on a pre-built
OpenMPI. Similar to ``paths``, ``buildable`` is specified as a property under
a package name.
The ``buildable`` does not need to be paired with external packages.
It could also be used alone to forbid packages that may be
If an external module is specified as not buildable, then Spack will load the
external module into the build environment which can be used for linking.
The ``buildable`` does not need to be paired with external packages.
It could also be used alone to forbid packages that may be
buggy or otherwise undesirable.
Concretization Preferences
--------------------------------
Spack can be configured to prefer certain compilers, package
versions, depends_on, and variants during concretization.
The preferred configuration can be controlled via the
``~/.spack/packages.yaml`` file for user configuations, or the
``etc/spack/packages.yaml`` site configuration.
Here's an example packages.yaml file that sets preferred packages:
.. code-block:: sh
packages:
opencv:
compiler: [gcc@4.9]
variants: +debug
gperftools:
version: [2.2, 2.4, 2.3]
all:
compiler: [gcc@4.4.7, gcc@4.6:, intel, clang, pgi]
providers:
mpi: [mvapich, mpich, openmpi]
At a high level, this example is specifying how packages should be
concretized. The opencv package should prefer using gcc 4.9 and
be built with debug options. The gperftools package should prefer version
2.2 over 2.4. Every package on the system should prefer mvapich for
its MPI and gcc 4.4.7 (except for opencv, which overrides this by preferring gcc 4.9).
These options are used to fill in implicit defaults. Any of them can be overwritten
on the command line if explicitly requested.
Each packages.yaml file begins with the string ``packages:`` and
package names are specified on the next level. The special string ``all``
applies settings to each package. Underneath each package name is
one or more components: ``compiler``, ``variants``, ``version``,
or ``providers``. Each component has an ordered list of spec
``constraints``, with earlier entries in the list being preferred over
later entries.
Sometimes a package installation may have constraints that forbid
the first concretization rule, in which case Spack will use the first
legal concretization rule. Going back to the example, if a user
requests gperftools 2.3 or later, then Spack will install version 2.4
as the 2.4 version of gperftools is preferred over 2.3.
An explicit concretization rule in the preferred section will always
take preference over unlisted concretizations. In the above example,
xlc isn't listed in the compiler list. Every listed compiler from
gcc to pgi will thus be preferred over the xlc compiler.
The syntax for the ``provider`` section differs slightly from other
concretization rules. A provider lists a value that packages may
``depend_on`` (e.g, mpi) and a list of rules for fulfilling that
dependency.
Profiling
~~~~~~~~~~~~~~~~~~~~~
------------------
Spack has some limited built-in support for profiling, and can report
statistics using standard Python timing tools. To use this feature,
@@ -133,7 +196,7 @@ supply ``-p`` to Spack on the command line, before any subcommands.
.. _spack-p:
``spack -p``
^^^^^^^^^^^^^^^^^^
~~~~~~~~~~~~~~~~~
``spack -p`` output looks like this:

View File

@@ -80,10 +80,11 @@ with a high level view of Spack's directory structure::
var/
spack/ <- build & stage directories
repos/ <- contains package repositories
builtin/ <- pkg repository that comes with Spack
repo.yaml <- descriptor for the builtin repository
packages/ <- directories under here contain packages
repos/ <- contains package repositories
builtin/ <- pkg repository that comes with Spack
repo.yaml <- descriptor for the builtin repository
packages/ <- directories under here contain packages
cache/ <- saves resources downloaded during installs
opt/
spack/ <- packages are installed here

View File

@@ -31,14 +31,21 @@ platform, all on the command line.
# Specify a compiler (and its version), with %
$ spack install mpileaks@1.1.2 %gcc@4.7.3
# Add special compile-time options with +
# Add special compile-time options by name
$ spack install mpileaks@1.1.2 %gcc@4.7.3 debug=True
# Add special boolean compile-time options with +
$ spack install mpileaks@1.1.2 %gcc@4.7.3 +debug
# Cross-compile for a different architecture with =
$ spack install mpileaks@1.1.2 =bgqos_0
# Add compiler flags using the conventional names
$ spack install mpileaks@1.1.2 %gcc@4.7.3 cppflags=\"-O3 -floop-block\"
Users can specify as many or few options as they care about. Spack
will fill in the unspecified values with sensible defaults.
# Cross-compile for a different architecture with arch=
$ spack install mpileaks@1.1.2 arch=bgqos_0
Users can specify as many or few options as they care about. Spack
will fill in the unspecified values with sensible defaults. The two listed
syntaxes for variants are identical when the value is boolean.
Customize dependencies

View File

@@ -1,7 +1,21 @@
Getting Started
====================
Download
Prerequisites
---------------
Spack has the following minimum requirements, which must be installed
before Spack is run:
1. Operating System: GNU/Linux or Macintosh
2. Python 2.6 or 2.7
3. A C/C++ compiler
These requirements can be easily installed on most modern Linux
systems; on Macintosh, XCode is required.
Installation
--------------------
Getting spack is easy. You can clone it from the `github repository
@@ -11,10 +25,16 @@ Getting spack is easy. You can clone it from the `github repository
$ git clone https://github.com/llnl/spack.git
This will create a directory called ``spack``. We'll assume that the
full path to this directory is in the ``SPACK_ROOT`` environment
variable. Add ``$SPACK_ROOT/bin`` to your path and you're ready to
go:
This will create a directory called ``spack``. If you are using Spack
for a specific purpose, you might have received different instructions
on how to download Spack; if so, please follow those instructions.
Add Spack to Shell
~~~~~~~~~~~~~~~~~~~
We'll assume that the full path to your downloaded Spack directory is
in the ``SPACK_ROOT`` environment variable. Add ``$SPACK_ROOT/bin``
to your path and you're ready to go:
.. code-block:: sh
@@ -35,11 +55,44 @@ For a richer experience, use Spack's `shell support
This automatically adds Spack to your ``PATH``.
Installation
--------------------
Clean Environment
~~~~~~~~~~~~~~~~~~
You don't need to install Spack; it's ready to run as soon as you
clone it from git.
Many packages' installs can be broken by changing environment
variables. For example, a packge might pick up the wrong build-time
dependencies (most of them not specified) depending on the setting of
``PATH``. ``GCC`` seems to be particularly vulnerable to these issues.
Therefore, it is recommended that Spack users run with a *clean
environment*, especially for ``PATH``. Only software that comes with
the system, or that you know you wish to use with Spack, should be
included. This procedure will avoid many strange build errors that no
one knows how to fix.
Although Spack will work as soon as you clone it, it won't necessarily
be able to install any packages. That is because Spack relies
Check Installation
~~~~~~~~~~~~~~~~~~~~~
With Spack installed, you should be able to run some basic Spack commands. For example:
.. code-block:: sh
$ spack spec netcdf
...
netcdf@4.4.1%gcc@5.3.0~hdf4+mpi arch=linux-SuSE11-x86_64
^curl@7.50.1%gcc@5.3.0 arch=linux-SuSE11-x86_64
^openssl@system%gcc@5.3.0 arch=linux-SuSE11-x86_64
^zlib@1.2.8%gcc@5.3.0 arch=linux-SuSE11-x86_64
^hdf5@1.10.0-patch1%gcc@5.3.0+cxx~debug+fortran+mpi+shared~szip~threadsafe arch=linux-SuSE11-x86_64
^openmpi@1.10.1%gcc@5.3.0~mxm~pmi~psm~psm2~slurm~sqlite3~thread_multiple~tm+verbs+vt arch=linux-SuSE11-x86_64
^m4@1.4.17%gcc@5.3.0+sigsegv arch=linux-SuSE11-x86_64
^libsigsegv@2.10%gcc@5.3.0 arch=linux-SuSE11-x86_64
Optional: Alternate Prefix
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You may want to run it out of a prefix other than the git repository
you cloned. The ``spack bootstrap`` command provides this
@@ -53,3 +106,671 @@ This will install a new spack script in ``/my/favorite/prefix/bin``,
which you can use just like you would the regular spack script. Each
copy of spack installs packages into its own ``$PREFIX/opt``
directory.
.. _compiler-config:
Compiler configuration
-----------------------------------
Spack has the ability to build packages with multiple compilers and
compiler versions. Spack searches for compilers on your machine
automatically the first time it is run. It does this by inspecting
your path.
.. _spack-compilers:
``spack compilers``
~~~~~~~~~~~~~~~~~~~~~~~
You can see which compilers spack has found by running ``spack
compilers`` or ``spack compiler list``::
$ spack compilers
==> Available compilers
-- gcc ---------------------------------------------------------
gcc@4.9.0 gcc@4.8.0 gcc@4.7.0 gcc@4.6.2 gcc@4.4.7
gcc@4.8.2 gcc@4.7.1 gcc@4.6.3 gcc@4.6.1 gcc@4.1.2
-- intel -------------------------------------------------------
intel@15.0.0 intel@14.0.0 intel@13.0.0 intel@12.1.0 intel@10.0
intel@14.0.3 intel@13.1.1 intel@12.1.5 intel@12.0.4 intel@9.1
intel@14.0.2 intel@13.1.0 intel@12.1.3 intel@11.1
intel@14.0.1 intel@13.0.1 intel@12.1.2 intel@10.1
-- clang -------------------------------------------------------
clang@3.4 clang@3.3 clang@3.2 clang@3.1
-- pgi ---------------------------------------------------------
pgi@14.3-0 pgi@13.2-0 pgi@12.1-0 pgi@10.9-0 pgi@8.0-1
pgi@13.10-0 pgi@13.1-1 pgi@11.10-0 pgi@10.2-0 pgi@7.1-3
pgi@13.6-0 pgi@12.8-0 pgi@11.1-0 pgi@9.0-4 pgi@7.0-6
Any of these compilers can be used to build Spack packages. More on
how this is done is in :ref:`sec-specs`.
.. _spack-compiler-add:
``spack compiler add``
~~~~~~~~~~~~~~~~~~~~~~~
An alias for ``spack compiler find``.
.. _spack-compiler-find:
``spack compiler find``
~~~~~~~~~~~~~~~~~~~~~~~
If you do not see a compiler in this list, but you want to use it with
Spack, you can simply run ``spack compiler find`` with the path to
where the compiler is installed. For example::
$ spack compiler find /usr/local/tools/ic-13.0.079
==> Added 1 new compiler to /Users/gamblin2/.spack/compilers.yaml
intel@13.0.079
Or you can run ``spack compiler find`` with no arguments to force
auto-detection. This is useful if you do not know where compilers are
installed, but you know that new compilers have been added to your
``PATH``. For example, using dotkit, you might do this::
$ module load gcc-4.9.0
$ spack compiler find
==> Added 1 new compiler to /Users/gamblin2/.spack/compilers.yaml
gcc@4.9.0
This loads the environment module for gcc-4.9.0 to add it to
``PATH``, and then it adds the compiler to Spack.
.. _spack-compiler-info:
``spack compiler info``
~~~~~~~~~~~~~~~~~~~~~~~
If you want to see specifics on a particular compiler, you can run
``spack compiler info`` on it::
$ spack compiler info intel@15
intel@15.0.0:
cc = /usr/local/bin/icc-15.0.090
cxx = /usr/local/bin/icpc-15.0.090
f77 = /usr/local/bin/ifort-15.0.090
fc = /usr/local/bin/ifort-15.0.090
This shows which C, C++, and Fortran compilers were detected by Spack.
Notice also that we didn\'t have to be too specific about the
version. We just said ``intel@15``, and information about the only
matching Intel compiler was displayed.
Manual Compiler Configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If auto-detection fails, you can manually configure a compiler by
editing your ``~/.spack/compilers.yaml`` file. You can do this by running
``spack config edit compilers``, which will open the file in your ``$EDITOR``.
Each compiler configuration in the file looks like this::
...
compilers:
- compiler:
modules = []
operating_system: OS
paths:
cc: /usr/local/bin/icc-15.0.024-beta
cxx: /usr/local/bin/icpc-15.0.024-beta
f77: /usr/local/bin/ifort-15.0.024-beta
fc: /usr/local/bin/ifort-15.0.024-beta
spec: intel@15.0.0:
For compilers, like ``clang``, that do not support Fortran, put
``None`` for ``f77`` and ``fc``::
clang@3.3svn:
cc: /usr/bin/clang
cxx: /usr/bin/clang++
f77: None
fc: None
Once you save the file, the configured compilers will show up in the
list displayed by ``spack compilers``.
You can also add compiler flags to manually configured compilers. The
valid flags are ``cflags``, ``cxxflags``, ``fflags``, ``cppflags``,
``ldflags``, and ``ldlibs``. For example::
...
compilers:
- compiler:
...
intel@15.0.0:
cc: /usr/local/bin/icc-15.0.024-beta
cxx: /usr/local/bin/icpc-15.0.024-beta
f77: /usr/local/bin/ifort-15.0.024-beta
fc: /usr/local/bin/ifort-15.0.024-beta
cppflags: -O3 -fPIC
...
These flags will be treated by spack as if they were enterred from
the command line each time this compiler is used. The compiler wrappers
then inject those flags into the compiler command. Compiler flags
enterred from the command line will be discussed in more detail in the
following section.
Build Your Own Compiler
~~~~~~~~~~~~~~~~~~~~~~~~~
If you are particular about which compiler/version you use, you might
wish to have Spack build it for you. For example:
.. code-block::
spack install gcc@4.9.3
Once that has finished, you will need to add it to your
``compilers.yaml`` file. If this is your preferred compiler, in
general future Spack builds will use it.
.. note::
If you are building your own compiler, it can be useful to have a
Spack instance just for that. For example, create a new Spack in
``~/spack-tools`` and then run ``~/spack-tools/bin/spack install
gcc@4.9.3``. Once the compiler is built, don't build anything
more in that Spack instance; instead, create a new "real" Spack
instance, configure Spack to use the compiler you've just built,
and then build your application software in the new Spack
instance.
This tip is useful because sometimes you will find yourself
rebuilding may pacakges due to Spack updates. Sometimes, you
might even delete your entire Spack installation and start fresh.
If your compiler was built in a separate Spack installation, you
will never have to rebuild it --- as long as you wish to continue
using that version of the compiler.
Compilers Requiring Modules
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Many installed compilers will work regardless of the environment they
are called with. However, some installed compilers require
``$LD_LIBRARY_PATH`` or other environment variables to be set in order
to run; Intel compilers are known for this. In such a case, you
should tell Spack which module(s) to load in order to run the chosen
compiler. Spack will load this module into the environment ONLY when
the compiler is run, and NOT in general for a package's ``install()``
method. See, for example, this ``compilers.yaml`` file:
.. code-block:: yaml
compilers:
- compiler:
modules: [other/comp/gcc-5.3-sp3]
operating_system: SuSE11
paths:
cc: /usr/local/other/SLES11.3/gcc/5.3.0/bin/gcc
cxx: /usr/local/other/SLES11.3/gcc/5.3.0/bin/g++
f77: /usr/local/other/SLES11.3/gcc/5.3.0/bin/gfortran
fc: /usr/local/other/SLES11.3/gcc/5.3.0/bin/gfortran
spec: gcc@5.3.0
Some compilers require a module to be loaded not just to run, but also
to execute any code built with the compiler, breaking packages that
execute any bits of code they just compiled. Such compilers should be
taken behind the barn and put out of their misery. If that is not
possible or practical, the user (and anyone running code built by that
compiler) will need to load the compiler's module into their
environment. And ``spack install --dirty`` will need to be used.
Compiler Verification
~~~~~~~~~~~~~~~~~~~~~~
You can verify that your compilers are configured properly by installing a
simple package. For example:
.. code-block:: sh
spack install zlib%gcc@5.3.0
System Packages
-----------------
Once compilers are configured, one needs to determine which
pre-installed system packages, if any, to use in builds. This is
configured in the file `~/.spack/packages.yaml`. For example, to use
an OpenMPI installed in /opt/local, one would use:
.. code-block:: yaml
packages:
openmpi:
paths:
openmpi@1.10.1: /opt/local
buildable: False
In general, Spack is easier to use and more reliable if it builds all
its own dependencies. However, there are two packages for which one
commonly needs to use system versions:
MPI
~~~
On supercomputers, sysadmins have already built MPI versions that take
into account the specifics of that computer's hardware. Unless you
know how they were built and can choose the correct Spack variants,
you are unlikely to get a working MPI from Spack. Instead, use an
appropraite pre-installed MPI.
If you choose a pre-installed MPI, you should consider using the
pre-installed compiler used to build that MPI; see above on
``compilers.yaml``.
OpenSSL
~~~~~~~~
The ``openssl`` package underlies much of modern security in a modern
OS; an attacker can easily "pwn" any computer on which can modify SSL.
Therefore, any `openssl` used on a system should be created in a
"trusted environment" --- for example, that of the OS vendor.
OpenSSL is also updated by the OS vendor from time to time, in
response to security problems discovered in the wider community. It
is in everyone's best interest to use any newly updated versions as
soon as they come out. Modern Linux installations have standard
procedures for security updates without user involvement.
Spack running at user-level is not a trusted environment, nor do Spack
users generally keep up-to-date on the latest security holes in SSL.
For these reasons, any Spack-installed OpenSSL should be considered
untrusted.
As long as the system-provided SSL works, it is better to use it. One can check if it works by trying to download an ``https://``. For example:
.. code-block:: sh
curl -O https://github.com/ImageMagick/ImageMagick/archive/7.0.2-7.tar.gz
As long as it works, the recommended way to tell Spack to use the
system-supplied OpenSSL is to add the following to ``packages.yaml``.
Note that the ``@system`` "version" means "I don't care what version
it is, just use what is there." This is appropraite for OpenSSL,
which has a stable API.
.. code-block:: yaml
packages:
# Recommended for security reasons
# Do not install OpenSSL as non-root user.
openssl:
paths:
openssl@system: /usr
version: [system]
buildable: False
Utilities Configuration
-------------------------
Although Spack does not need installation *per se*, it does rely on
other packages to be available on its host system. If those packages
are out of date or missing, then Spack will not work. Sometimes, an
appeal to the system's package manager can fix such problems. If not,
the solution is have Spack install the required packages, and then
have Spack use them.
For example, if `curl` doesn't work, one could use the following steps
to provide Spack a working `curl`:
.. code-block:: sh
$ spack install curl
$ spack load curl
or alternately:
.. code-block:: sh
$ spack module loads curl >>~/.bashrc
or if environment modules don't work:
.. code-block:: sh
$ export PATH=`spack location -i curl`/bin:$PATH
External commands are used by Spack in two places: within core Spack,
and in the package recipes. The bootstrapping procedure for these two
cases is somewhat different, and is treated separately below.
Core Spack Utilities
~~~~~~~~~~~~~~~~~~~~~~~~~
Core Spack uses the following packages, aminly to download and unpack
source code, and to load generated environment modules: ``curl``,
``env``, ``git``, ``go``, ``hg``, ``svn``, ``tar``, ``unzip``,
``patch``, ``environment-modules``.
As long as the user's environment is set up to successfully run these
programs from outside of Spack, they should work inside of Spack as
well. They can generally be activated as in the `curl` example above;
or some systems might already have an appropriate hand-built
environment module that may be loaded. Either way works.
A few notes on specific programs in this list:
cURL, git, Mercurial, etc.
```````````````````````````
Spack depends on cURL to download tarballs, the format that most
Spack-installed packages come in. Your system's cURL should always be
able to download unencrypted ``http://``. However, the cURL on some
systems has problems with SSL-enabled ``https://`` URLs, due to
outdated / insecure versions of OpenSSL on those systems. This will
prevent Spack from installing any software requiring ``https://``
until a new cURL has been installed, using the technique above.
.. note::
``curl`` depends on ``openssl`` and ``zlib``, both of which are
downloadable from non-SSL sources. Unfortunately, this
Spack-built cURL should be considered untrustworthy for
``https://`` sources becuase it relies on an OpenSSL built in user
space. Luckily, Spack verifies checksums of the software it
installs, and does not rely on a secure SSL implementation.
If your version of ``curl`` is not trustworthy, then you should
not use it outside of Spack. Instead of putting it in your
``.bashrc``, you might wish to create a short shell script that
loads the appropariate module(s) and then launches Spack.
Some packages use source code control systems as their download
method: ``git``, ``hg``, ``svn`` and occasionally ``go``. If you had
to install a new ``curl``, then chances are the system-supplied
version of these other programs will also not work, because they also
rely on OpenSSL. Once ``curl`` has been installed, the others should
also be installable.
.. _InstallEnvironmentModules:
Environment Modules
````````````````````
In order to use Spack's generated environment modules, you must have
installed the *Environment Modules* package. On many Linux
distributions, this can be installed from the vendor's repository.
For example: ```yum install environment-modules``
(Fedora/RHEL/CentOS). If your Linux distribution does not have
Environment Modules, you can get it with Spack:
1. Consider using system tcl (as long as your system has Tcl version 8.0 or later):
1. Identify its location using ``which tclsh``
2. Identify its version using ``echo 'puts $tcl_version;exit 0' | tclsh``
3. Add to ``~/.spack/packages.yaml`` and modify as appropriate:
.. code-block:: yaml
packages:
tcl:
paths:
tcl@8.5: /usr
version: [8.5]
buildable: False
2. Install with::
.. code-block:: sh
spack install environment-modules
3. Activate with the following script (or apply the updates to your
``.bashrc`` file manually)::
.. code-block:: sh
TMP=`tempfile`
echo >$TMP
MODULE_HOME=`spack location -i environment-modules`
MODULE_VERSION=`ls -1 $MODULE_HOME/Modules | head -1`
${MODULE_HOME}/Modules/${MODULE_VERSION}/bin/add.modules <$TMP
cp .bashrc $TMP
echo "MODULE_VERSION=${MODULE_VERSION}" > .bashrc
cat $TMP >>.bashrc
This adds to your ``.bashrc`` (or similar) files, enabling Environment
Modules when you log in. Re-load your .bashrc (or log out and in
again), and then test that the ``module`` command is found with:
.. code-block:: sh
module avail
Package Utilities
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Spack can also encounter bootstrapping problems inside a package's
``install()`` method. In this case, Spack will normally be running
inside a *sanitized build environment*. This includes all of the
package's dependencies, but none of the environment Spack inherited
from the user: if you load a module or modify ``$PATH`` before
launching Spack, it will have no effect.
In this case, you will likley need to use the ``--dirty`` flag when
running ``spack install``, causing Spack to **not** santize the build
environment. You are now responsible for making sure that environment
does not do strange things to Spack or its installs.
Another way to get Spack to use its own version of something is to add that something to a package that needs it. For example:
.. code-block:: python
depends_on('binutils', type='build')
This is considered best practice for some common build dependencies,
such as ``autotools`` (if the ``autoreconf`` command is needed) and
``cmake`` --- ``cmake`` especially, because different packages require
a different version of CMake.
However, adding ``depends_on('binutils')`` to every package is not
considered a best practice because every package written in
C/C++/Fortran would need it. Loading a recent ``binutils`` into your
environment is preferable here.
binutils
~~~~~~~~~
# https://groups.google.com/forum/#!topic/spack/i_7l_kEEveI
Sometimes, strange error messages can happen while building a package.
For exmaple, ``ld`` might crash. Or one receives a message like:
.. code-block::
ld: final link failed: Nonrepresentable section on output
These problems are often caused by an outdated ``binutils`` on your
system: bootstrap as described above.
Install Environment Modules
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In order to use Spack's generated environment modules, you must have
installed the *Environment Modules* package. On many Linux
distributions, this can be installed from the vendor's repository.
For example: ```yum install environment-modules``
(Fedora/RHEL/CentOS). If your Linux distribution does not have
Environment Modules, you can get it with Spack:
1. Consider using system tcl. If so, add to ``packages.yaml``::
packages:
tcl:
paths:
tcl@8.5: /usr
version: [8.5]
buildable: False
2. Install with::
spack install environment-modules
3. Activate with::
TMP=`tempfile`
echo >$TMP
MODULE_HOME=`spack location -i environment-modules`
MODULE_VERSION=`ls -1 $MODULE_HOME/Modules | head -1`
${MODULE_HOME}/Modules/${MODULE_VERSION}/bin/add.modules <$TMP
cp .bashrc $TMP
echo "MODULE_VERSION=${MODULE_VERSION}" > .bashrc
cat $TMP >>.bashrc
This adds to your ``.bashrc`` (or similar) files, enabling Environment
Modules when you log in. Re-load your .bashrc (or log out and in
again), and then test that the ``module`` command is found with:
module avail
Spack on Cray
-----------------------------
Spack differs slightly when used on a Cray system. The architecture spec
can differentiate between the front-end and back-end processor and operating system.
For example, on Edison at NERSC, the back-end target processor
is \"Ivy Bridge\", so you can specify to use the back-end this way:
.. code-block:: sh
spack install zlib target=ivybridge
You can also use the operating system to build against the back-end:
.. code-block:: sh
spack install zlib os=CNL10
Notice that the name includes both the operating system name and the major
version number concatenated together.
Alternatively, if you want to build something for the front-end,
you can specify the front-end target processor. The processor for a login node
on Edison is \"Sandy bridge\" so we specify on the command line like so:
.. code-block:: sh
spack install zlib target=sandybridge
And the front-end operating system is:
.. code-block:: sh
spack install zlib os=SuSE11
Cray compiler detection
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Spack can detect compilers using two methods. For the front-end, we treat
everything the same. The difference lies in back-end compiler detection.
Back-end compiler detection is made via the Tcl module avail command.
Once it detects the compiler it writes the appropriate PrgEnv and compiler
module name to compilers.yaml and sets the paths to each compiler with Cray\'s
compiler wrapper names (i.e. cc, CC, ftn). During build time, Spack will load
the correct PrgEnv and compiler module and will call appropriate wrapper.
The compilers.yaml config file will also differ. There is a
modules section that is filled with the compiler\'s Programming Environment
and module name. On other systems, this field is empty []::
...
- compiler:
modules:
- PrgEnv-intel
- intel/15.0.109
...
As mentioned earlier, the compiler paths will look different on a Cray system.
Since most compilers are invoked using cc, CC and ftn, the paths for each
compiler are replaced with their respective Cray compiler wrapper names::
...
paths:
cc: cc
cxx: CC
f77: ftn
fc: ftn
...
As opposed to an explicit path to the compiler executable. This allows Spack
to call the Cray compiler wrappers during build time.
For more on compiler configuration, check out :ref:`compiler-config`.
Spack sets the default Cray link type to dynamic, to better match other
other platforms. Individual packages can enable static linking (which is the
default outside of Spack on cray systems) using the -static flag.
Setting defaults and using Cray modules
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you want to use default compilers for each PrgEnv and also be able
to load cray external modules, you will need to set up a packages.yaml.
Here\'s an example of an external configuration for cray modules:
.. code-block:: yaml
packages:
mpi:
modules:
mpich@7.3.1%gcc@5.2.0 arch=cray_xc-haswell-CNL10: cray-mpich
mpich@7.3.1%intel@16.0.0.109 arch=cray_xc-haswell-CNL10: cray-mpich
This tells Spack that for whatever package that depends on mpi, load the
cray-mpich module into the environment. You can then be able to use whatever
environment variables, libraries, etc, that are brought into the environment
via module load.
You can set the default compiler that Spack can use for each compiler type.
If you want to use the Cray defaults, then set them under *all:* in packages.yaml.
In the compiler field, set the compiler specs in your order of preference.
Whenever you build with that compiler type, Spack will concretize to that version.
Here is an example of a full packages.yaml used at NERSC
.. code-block:: yaml
packages:
mpi:
modules:
mpich@7.3.1%gcc@5.2.0 arch=cray_xc-CNL10-ivybridge: cray-mpich
mpich@7.3.1%intel@16.0.0.109 arch=cray_xc-SuSE11-ivybridge: cray-mpich
buildable: False
netcdf:
modules:
netcdf@4.3.3.1%gcc@5.2.0 arch=cray_xc-CNL10-ivybridge: cray-netcdf
netcdf@4.3.3.1%intel@16.0.0.109 arch=cray_xc-CNL10-ivybridge: cray-netcdf
buildable: False
hdf5:
modules:
hdf5@1.8.14%gcc@5.2.0 arch=cray_xc-CNL10-ivybridge: cray-hdf5
hdf5@1.8.14%intel@16.0.0.109 arch=cray_xc-CNL10-ivybridge: cray-hdf5
buildable: False
all:
compiler: [gcc@5.2.0, intel@16.0.0.109]
Here we tell spack that whenever we want to build with gcc use version 5.2.0 or
if we want to build with intel compilers, use version 16.0.0.109. We add a spec
for each compiler type for each cray modules. This ensures that for each
compiler on our system we can use that external module.
For more on external packages check out the section :ref:`sec-external_packages`.

View File

@@ -46,9 +46,11 @@ Table of Contents
getting_started
basic_usage
packaging_guide
application_developer_support
mirrors
site_configuration
configuration
developer_guide
case_studies
command_index
package_list
API Docs <spack>

View File

@@ -214,3 +214,21 @@ Adding a mirror really adds a line in ``~/.spack/mirrors.yaml``::
If you want to change the order in which mirrors are searched for
packages, you can edit this file and reorder the sections. Spack will
search the topmost mirror first and the bottom-most mirror last.
.. _caching:
Local Default Cache
----------------------------
Spack caches resources that are downloaded as part of installs. The cache is
a valid spack mirror: it uses the same directory structure and naming scheme
as other Spack mirrors (so it can be copied anywhere and referenced with a URL
like other mirrors). The mirror is maintained locally (within the Spack
installation directory) at :file:`var/spack/cache/`. It is always enabled (and
is always searched first when attempting to retrieve files for an installation)
but can be cleared with :ref:`purge <spack-purge>`; the cache directory can also
be deleted manually without issue.
Caching includes retrieved tarball archives and source control repositories, but
only resources with an associated digest or commit ID (e.g. a revision number
for SVN) will be cached.

View File

@@ -36,10 +36,11 @@ Creating & editing packages
``spack create``
~~~~~~~~~~~~~~~~~~~~~
The ``spack create`` command generates a boilerplate package template
from a URL. The URL should point to a tarball or other software
archive. In most cases, ``spack create`` plus a few modifications is
all you need to get a package working.
The ``spack create`` command creates a directory with the package name and
generates a ``package.py`` file with a boilerplate package template from a URL.
The URL should point to a tarball or other software archive. In most cases,
``spack create`` plus a few modifications is all you need to get a package
working.
Here's an example:
@@ -47,12 +48,16 @@ Here's an example:
$ spack create http://www.cmake.org/files/v2.8/cmake-2.8.12.1.tar.gz
Spack examines the tarball URL and tries to figure out the name of the
package to be created. It also tries to determine what version strings
look like for this package. Using this information, it will try to
find *additional* versions by spidering the package's webpage. If it
finds multiple versions, Spack prompts you to tell it how many
versions you want to download and checksum:
Spack examines the tarball URL and tries to figure out the name of the package
to be created. Once the name is determined a directory in the appropriate
repository is created with that name. Spack prefers, but does not require, that
names be lower case so the directory name will be lower case when ``spack
create`` generates it. In cases where it is desired to have mixed case or upper
case simply rename the directory. Spack also tries to determine what version
strings look like for this package. Using this information, it will try to find
*additional* versions by spidering the package's webpage. If it finds multiple
versions, Spack prompts you to tell it how many versions you want to download
and checksum:
.. code-block:: sh
@@ -297,9 +302,10 @@ directories or files (like patches) that it needs to build.
Package Names
~~~~~~~~~~~~~~~~~~
Packages are named after the directory containing ``package.py``. So,
``libelf``'s ``package.py`` lives in a directory called ``libelf``.
The ``package.py`` file defines a class called ``Libelf``, which
Packages are named after the directory containing ``package.py``. It is
preferred, but not required, that the directory, and thus the package name, are
lower case. So, ``libelf``'s ``package.py`` lives in a directory called
``libelf``. The ``package.py`` file defines a class called ``Libelf``, which
extends Spack's ``Package`` class. for example, here is
``$SPACK_ROOT/var/spack/repos/builtin/packages/libelf/package.py``:
@@ -377,6 +383,8 @@ add a line like this in the package class:
version('8.2.1', '4136d7b4c04df68b686570afa26988ac')
...
Versions should be listed with the newest version first.
Version URLs
~~~~~~~~~~~~~~~~~
@@ -385,8 +393,22 @@ in the package. For example, Spack is smart enough to download
version ``8.2.1.`` of the ``Foo`` package above from
``http://example.com/foo-8.2.1.tar.gz``.
If spack *cannot* extrapolate the URL from the ``url`` field, or if
the package doesn't have a ``url`` field, you can add a URL explicitly
If spack *cannot* extrapolate the URL from the ``url`` field by
default, you can write your own URL generation algorithm in place of
the ``url`` declaration. For example:
.. code-block:: python
:linenos:
class Foo(Package):
version('8.2.1', '4136d7b4c04df68b686570afa26988ac')
...
def url_for_version(self, version):
return 'http://example.com/version_%s/foo-%s.tar.gz' \
% (version, version)
...
If a URL cannot be derived systematically, you can add an explicit URL
for a particular version:
.. code-block:: python
@@ -412,7 +434,7 @@ executables and other custom archive types), you can add
.. code-block:: python
version('8.2.1', '4136d7b4c04df68b686570afa26988ac',
url='http://example.com/foo-8.2.1-special-version.tar.gz', 'expand=False')
url='http://example.com/foo-8.2.1-special-version.tar.gz', expand=False)
When ``expand`` is set to ``False``, Spack sets the current working
directory to the directory containing the downloaded archive before it
@@ -446,14 +468,25 @@ to use based on the hash length.
``spack md5``
^^^^^^^^^^^^^^^^^^^^^^
If you have a single file to checksum, you can use the ``spack md5``
command to do it. Here's how you might download an archive and get a
checksum for it:
If you have one or more files to checksum, you can use the ``spack md5``
command to do it:
.. code-block:: sh
$ curl -O http://exmaple.com/foo-8.2.1.tar.gz'
$ spack md5 foo-8.2.1.tar.gz
$ spack md5 foo-8.2.1.tar.gz foo-8.2.2.tar.gz
==> 2 MD5 checksums:
4136d7b4c04df68b686570afa26988ac foo-8.2.1.tar.gz
1586b70a49dfe05da5fcc29ef239dce0 foo-8.2.2.tar.gz
``spack md5`` also accepts one or more URLs and automatically downloads
the files for you:
.. code-block:: sh
$ spack md5 http://example.com/foo-8.2.1.tar.gz
==> Trying to fetch from http://example.com/foo-8.2.1.tar.gz
######################################################################## 100.0%
==> 1 MD5 checksum:
4136d7b4c04df68b686570afa26988ac foo-8.2.1.tar.gz
Doing this for lots of files, or whenever a new package version is
@@ -547,7 +580,7 @@ The package author is responsible for coming up with a sensible name
for each version to be fetched from a repository. For example, if
you're fetching from a tag like ``v1.0``, you might call that ``1.0``.
If you're fetching a nameless git commit or an older subversion
revision, you might give the commit an intuitive name, like ``dev``
revision, you might give the commit an intuitive name, like ``develop``
for a development version, or ``some-fancy-new-feature`` if you want
to be more specific.
@@ -557,6 +590,17 @@ branches move forward over time and you aren't guaranteed to get the
same thing every time you fetch a particular version. Life isn't
always simple, though, so this is not strictly enforced.
When fetching from from the branch corresponding to the development version
(often called ``master``,``trunk`` or ``dev``), it is recommended to
call this version ``develop``. Spack has special treatment for this version so
that ``@develop`` will satisfy dependencies like
``depends_on(abc, when="@x.y.z:")``. In other words, ``@develop`` is
greater than any other version. The rationale is that certain features or
options first appear in the development branch. Therefore if a package author
wants to keep the package on the bleeding edge and provide support for new
features, it is advised to use ``develop`` for such a version which will
greatly simplify writing dependencies and version-related conditionals.
In some future release, Spack may support extrapolating repository
versions as it does for tarball URLs, but currently this is not
supported.
@@ -572,6 +616,7 @@ Git fetching is enabled with the following parameters to ``version``:
* ``tag``: name of a tag to fetch.
* ``branch``: name of a branch to fetch.
* ``commit``: SHA hash (or prefix) of a commit to fetch.
* ``submodules``: Also fetch submodules when checking out this repository.
Only one of ``tag``, ``branch``, or ``commit`` can be used at a time.
@@ -582,7 +627,7 @@ Default branch
class Example(Package):
...
version('dev', git='https://github.com/example-project/example.git')
version('develop', git='https://github.com/example-project/example.git')
This is not recommended, as the contents of the default branch
change over time.
@@ -628,6 +673,17 @@ Commits
could just use the abbreviated commit hash. It's up to the package
author to decide what makes the most sense.
Submodules
You can supply ``submodules=True`` to cause Spack to fetch submodules
along with the repository at fetch time.
.. code-block:: python
version('1.0.1', git='https://github.com/example-project/example.git',
tag='v1.0.1', submdoules=True)
Installing
^^^^^^^^^^^^^^
@@ -655,7 +711,7 @@ Default
.. code-block:: python
version('hg-head', hg='https://jay.grs.rwth-aachen.de/hg/example')
version('develop', hg='https://jay.grs.rwth-aachen.de/hg/example')
Note that this is not recommended; try to fetch a particular
revision instead.
@@ -687,7 +743,7 @@ Fetching the head
.. code-block:: python
version('svn-head', svn='https://outreach.scidac.gov/svn/libmonitor/trunk')
version('develop', svn='https://outreach.scidac.gov/svn/libmonitor/trunk')
This is not recommended, as the head will move forward over time.
@@ -697,12 +753,19 @@ Fetching a revision
.. code-block:: python
version('svn-head', svn='https://outreach.scidac.gov/svn/libmonitor/trunk',
version('develop', svn='https://outreach.scidac.gov/svn/libmonitor/trunk',
revision=128)
Subversion branches are handled as part of the directory structure, so
you can check out a branch or tag by changing the ``url``.
Automatic caching of files fetched during installation
------------------------------------------------------
Spack maintains a cache (described :ref:`here <caching>`) which saves files
retrieved during package installations to avoid re-downloading in the case that
a package is installed with a different specification (but the same version) or
reinstalled on account of a change in the hashing scheme.
.. _license:
@@ -776,7 +839,7 @@ Spack will create a global license file located at
file using the editor set in ``$EDITOR``, or vi if unset. It will look like
this:
.. code-block::
.. code-block:: sh
# A license is required to use pgi.
#
@@ -807,7 +870,7 @@ You can add your license directly to this file, or tell FlexNet to use a
license stored on a separate license server. Here is an example that
points to a license server called licman1:
.. code-block::
.. code-block:: sh
SERVER licman1.mcs.anl.gov 00163eb7fba5 27200
USE_SERVER
@@ -1221,11 +1284,13 @@ just as easily provide a version range:
depends_on("libelf@0.8.2:0.8.4:")
Or a requirement for a particular variant:
Or a requirement for a particular variant or compiler flags:
.. code-block:: python
depends_on("libelf@0.8+debug")
depends_on('libelf debug=True')
depends_on('libelf cppflags="-fPIC")
Both users *and* package authors can use the same spec syntax to refer
to different package configurations. Users use the spec syntax on the
@@ -1233,6 +1298,31 @@ command line to find installed packages or to install packages with
particular constraints, and package authors can use specs to describe
relationships between packages.
Additionally, dependencies may be specified for specific use cases:
.. code-block:: python
depends_on("cmake", type="build")
depends_on("libelf", type=("build", "link"))
depends_on("python", type="run")
The dependency types are:
* **"build"**: made available during the project's build. The package will
be added to ``PATH``, the compiler include paths, and ``PYTHONPATH``.
Other projects which depend on this one will not have these modified
(building project X doesn't need project Y's build dependencies).
* **"link"**: the project is linked to by the project. The package will be
added to the current package's ``rpath``.
* **"run"**: the project is used by the project at runtime. The package will
be added to ``PATH`` and ``PYTHONPATH``.
If not specified, ``type`` is assumed to be ``("build", "link")``. This is the
common case for compiled language usage. Also available are the aliases
``"alldeps"`` for all dependency types and ``"nolink"`` (``("build", "run")``)
for use by dependencies which are not expressed via a linker (e.g., Python or
Lua module loading).
.. _setup-dependent-environment:
``setup_dependent_environment()``
@@ -1337,6 +1427,19 @@ Now, the ``py-numpy`` package can be used as an argument to ``spack
activate``. When it is activated, all the files in its prefix will be
symbolically linked into the prefix of the python package.
Many packages produce Python extensions for *some* variants, but not
others: they should extend ``python`` only if the apropriate
variant(s) are selected. This may be accomplished with conditional
``extends()`` declarations:
.. code-block:: python
class FooLib(Package):
variant('python', default=True, description= \
'Build the Python extension Module')
extends('python', when='+python')
...
Sometimes, certain files in one package will conflict with those in
another, which means they cannot both be activated (symlinked) at the
same time. In this case, you can tell Spack to ignore those files
@@ -1623,21 +1726,21 @@ the user runs ``spack install`` and the time the ``install()`` method
is called. The concretized version of the spec above might look like
this::
mpileaks@2.3%gcc@4.7.3=linux-ppc64
^callpath@1.0%gcc@4.7.3+debug=linux-ppc64
^dyninst@8.1.2%gcc@4.7.3=linux-ppc64
^libdwarf@20130729%gcc@4.7.3=linux-ppc64
^libelf@0.8.11%gcc@4.7.3=linux-ppc64
^mpich@3.0.4%gcc@4.7.3=linux-ppc64
mpileaks@2.3%gcc@4.7.3 arch=linux-debian7-x86_64
^callpath@1.0%gcc@4.7.3+debug arch=linux-debian7-x86_64
^dyninst@8.1.2%gcc@4.7.3 arch=linux-debian7-x86_64
^libdwarf@20130729%gcc@4.7.3 arch=linux-debian7-x86_64
^libelf@0.8.11%gcc@4.7.3 arch=linux-debian7-x86_64
^mpich@3.0.4%gcc@4.7.3 arch=linux-debian7-x86_64
.. graphviz::
digraph {
"mpileaks@2.3\n%gcc@4.7.3\n=linux-ppc64" -> "mpich@3.0.4\n%gcc@4.7.3\n=linux-ppc64"
"mpileaks@2.3\n%gcc@4.7.3\n=linux-ppc64" -> "callpath@1.0\n%gcc@4.7.3+debug\n=linux-ppc64" -> "mpich@3.0.4\n%gcc@4.7.3\n=linux-ppc64"
"callpath@1.0\n%gcc@4.7.3+debug\n=linux-ppc64" -> "dyninst@8.1.2\n%gcc@4.7.3\n=linux-ppc64"
"dyninst@8.1.2\n%gcc@4.7.3\n=linux-ppc64" -> "libdwarf@20130729\n%gcc@4.7.3\n=linux-ppc64" -> "libelf@0.8.11\n%gcc@4.7.3\n=linux-ppc64"
"dyninst@8.1.2\n%gcc@4.7.3\n=linux-ppc64" -> "libelf@0.8.11\n%gcc@4.7.3\n=linux-ppc64"
"mpileaks@2.3\n%gcc@4.7.3\n arch=linux-debian7-x86_64" -> "mpich@3.0.4\n%gcc@4.7.3\n arch=linux-debian7-x86_64"
"mpileaks@2.3\n%gcc@4.7.3\n arch=linux-debian7-x86_64" -> "callpath@1.0\n%gcc@4.7.3+debug\n arch=linux-debian7-x86_64" -> "mpich@3.0.4\n%gcc@4.7.3\n arch=linux-debian7-x86_64"
"callpath@1.0\n%gcc@4.7.3+debug\n arch=linux-debian7-x86_64" -> "dyninst@8.1.2\n%gcc@4.7.3\n arch=linux-debian7-x86_64"
"dyninst@8.1.2\n%gcc@4.7.3\n arch=linux-debian7-x86_64" -> "libdwarf@20130729\n%gcc@4.7.3\n arch=linux-debian7-x86_64" -> "libelf@0.8.11\n%gcc@4.7.3\n arch=linux-debian7-x86_64"
"dyninst@8.1.2\n%gcc@4.7.3\n arch=linux-debian7-x86_64" -> "libelf@0.8.11\n%gcc@4.7.3\n arch=linux-debian7-x86_64"
}
Here, all versions, compilers, and platforms are filled in, and there
@@ -1648,8 +1751,8 @@ point will Spack call the ``install()`` method for your package.
Concretization in Spack is based on certain selection policies that
tell Spack how to select, e.g., a version, when one is not specified
explicitly. Concretization policies are discussed in more detail in
:ref:`site-configuration`. Sites using Spack can customize them to
match the preferences of their own users.
:ref:`configuration`. Sites using Spack can customize them to match
the preferences of their own users.
.. _spack-spec:
@@ -1666,9 +1769,9 @@ running ``spack spec``. For example:
^libdwarf
^libelf
dyninst@8.0.1%gcc@4.7.3=linux-ppc64
^libdwarf@20130729%gcc@4.7.3=linux-ppc64
^libelf@0.8.13%gcc@4.7.3=linux-ppc64
dyninst@8.0.1%gcc@4.7.3 arch=linux-debian7-x86_64
^libdwarf@20130729%gcc@4.7.3 arch=linux-debian7-x86_64
^libelf@0.8.13%gcc@4.7.3 arch=linux-debian7-x86_64
This is useful when you want to know exactly what Spack will do when
you ask for a particular spec.
@@ -1682,60 +1785,8 @@ be concretized on their system. For example, one user may prefer packages
built with OpenMPI and the Intel compiler. Another user may prefer
packages be built with MVAPICH and GCC.
Spack can be configured to prefer certain compilers, package
versions, depends_on, and variants during concretization.
The preferred configuration can be controlled via the
``~/.spack/packages.yaml`` file for user configuations, or the
``etc/spack/packages.yaml`` site configuration.
Here's an example packages.yaml file that sets preferred packages:
.. code-block:: sh
packages:
dyninst:
compiler: [gcc@4.9]
variants: +debug
gperftools:
version: [2.2, 2.4, 2.3]
all:
compiler: [gcc@4.4.7, gcc@4.6:, intel, clang, pgi]
providers:
mpi: [mvapich, mpich, openmpi]
At a high level, this example is specifying how packages should be
concretized. The dyninst package should prefer using gcc 4.9 and
be built with debug options. The gperftools package should prefer version
2.2 over 2.4. Every package on the system should prefer mvapich for
its MPI and gcc 4.4.7 (except for Dyninst, which overrides this by preferring gcc 4.9).
These options are used to fill in implicit defaults. Any of them can be overwritten
on the command line if explicitly requested.
Each packages.yaml file begins with the string ``packages:`` and
package names are specified on the next level. The special string ``all``
applies settings to each package. Underneath each package name is
one or more components: ``compiler``, ``variants``, ``version``,
or ``providers``. Each component has an ordered list of spec
``constraints``, with earlier entries in the list being preferred over
later entries.
Sometimes a package installation may have constraints that forbid
the first concretization rule, in which case Spack will use the first
legal concretization rule. Going back to the example, if a user
requests gperftools 2.3 or later, then Spack will install version 2.4
as the 2.4 version of gperftools is preferred over 2.3.
An explicit concretization rule in the preferred section will always
take preference over unlisted concretizations. In the above example,
xlc isn't listed in the compiler list. Every listed compiler from
gcc to pgi will thus be preferred over the xlc compiler.
The syntax for the ``provider`` section differs slightly from other
concretization rules. A provider lists a value that packages may
``depend_on`` (e.g, mpi) and a list of rules for fulfilling that
dependency.
See the `documentation in the config section <concretization-preferences_>`_
for more details.
.. _install-method:
@@ -1894,7 +1945,7 @@ discover its dependencies.
If you want to see the environment that a package will build with, or
if you want to run commands in that environment to test them out, you
can use the :ref:```spack env`` <spack-env>` command, documented
can use the :ref:`spack env <spack-env>` command, documented
below.
.. _compiler-wrappers:
@@ -1960,6 +2011,12 @@ the command line.
``$rpath_flag`` can be overriden on a compiler specific basis in
``lib/spack/spack/compilers/$compiler.py``.
The compiler wrappers also pass the compiler flags specified by the user from
the command line (``cflags``, ``cxxflags``, ``fflags``, ``cppflags``, ``ldflags``,
and/or ``ldlibs``). They do not override the canonical autotools flags with the
same names (but in ALL-CAPS) that may be passed into the build by particularly
challenging package scripts.
Compiler flags
~~~~~~~~~~~~~~
In rare circumstances such as compiling and running small unit tests, a package
@@ -1994,6 +2051,19 @@ instead of hard-coding ``join_path(self.spec['mpi'].prefix.bin, 'mpicc')`` for
the reasons outlined above.
Blas and Lapack libraries
~~~~~~~~~~~~~~~~~~~~~~~~~
Different packages provide implementation of ``Blas`` and ``Lapack`` routines.
The names of the resulting static and/or shared libraries differ from package
to package. In order to make ``install()`` method indifferent to the
choice of ``Blas`` implementation, each package which provides it
sets up ``self.spec.blas_shared_lib`` and ``self.spec.blas_static_lib `` to
point to the shared and static ``Blas`` libraries, respectively. The same
applies to packages which provide ``Lapack``. Package developers are advised to
use these variables, for example ``spec['blas'].blas_shared_lib`` instead of
hard-coding ``join_path(spec['blas'].prefix.lib, 'libopenblas.so')``.
Forking ``install()``
~~~~~~~~~~~~~~~~~~~~~
@@ -2206,12 +2276,12 @@ example:
def install(self, prefix):
# Do default install
@when('=chaos_5_x86_64_ib')
@when('arch=linux-debian7-x86_64')
def install(self, prefix):
# This will be executed instead of the default install if
# the package's sys_type() is chaos_5_x86_64_ib.
@when('=bgqos_0")
@when('arch=linux-debian7-x86_64")
def install(self, prefix):
# This will be executed if the package's sys_type is bgqos_0
@@ -2339,7 +2409,7 @@ build system.
.. _sanity-checks:
Sanity checking an intallation
Sanity checking an installation
--------------------------------
By default, Spack assumes that a build has failed if nothing is
@@ -2555,6 +2625,59 @@ File functions
.. _package-lifecycle:
Coding Style Guidelines
---------------------------
The following guidelines are provided, in the interests of making
Spack packages work in a consistent manner:
Variant Names
~~~~~~~~~~~~~~
Spack packages with variants similar to already-existing Spack
packages should use the same name for their variants. Standard
variant names are:
======= ======== ========================
Name Default Description
======= ======== ========================
shared True Build shared libraries
static Build static libraries
mpi Use MPI
python Build Python extension
======= ======== ========================
If specified in this table, the corresponding default should be used
when declaring a variant.
Version Lists
~~~~~~~~~~~~~~
Spack packges should list supported versions with the newest first.
Special Versions
~~~~~~~~~~~~~~~~~
The following *special* version names may be used when building a package:
* *@system*: Indicates a hook to the OS-installed version of the
package. This is useful, for example, to tell Spack to use the
OS-installed version in ``packages.yaml``::
openssl:
paths:
openssl@system: /usr
buildable: False
Certain Spack internals look for the *@system* version and do
appropriate things in that case.
* *@local*: Indicates the version was built manually from some source
tree of unknown provenance (see ``spack setup``).
Packaging workflow commands
---------------------------------
@@ -2649,11 +2772,16 @@ build process will start from scratch.
``spack purge``
~~~~~~~~~~~~~~~~~
Cleans up all of Spack's temporary files. Use this to recover disk
space if temporary files from interrupted or failed installs
accumulate in the staging area. This is equivalent to running ``spack
clean`` for every package you have fetched or staged.
Cleans up all of Spack's temporary and cached files. This can be used to
recover disk space if temporary files from interrupted or failed installs
accumulate in the staging area.
When called with ``--stage`` or ``--all`` (or without arguments, in which case
the default is ``--all``) this removes all staged files; this is equivalent to
running ``spack clean`` for every package you have fetched or staged.
When called with ``--cache`` or ``--all`` this will clear all resources
:ref:`cached <caching>` during installs.
Keeping the stage directory on success
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2801,11 +2929,11 @@ build it:
$ spack stage libelf
==> Trying to fetch from http://www.mr511.de/software/libelf-0.8.13.tar.gz
######################################################################## 100.0%
==> Staging archive: /Users/gamblin2/src/spack/var/spack/stage/libelf@0.8.13%gcc@4.8.3=linux-ppc64/libelf-0.8.13.tar.gz
==> Created stage in /Users/gamblin2/src/spack/var/spack/stage/libelf@0.8.13%gcc@4.8.3=linux-ppc64.
==> Staging archive: /Users/gamblin2/src/spack/var/spack/stage/libelf@0.8.13%gcc@4.8.3 arch=linux-debian7-x86_64/libelf-0.8.13.tar.gz
==> Created stage in /Users/gamblin2/src/spack/var/spack/stage/libelf@0.8.13%gcc@4.8.3 arch=linux-debian7-x86_64.
$ spack cd libelf
$ pwd
/Users/gamblin2/src/spack/var/spack/stage/libelf@0.8.13%gcc@4.8.3=linux-ppc64/libelf-0.8.13
/Users/gamblin2/src/spack/var/spack/stage/libelf@0.8.13%gcc@4.8.3 arch=linux-debian7-x86_64/libelf-0.8.13
``spack cd`` here changed he current working directory to the
directory containing the expanded ``libelf`` source code. There are a
@@ -2870,3 +2998,4 @@ might write:
DWARF_PREFIX = $(spack location -i libdwarf)
CXXFLAGS += -I$DWARF_PREFIX/include
CXXFLAGS += -L$DWARF_PREFIX/lib

View File

@@ -0,0 +1,576 @@
Spack Workflows
===============================
The process of using Spack involves building packages, running
binaries from those packages, and developing software that depends on
those packages. For example, one might use Spack to build the
`netcdf` package, use `spack load` to run the `ncdump` binary, and
finally, write a small C program to read/write a particular NetCDF file.
Spack supports a variety of workflows to suit a variety of situaions
and user preferences, there is no single way to do all these things.
This chapter demonstrates different workflows that have been
developed, pointing out the pros and cons of them.
Definitions
############
First some basic definitions.
Package, Concrete Spec, Installed Package
------------------------------------------
In Spack, a package is an abstract recipe to build one piece of software.
Spack packages may be used to build, in principle, any version of that
software with any set of variants. Examples of packages include
``curl`` and ``zlib``.
A package may be *instantiated* to produce a concrete spec; one
possible realization of a particular package, out of combinatorially
many other realizations. For example, here is a concrete spec
instantiated from ``curl``:
.. code-block:: sh
curl@7.50.1%gcc@5.3.0 arch=linux-SuSE11-x86_64
^openssl@system%gcc@5.3.0 arch=linux-SuSE11-x86_64
^zlib@1.2.8%gcc@5.3.0 arch=linux-SuSE11-x86_64
Spack's core concretization algorithm generates concrete specs by
instantiating packages from its repo, based on a set of "hints",
including user input and the ``packages.yaml`` file. This algorithm
may be accessed at any time with the ``spack spec`` command. For
example:
.. code-block:: sh
$ spack spec curl
curl@7.50.1%gcc@5.3.0 arch=linux-SuSE11-x86_64
^openssl@system%gcc@5.3.0 arch=linux-SuSE11-x86_64
^zlib@1.2.8%gcc@5.3.0 arch=linux-SuSE11-x86_64
Every time Spack installs a package, that installation corresponds to
a concrete spec. Only a vanishingly small fraction of possible
concrete specs will be installed at any one Spack site.
Consistent Sets
----------------
A set of Spack specs is said to be *consistent* if each package is
only instantiated one way within it --- that is, if two specs in the
set have the same package, then they must also have the same version,
variant, compiler, etc. For example, the following set is consistent:
.. code-block:: sh
curl@7.50.1%gcc@5.3.0 arch=linux-SuSE11-x86_64
^openssl@system%gcc@5.3.0 arch=linux-SuSE11-x86_64
^zlib@1.2.8%gcc@5.3.0 arch=linux-SuSE11-x86_64
zlib@1.2.8%gcc@5.3.0 arch=linux-SuSE11-x86_64
The following set is not consistent:
.. code-block:: sh
curl@7.50.1%gcc@5.3.0 arch=linux-SuSE11-x86_64
^openssl@system%gcc@5.3.0 arch=linux-SuSE11-x86_64
^zlib@1.2.8%gcc@5.3.0 arch=linux-SuSE11-x86_64
zlib@1.2.7%gcc@5.3.0 arch=linux-SuSE11-x86_64
The compatibility of a set of installed packages determines what may
be done with it. It is always possible to ``spack load`` any set of
installed packages, whether or not they are consistent, and run their
binaries from the command line. However, a set of installed packages
can only be linked together in one binary if it is consistent.
If the user produces a series of `spack spec` or `spack load`
commands, in general there is no guarantee of consistency between
them. Spack's concretization procedure guarantees that the results of
any *single* `spack spec` call will be consistent. Therefore, the
best way to ensure a consistent set of specs is to create a Spack
package with dependencies, and then instantiate that package. We will
use this technique below.
Building Packages
##################
Suppose you are tasked with installing a set of software packages on a
system in order to support one application -- both a core application
program, plus software to prepare input and analyze output. The
required software might be summed up as a series of ``spack install``
commands in a script. If needed, this script can always be run again
in the future. For example:
.. code-block::
spack install modele-utils
spack install emacs
spack install ncview
spack install nco
spack install modele-control
spack install py-numpy
In most cases, this script will not correctly install software
according to your specific needs: choices need to be made for
variants, versions and virtual dependency choices may be needed. It
*is* possible to specify these choices by extending specs on the
command line; however, the same choices must be specified repeatedly.
For example, if you wish to use ``openmpi`` to satisfy the ``mpi``
dependency, then ``^openmpi`` will have to appear on *every* ``spack
install`` line that uses MPI. It can get repetitve fast.
Custimizing Spack installation options is easier to do in the
``~/.spack/packages.yaml`` file. In this file, you can specify
preferred versions and variants to use for packages. For exmaple:
.. code-block:: yaml
packages:
python:
version: [3.5.1]
modele-utils:
version: [cmake]
everytrace:
version: [develop]
eigen:
variants: ~suitesparse
netcdf:
variants: +mpi
all:
compiler: [gcc@5.3.0]
providers:
mpi: [openmpi]
blas: [openblas]
lapack: [openblas]
This approach will work as long as you are building packages for just
one application.
Multiple Applications
-----------------------
Suppose instead you're building multiple inconsistent applications.
For example, users want package A to be built with ``openmpi`` and
package B with ``mpich`` --- but still share many other lower-level
dependencies. In this case, a single ``packages.yaml`` file will not
work. Plans are to implement *per-project* ``packages.yaml`` files.
In the meantime, one could write shell scripts to switch
``packages.yaml`` between multiple versions as needed, using symlinks.
Combinatorial Sets
--------------------------
Suppose that you are now tasked with systematically building many
incompatible versions of packages. For example, you need to build
``petsc`` 9 times for 3 different MPI implementations on 3 different
compilers, in order to support user needs. In this case, you will
need to either create 9 different ``packages.yaml`` files; or more
likely, create 9 different ``spack install`` command lines with the
correct options in the spec.
Loading Packages
#################
Once Spack packages have been built, the next step is to use them. As
with buiding packages, there are many ways to use them, depending on
the use case.
Simple Loads
--------------
Suppose that Spack has been used to install a set of command-line
programs, which users now wish to use. One can in principle put a
number of ``spack load`` commands into ``.bashrc``, for example:
.. code-block::
spack load modele-utils
spack load emacs
spack load ncview
spack load nco
spack load modele-control
Although simple load scripts like this are useful in many cases, the
have some drawbacks:
1. The set of modules loaded by them will in general not be
consistent. They are a decent way to load commands to be called
from command shells. See below for better ways to assemble a
consistent set of packages for building application programs.
2. The ``spack spec`` and ``spack install`` commands use a
sophisticated concretization algorithm that chooses the "best"
among several options, taking into account ``packages.yaml`` file.
The ``spack load`` and ``spack module loads`` commands, on the
other thand, are not very smart: if the user-supplied spec matches
more than one installed package, then ``spack module loads`` will
fail. This may change in the future. For now, the workaround is to
be more specific on any ``spack module loads`` lines that fail.
Cached Simple Loads
----------------------
Anoter problem with using `spack load` is, it is slow; a typical user
environment could take several seconds to load, and would not be
appropriate to put into ``.bashrc`` directly. It is preferable to use
a series of ``spack module loads`` commands to pre-compute which
modules to load. These can be put in a script that is run whenever
installed Spack packages change. For example:
.. code-block:: sh
#!/bin/sh
#
# Generate module load commands in ~/env/spackenv
cat <<EOF | /bin/sh >$HOME/env/spackenv
FIND='spack module loads --prefix linux-SuSE11-x86_64/'
\$FIND modele-utils
\$FIND emacs
\$FIND ncview
\$FIND nco
\$FIND modele-control
EOF
The output of this file is written in ``~/env/spackenv``:
.. code-block:: sh
# binutils@2.25%gcc@5.3.0+gold~krellpatch~libiberty arch=linux-SuSE11-x86_64
module load linux-SuSE11-x86_64/binutils-2.25-gcc-5.3.0-6w5d2t4
# python@2.7.12%gcc@5.3.0~tk~ucs4 arch=linux-SuSE11-x86_64
module load linux-SuSE11-x86_64/python-2.7.12-gcc-5.3.0-2azoju2
# ncview@2.1.7%gcc@5.3.0 arch=linux-SuSE11-x86_64
module load linux-SuSE11-x86_64/ncview-2.1.7-gcc-5.3.0-uw3knq2
# nco@4.5.5%gcc@5.3.0 arch=linux-SuSE11-x86_64
module load linux-SuSE11-x86_64/nco-4.5.5-gcc-5.3.0-7aqmimu
# modele-control@develop%gcc@5.3.0 arch=linux-SuSE11-x86_64
module load linux-SuSE11-x86_64/modele-control-develop-gcc-5.3.0-7rddsij
# zlib@1.2.8%gcc@5.3.0 arch=linux-SuSE11-x86_64
module load linux-SuSE11-x86_64/zlib-1.2.8-gcc-5.3.0-fe5onbi
# curl@7.50.1%gcc@5.3.0 arch=linux-SuSE11-x86_64
module load linux-SuSE11-x86_64/curl-7.50.1-gcc-5.3.0-4vlev55
# hdf5@1.10.0-patch1%gcc@5.3.0+cxx~debug+fortran+mpi+shared~szip~threadsafe arch=linux-SuSE11-x86_64
module load linux-SuSE11-x86_64/hdf5-1.10.0-patch1-gcc-5.3.0-pwnsr4w
# netcdf@4.4.1%gcc@5.3.0~hdf4+mpi arch=linux-SuSE11-x86_64
module load linux-SuSE11-x86_64/netcdf-4.4.1-gcc-5.3.0-rl5canv
# netcdf-fortran@4.4.4%gcc@5.3.0 arch=linux-SuSE11-x86_64
module load linux-SuSE11-x86_64/netcdf-fortran-4.4.4-gcc-5.3.0-stdk2xq
# modele-utils@cmake%gcc@5.3.0+aux+diags+ic arch=linux-SuSE11-x86_64
module load linux-SuSE11-x86_64/modele-utils-cmake-gcc-5.3.0-idyjul5
# everytrace@develop%gcc@5.3.0+fortran+mpi arch=linux-SuSE11-x86_64
module load linux-SuSE11-x86_64/everytrace-develop-gcc-5.3.0-p5wmb25
Users may now put ``source ~/env/spackenv`` into ``.bashrc``.
.. note ::
Some module systems put a prefix on the names of modules created
by Spack. For example, that prefix is ``linux-SuSE11-x86_64/`` in
the above case. If a prefix is not needed, you may omit the
``--prefix`` flag from ``spack module loads``.
Transitive Dependencies
---------------------------
In the script above, each ``spack module loads`` command generates a
*single* ``module load`` line. Transitive dependencies do not usually
need to be load, only modules the user needs in in ``$PATH``. This is
because Spack builds binaries with RPATH. Spack's RPATH policy has
some nice features:
1. Modules for multiple inconsistent applications may be loaded
simultaneously. In the above example (Multiple Applications),
package A and package B can coexist together in the user's $PATH,
even though they use different MPIs.
2. RPATH eliminates a whole class of strange errors that can happen
in non-RPATH binaries when the wrong ``LD_LIBRARY_PATH`` is
loaded.
3. Recursive module systems such as LMod are not necessary.
4. Modules are not needed at all to execute binaries. If a path to a
binary is known, it may be executed. For example, the path for a
Spack-built compiler can be given to an IDE without requiring the
IDE to load that compiler's module.
Unfortunately, Spacks' RPATH support does not work in all case. For example:
1. Software comes in many forms --- not just compiled ELF binaries,
but also as interpreted code in Python, R, JVM bytecode, etc.
Those systems almost universally use an environment variable
analogous to ``LD_LIBRARY_PATH`` to dynamically load libraries.
2. Although Spack generally builds binaries with RPATH, it does not
currently do so for compiled Python extensions (for example,
``py-numpy``). Any libraries that these extensions depend on
(``openblas`` in this case, for example) must be specified in the
``LD_LIBRARY_PATH``.`
3. In some cases, Spack-generated binaries end up without a
functional RPATH for no discernable reason.
In cases where RPATH support doesn't make things "just work," it can
be necessary to load a module's dependencies as well as the module
itself. This is done by adding the ``--dependencies`` flag to the
``spack module loads`` command. For example, the following line,
added to the script above, would be used to load Numpy, along with
core Python, Setup TOols and a number of other packages:
.. code-block:: sh
\$FIND --dependencies py-numpy
Extension Packages
---------------------
Extensions (::ref:`packaging_extension` section) may be used as as an
alternative to loading Python packages directly. If extensions are
activated, then ``spack load python`` will also load all the
extensions activated for the given ``python``. However, Spack
extensions have two potential drawbacks:
1. Activated packages that involve compiled C extensions may still
need their dependencies to be loaded manually. For example,
``spack load openblas`` might be required to make ``py-numpy``
work.
2. Extensions "break" a core feature of Spack, which is that multiple
versions of a package can co-exist side-by-side. For example,
suppose you wish to run a Python in two different environments but
the same basic Python --- one with ``py-numpy@1.7`` and one with
``py-numpy@1.8``. Spack extensions will not support this potential
debugging use case.
Filesystem Views
-------------------------------
The above
.. Maybe this is not the right location for this documentation.
The Spack installation area allows for many package installation trees
to coexist and gives the user choices as to what versions and variants
of packages to use. To use them, the user must rely on a way to
aggregate a subset of those packages. The section on Environment
Modules gives one good way to do that which relies on setting various
environment variables. An alternative way to aggregate is through
**filesystem views**.
A filesystem view is a single directory tree which is the union of the
directory hierarchies of the individual package installation trees
that have been included. The files of the view's installed packages
are brought into the view by symbolic or hard links back to their
location in the original Spack installation area. As the view is
formed, any clashes due to a file having the exact same path in its
package installation tree are handled in a first-come-first-served
basis and a warning is printed. Packages and their dependencies can
be both added and removed. During removal, empty directories will be
purged. These operations can be limited to pertain to just the
packages listed by the user or to exclude specific dependencies and
they allow for software installed outside of Spack to coexist inside
the filesystem view tree.
By its nature, a filesystem view represents a particular choice of one
set of packages among all the versions and variants that are available
in the Spack installation area. It is thus equivalent to the
directory hiearchy that might exist under ``/usr/local``. While this
limits a view to including only one version/variant of any package, it
provides the benefits of having a simpler and traditional layout which
may be used without any particular knowledge that its packages were
built by Spack.
Views can be used for a variety of purposes including:
- A central installation in a traditional layout, eg ``/usr/local`` maintained over time by the sysadmin.
- A self-contained installation area which may for the basis of a top-level atomic versioning scheme, eg ``/opt/pro`` vs ``/opt/dev``.
- Providing an atomic and monolithic binary distribution, eg for delivery as a single tarball.
- Producing ephemeral testing or developing environments.
Using Filesystem Views
~~~~~~~~~~~~~~~~~~~~~~
A filesystem view is created and packages are linked in by the ``spack
view`` command's ``symlink`` and ``hardlink`` sub-commands. The
``spack view remove`` command can be used to unlink some or all of the
filesystem view.
The following example creates a filesystem view based
on an installed ``cmake`` package and then removes from the view the
files in the ``cmake`` package while retaining its dependencies.
.. code-block:: sh
$ spack view -v symlink myview cmake@3.5.2
==> Linking package: "ncurses"
==> Linking package: "zlib"
==> Linking package: "openssl"
==> Linking package: "cmake"
$ ls myview/
bin doc etc include lib share
$ ls myview/bin/
captoinfo clear cpack ctest infotocap openssl tabs toe tset
ccmake cmake c_rehash infocmp ncurses6-config reset tic tput
$ spack view -v -d false rm myview cmake@3.5.2
==> Removing package: "cmake"
$ ls myview/bin/
captoinfo c_rehash infotocap openssl tabs toe tset
clear infocmp ncurses6-config reset tic tput
Limitations of Filesystem Views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This section describes some limitations that should be considered in
using filesystems views.
Filesystem views are merely organizational. The binary executable
programs, shared libraries and other build products found in a view
are mere links into the "real" Spack installation area. If a view is
built with symbolic links it requires the Spack-installed package to
be kept in place. Building a view with hardlinks removes this
requirement but any internal paths (eg, rpath or ``#!`` interpreter
specifications) will still require the Spack-installed package files
to be in place.
.. FIXME: reference the relocation work of Hegner and Gartung.
As described above, when a view is built only a single instance of a
file may exist in the unified filesystem tree. If more than one
package provides a file at the same path (relative to its own root)
then it is the first package added to the view that "wins". A warning
is printed and it is up to the user to determine if the conflict
matters.
It is up to the user to assure a consistent view is produced. In
particular if the user excludes packages, limits the following of
dependencies or removes packages the view may become inconsistent. In
particular, if two packages require the same sub-tree of dependencies,
removing one package (recursively) will remove its dependencies and
leave the other package broken.
Build System Configuration Support
----------------------------------
Imagine a developer creating a CMake-based (or Autotools) project in a local
directory, which depends on libraries A-Z. Once Spack has installed
those dependencies, one would like to run ``cmake`` with appropriate
command line and environment so CMake can find them. The ``spack
setup`` command does this conveniently, producing a CMake
configuration that is essentially the same as how Spack *would have*
configured the project. This can be demonstrated with a usage
example:
.. code-block:: bash
cd myproject
spack setup myproject@local
mkdir build; cd build
../spconfig.py ..
make
make install
Notes:
* Spack must have ``myproject/package.py`` in its repository for
this to work.
* ``spack setup`` produces the executable script ``spconfig.py`` in
the local directory, and also creates the module file for the
package. ``spconfig.py`` is normally run from the user's
out-of-source build directory.
* The version number given to ``spack setup`` is arbitrary, just
like ``spack diy``. ``myproject/package.py`` does not need to
have any valid downloadable versions listed (typical when a
project is new).
* spconfig.py produces a CMake configuration that *does not* use the
Spack wrappers. Any resulting binaries *will not* use RPATH,
unless the user has enabled it. This is recommended for
development purposes, not production.
* ``spconfig.py`` is human readable, and can serve as a developer
reference of what dependencies are being used.
* ``make install`` installs the package into the Spack repository,
where it may be used by other Spack packages.
* CMake-generated makefiles re-run CMake in some circumstances. Use
of ``spconfig.py`` breaks this behavior, requiring the developer
to manually re-run ``spconfig.py`` when a ``CMakeLists.txt`` file
has changed.
CMakePackage
~~~~~~~~~~~~
In order ot enable ``spack setup`` functionality, the author of
``myproject/package.py`` must subclass from ``CMakePackage`` instead
of the standard ``Package`` superclass. Because CMake is
standardized, the packager does not need to tell Spack how to run
``cmake; make; make install``. Instead the packager only needs to
create (optional) methods ``configure_args()`` and ``configure_env()``, which
provide the arguments (as a list) and extra environment variables (as
a dict) to provide to the ``cmake`` command. Usually, these will
translate variant flags into CMake definitions. For example:
.. code-block:: python
def configure_args(self):
spec = self.spec
return [
'-DUSE_EVERYTRACE=%s' % ('YES' if '+everytrace' in spec else 'NO'),
'-DBUILD_PYTHON=%s' % ('YES' if '+python' in spec else 'NO'),
'-DBUILD_GRIDGEN=%s' % ('YES' if '+gridgen' in spec else 'NO'),
'-DBUILD_COUPLER=%s' % ('YES' if '+coupler' in spec else 'NO'),
'-DUSE_PISM=%s' % ('YES' if '+pism' in spec else 'NO')]
If needed, a packager may also override methods defined in
``StagedPackage`` (see below).
StagedPackage
~~~~~~~~~~~~~
``CMakePackage`` is implemented by subclassing the ``StagedPackage``
superclass, which breaks down the standard ``Package.install()``
method into several sub-stages: ``setup``, ``configure``, ``build``
and ``install``. Details:
* Instead of implementing the standard ``install()`` method, package
authors implement the methods for the sub-stages
``install_setup()``, ``install_configure()``,
``install_build()``, and ``install_install()``.
* The ``spack install`` command runs the sub-stages ``configure``,
``build`` and ``install`` in order. (The ``setup`` stage is
not run by default; see below).
* The ``spack setup`` command runs the sub-stages ``setup``
and a dummy install (to create the module file).
* The sub-stage install methods take no arguments (other than
``self``). The arguments ``spec`` and ``prefix`` to the standard
``install()`` method may be accessed via ``self.spec`` and
``self.prefix``.
GNU Autotools
~~~~~~~~~~~~~
The ``setup`` functionality is currently only available for
CMake-based packages. Extending this functionality to GNU
Autotools-based packages would be easy (and should be done by a
developer who actively uses Autotools). Packages that use
non-standard build systems can gain ``setup`` functionality by
subclassing ``StagedPackage`` directly.

105
lib/spack/env/cc vendored
View File

@@ -55,7 +55,10 @@ parameters=(
# The compiler input variables are checked for sanity later:
# SPACK_CC, SPACK_CXX, SPACK_F77, SPACK_FC
# Debug flag is optional; set to "TRUE" for debug logging:
# The default compiler flags are passed from these variables:
# SPACK_CFLAGS, SPACK_CXXFLAGS, SPACK_FCFLAGS, SPACK_FFLAGS,
# SPACK_LDFLAGS, SPACK_LDLIBS
# Debug env var is optional; set to true for debug logging:
# SPACK_DEBUG
# Test command is used to unit test the compiler script.
# SPACK_TEST_COMMAND
@@ -99,21 +102,25 @@ case "$command" in
command="$SPACK_CC"
language="C"
comp="CC"
lang_flags=C
;;
c++|CC|g++|clang++|icpc|pgc++|xlc++)
command="$SPACK_CXX"
language="C++"
comp="CXX"
lang_flags=CXX
;;
f90|fc|f95|gfortran|ifort|pgfortran|xlf90|nagfor)
ftn|f90|fc|f95|gfortran|ifort|pgfortran|xlf90|nagfor)
command="$SPACK_FC"
language="Fortran 90"
comp="FC"
lang_flags=F
;;
f77|gfortran|ifort|pgfortran|xlf|nagfor)
f77|gfortran|ifort|pgfortran|xlf|nagfor|ftn)
command="$SPACK_F77"
language="Fortran 77"
comp="F77"
lang_flags=F
;;
ld)
mode=ld
@@ -131,7 +138,7 @@ if [[ -z $mode ]]; then
if [[ $arg == -v || $arg == -V || $arg == --version || $arg == -dumpversion ]]; then
mode=vcheck
break
fi
fi
done
fi
@@ -167,6 +174,28 @@ if [[ -z $command ]]; then
die "ERROR: Compiler '$SPACK_COMPILER_SPEC' does not support compiling $language programs."
fi
#
# Filter '.' and Spack environment directories out of PATH so that
# this script doesn't just call itself
#
IFS=':' read -ra env_path <<< "$PATH"
IFS=':' read -ra spack_env_dirs <<< "$SPACK_ENV_PATH"
spack_env_dirs+=("" ".")
PATH=""
for dir in "${env_path[@]}"; do
addpath=true
for env_dir in "${spack_env_dirs[@]}"; do
if [[ $dir == $env_dir ]]; then
addpath=false
break
fi
done
if $addpath; then
PATH="${PATH:+$PATH:}$dir"
fi
done
export PATH
if [[ $mode == vcheck ]]; then
exec ${command} "$@"
fi
@@ -188,6 +217,42 @@ fi
input_command="$@"
args=("$@")
# Prepend cppflags, cflags, cxxflags, fcflags, fflags, and ldflags
# Add ldflags
case "$mode" in
ld|ccld)
args=(${SPACK_LDFLAGS[@]} "${args[@]}") ;;
esac
# Add compiler flags.
case "$mode" in
cc|ccld)
# Add c, cxx, fc, and f flags
case $lang_flags in
C)
args=(${SPACK_CFLAGS[@]} "${args[@]}") ;;
CXX)
args=(${SPACK_CXXFLAGS[@]} "${args[@]}") ;;
esac
;;
esac
# Add cppflags
case "$mode" in
cpp|as|cc|ccld)
args=(${SPACK_CPPFLAGS[@]} "${args[@]}") ;;
esac
case "$mode" in cc|ccld)
# Add fortran flags
case $lang_flags in
F)
args=(${SPACK_FFLAGS[@]} "${args[@]}") ;;
esac
;;
esac
# Read spack dependencies from the path environment variable
IFS=':' read -ra deps <<< "$SPACK_DEPENDENCIES"
for dep in "${deps[@]}"; do
@@ -230,6 +295,12 @@ elif [[ $mode == ld ]]; then
$add_rpaths && args=("-rpath" "$SPACK_PREFIX/lib" "${args[@]}")
fi
# Add SPACK_LDLIBS to args
case "$mode" in
ld|ccld)
args=("${args[@]}" ${SPACK_LDLIBS[@]}) ;;
esac
#
# Unset pesky environment variables that could affect build sanity.
#
@@ -237,28 +308,6 @@ unset LD_LIBRARY_PATH
unset LD_RUN_PATH
unset DYLD_LIBRARY_PATH
#
# Filter '.' and Spack environment directories out of PATH so that
# this script doesn't just call itself
#
IFS=':' read -ra env_path <<< "$PATH"
IFS=':' read -ra spack_env_dirs <<< "$SPACK_ENV_PATH"
spack_env_dirs+=("" ".")
PATH=""
for dir in "${env_path[@]}"; do
addpath=true
for env_dir in "${spack_env_dirs[@]}"; do
if [[ $dir == $env_dir ]]; then
addpath=false
break
fi
done
if $addpath; then
PATH="${PATH:+$PATH:}$dir"
fi
done
export PATH
full_command=("$command" "${args[@]}")
# In test command mode, write out full command for Spack tests.
@@ -275,8 +324,8 @@ fi
if [[ $SPACK_DEBUG == TRUE ]]; then
input_log="$SPACK_DEBUG_LOG_DIR/spack-cc-$SPACK_SHORT_SPEC.in.log"
output_log="$SPACK_DEBUG_LOG_DIR/spack-cc-$SPACK_SHORT_SPEC.out.log"
echo "[$mode] $command $input_command" >> $input_log
echo "[$mode] ${full_command[@]}" >> $output_log
echo "[$mode] $command $input_command" >> "$input_log"
echo "[$mode] ${full_command[@]}" >> "$output_log"
fi
exec "${full_command[@]}"

1
lib/spack/env/cray/CC vendored Symbolic link
View File

@@ -0,0 +1 @@
../cc

1
lib/spack/env/cray/cc vendored Symbolic link
View File

@@ -0,0 +1 @@
../cc

1
lib/spack/env/cray/ftn vendored Symbolic link
View File

@@ -0,0 +1 @@
../cc

1
lib/spack/env/craype/CC vendored Symbolic link
View File

@@ -0,0 +1 @@
../cc

1
lib/spack/env/craype/cc vendored Symbolic link
View File

@@ -0,0 +1 @@
../cc

1
lib/spack/env/craype/ftn vendored Symbolic link
View File

@@ -0,0 +1 @@
../cc

View File

@@ -22,33 +22,34 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
__all__ = ['set_install_permissions', 'install', 'install_tree', 'traverse_tree',
'expand_user', 'working_dir', 'touch', 'touchp', 'mkdirp',
'force_remove', 'join_path', 'ancestor', 'can_access', 'filter_file',
'FileFilter', 'change_sed_delimiter', 'is_exe', 'force_symlink',
'set_executable', 'copy_mode', 'unset_executable_mode',
'remove_dead_links', 'remove_linked_tree', 'find_library_path',
'fix_darwin_install_name']
import os
import glob
import sys
import re
import shutil
import stat
import errno
import getpass
from contextlib import contextmanager, closing
from tempfile import NamedTemporaryFile
from contextlib import contextmanager
import subprocess
import fileinput
import llnl.util.tty as tty
from spack.util.compression import ALLOWED_ARCHIVE_TYPES
__all__ = ['set_install_permissions', 'install', 'install_tree',
'traverse_tree',
'expand_user', 'working_dir', 'touch', 'touchp', 'mkdirp',
'force_remove', 'join_path', 'ancestor', 'can_access',
'filter_file',
'FileFilter', 'change_sed_delimiter', 'is_exe', 'force_symlink',
'set_executable', 'copy_mode', 'unset_executable_mode',
'remove_dead_links', 'remove_linked_tree', 'find_library_path',
'fix_darwin_install_name', 'to_link_flags', 'to_lib_name']
def filter_file(regex, repl, *filenames, **kwargs):
"""Like sed, but uses python regular expressions.
Filters every line of file through regex and replaces the file
Filters every line of each file through regex and replaces the file
with a filtered version. Preserves mode of filtered files.
As with re.sub, ``repl`` can be either a string or a callable.
@@ -59,7 +60,7 @@ def filter_file(regex, repl, *filenames, **kwargs):
Keyword Options:
string[=False] If True, treat regex as a plain string.
backup[=True] Make a backup files suffixed with ~
backup[=True] Make backup file(s) suffixed with ~
ignore_absent[=False] Ignore any files that don't exist.
"""
string = kwargs.get('string', False)
@@ -69,6 +70,7 @@ def filter_file(regex, repl, *filenames, **kwargs):
# Allow strings to use \1, \2, etc. for replacement, like sed
if not callable(repl):
unescaped = repl.replace(r'\\', '\\')
def replace_groups_with_groupid(m):
def groupid_to_group(x):
return m.group(int(x.group(1)))
@@ -79,30 +81,32 @@ def groupid_to_group(x):
regex = re.escape(regex)
for filename in filenames:
backup = filename + "~"
backup_filename = filename + "~"
if ignore_absent and not os.path.exists(filename):
continue
shutil.copy(filename, backup)
# Create backup file. Don't overwrite an existing backup
# file in case this file is being filtered multiple times.
if not os.path.exists(backup_filename):
shutil.copy(filename, backup_filename)
try:
with closing(open(backup)) as infile:
with closing(open(filename, 'w')) as outfile:
for line in infile:
foo = re.sub(regex, repl, line)
outfile.write(foo)
for line in fileinput.input(filename, inplace=True):
print(re.sub(regex, repl, line.rstrip('\n')))
except:
# clean up the original file on failure.
shutil.move(backup, filename)
shutil.move(backup_filename, filename)
raise
finally:
if not backup:
shutil.rmtree(backup, ignore_errors=True)
os.remove(backup_filename)
class FileFilter(object):
"""Convenience class for calling filter_file a lot."""
def __init__(self, *filenames):
self.filenames = filenames
@@ -113,7 +117,7 @@ def filter(self, regex, repl, **kwargs):
def change_sed_delimiter(old_delim, new_delim, *filenames):
"""Find all sed search/replace commands and change the delimiter.
e.g., if the file contains seds that look like 's///', you can
call change_sed_delimeter('/', '@', file) to change the
call change_sed_delimiter('/', '@', file) to change the
delimiter to '@'.
NOTE that this routine will fail if the delimiter is ' or ".
@@ -157,9 +161,12 @@ def set_install_permissions(path):
def copy_mode(src, dest):
src_mode = os.stat(src).st_mode
dest_mode = os.stat(dest).st_mode
if src_mode & stat.S_IXUSR: dest_mode |= stat.S_IXUSR
if src_mode & stat.S_IXGRP: dest_mode |= stat.S_IXGRP
if src_mode & stat.S_IXOTH: dest_mode |= stat.S_IXOTH
if src_mode & stat.S_IXUSR:
dest_mode |= stat.S_IXUSR
if src_mode & stat.S_IXGRP:
dest_mode |= stat.S_IXGRP
if src_mode & stat.S_IXOTH:
dest_mode |= stat.S_IXOTH
os.chmod(dest, dest_mode)
@@ -175,7 +182,7 @@ def install(src, dest):
"""Manually install a file to a particular location."""
tty.debug("Installing %s to %s" % (src, dest))
# Expand dsst to its eventual full path if it is a directory.
# Expand dest to its eventual full path if it is a directory.
if os.path.isdir(dest):
dest = join_path(dest, os.path.basename(src))
@@ -185,7 +192,7 @@ def install(src, dest):
def install_tree(src, dest, **kwargs):
"""Manually install a file to a particular location."""
"""Manually install a directory tree to a particular location."""
tty.debug("Installing %s to %s" % (src, dest))
shutil.copytree(src, dest, **kwargs)
@@ -215,7 +222,7 @@ def mkdirp(*paths):
if not os.path.exists(path):
os.makedirs(path)
elif not os.path.isdir(path):
raise OSError(errno.EEXIST, "File alredy exists", path)
raise OSError(errno.EEXIST, "File already exists", path)
def force_remove(*paths):
@@ -224,9 +231,10 @@ def force_remove(*paths):
for path in paths:
try:
os.remove(path)
except OSError, e:
except OSError:
pass
@contextmanager
def working_dir(dirname, **kwargs):
if kwargs.get('create', False):
@@ -240,7 +248,7 @@ def working_dir(dirname, **kwargs):
def touch(path):
"""Creates an empty file at the specified path."""
with open(path, 'a') as file:
with open(path, 'a'):
os.utime(path, None)
@@ -253,7 +261,7 @@ def touchp(path):
def force_symlink(src, dest):
try:
os.symlink(src, dest)
except OSError as e:
except OSError:
os.remove(dest)
os.symlink(src, dest)
@@ -275,7 +283,7 @@ def ancestor(dir, n=1):
def can_access(file_name):
"""True if we have read/write access to the file."""
return os.access(file_name, os.R_OK|os.W_OK)
return os.access(file_name, os.R_OK | os.W_OK)
def traverse_tree(source_root, dest_root, rel_path='', **kwargs):
@@ -304,7 +312,7 @@ def traverse_tree(source_root, dest_root, rel_path='', **kwargs):
Optional args:
order=[pre|post] -- Whether to do pre- or post-order traveral.
order=[pre|post] -- Whether to do pre- or post-order traversal.
ignore=<predicate> -- Predicate indicating which files to ignore.
@@ -343,13 +351,15 @@ def traverse_tree(source_root, dest_root, rel_path='', **kwargs):
# Treat as a directory
if os.path.isdir(source_child) and (
follow_links or not os.path.islink(source_child)):
follow_links or not os.path.islink(source_child)):
# When follow_nonexisting isn't set, don't descend into dirs
# in source that do not exist in dest
if follow_nonexisting or os.path.exists(dest_child):
tuples = traverse_tree(source_root, dest_root, rel_child, **kwargs)
for t in tuples: yield t
tuples = traverse_tree(
source_root, dest_root, rel_child, **kwargs)
for t in tuples:
yield t
# Treat as a file.
elif not ignore(os.path.join(rel_path, f)):
@@ -379,6 +389,7 @@ def remove_dead_links(root):
if not os.path.exists(real_path):
os.unlink(path)
def remove_linked_tree(path):
"""
Removes a directory and its contents. If the directory is a
@@ -402,28 +413,53 @@ def fix_darwin_install_name(path):
Fix install name of dynamic libraries on Darwin to have full path.
There are two parts of this task:
(i) use install_name('-id',...) to change install name of a single lib;
(ii) use install_name('-change',...) to change the cross linking between libs.
The function assumes that all libraries are in one folder and currently won't
follow subfolders.
(ii) use install_name('-change',...) to change the cross linking between
libs. The function assumes that all libraries are in one folder and
currently won't follow subfolders.
Args:
path: directory in which .dylib files are alocated
path: directory in which .dylib files are located
"""
libs = glob.glob(join_path(path,"*.dylib"))
libs = glob.glob(join_path(path, "*.dylib"))
for lib in libs:
# fix install name first:
subprocess.Popen(["install_name_tool", "-id",lib,lib], stdout=subprocess.PIPE).communicate()[0]
long_deps = subprocess.Popen(["otool", "-L",lib], stdout=subprocess.PIPE).communicate()[0].split('\n')
subprocess.Popen(
["install_name_tool", "-id", lib, lib],
stdout=subprocess.PIPE).communicate()[0]
long_deps = subprocess.Popen(
["otool", "-L", lib],
stdout=subprocess.PIPE).communicate()[0].split('\n')
deps = [dep.partition(' ')[0][1::] for dep in long_deps[2:-1]]
# fix all dependencies:
for dep in deps:
for loc in libs:
if dep == os.path.basename(loc):
subprocess.Popen(["install_name_tool", "-change",dep,loc,lib], stdout=subprocess.PIPE).communicate()[0]
subprocess.Popen(
["install_name_tool", "-change", dep, loc, lib],
stdout=subprocess.PIPE).communicate()[0]
break
def to_lib_name(library):
"""Transforms a path to the library /path/to/lib<name>.xyz into <name>
"""
# Assume libXYZ.suffix
return os.path.basename(library)[3:].split(".")[0]
def to_link_flags(library):
"""Transforms a path to a <library> into linking flags -L<dir> -l<name>.
Return:
A string of linking flags.
"""
dir = os.path.dirname(library)
name = to_lib_name(library)
res = '-L%s -l%s' % (dir, name)
return res
def find_library_path(libname, *paths):
"""Searches for a file called <libname> in each path.

View File

@@ -24,7 +24,6 @@
##############################################################################
import os
import re
import sys
import functools
import collections
import inspect
@@ -39,14 +38,15 @@ def index_by(objects, *funcs):
Values are used as keys. For example, suppose you have four
objects with attributes that look like this:
a = Spec(name="boost", compiler="gcc", arch="bgqos_0")
b = Spec(name="mrnet", compiler="intel", arch="chaos_5_x86_64_ib")
c = Spec(name="libelf", compiler="xlc", arch="bgqos_0")
d = Spec(name="libdwarf", compiler="intel", arch="chaos_5_x86_64_ib")
a = Spec(name="boost", compiler="gcc", arch="bgqos_0")
b = Spec(name="mrnet", compiler="intel", arch="chaos_5_x86_64_ib")
c = Spec(name="libelf", compiler="xlc", arch="bgqos_0")
d = Spec(name="libdwarf", compiler="intel", arch="chaos_5_x86_64_ib")
list_of_specs = [a,b,c,d]
index1 = index_by(list_of_specs, lambda s: s.arch, lambda s: s.compiler)
index2 = index_by(list_of_specs, lambda s: s.compiler)
list_of_specs = [a,b,c,d]
index1 = index_by(list_of_specs, lambda s: s.arch,
lambda s: s.compiler)
index2 = index_by(list_of_specs, lambda s: s.compiler)
``index1'' now has two levels of dicts, with lists at the
leaves, like this:
@@ -137,7 +137,7 @@ def get_calling_module_name():
finally:
del stack
if not '__module__' in caller_locals:
if '__module__' not in caller_locals:
raise RuntimeError("Must invoke get_calling_module_name() "
"from inside a class definition!")
@@ -173,11 +173,11 @@ def has_method(cls, name):
class memoized(object):
"""Decorator that caches the results of a function, storing them
in an attribute of that function."""
def __init__(self, func):
self.func = func
self.cache = {}
def __call__(self, *args):
if not isinstance(args, collections.Hashable):
# Not hashable, so just call the function.
@@ -187,12 +187,10 @@ def __call__(self, *args):
self.cache[args] = self.func(*args)
return self.cache[args]
def __get__(self, obj, objtype):
"""Support instance methods."""
return functools.partial(self.__call__, obj)
def clear(self):
"""Expunge cache so that self.func will be called again."""
self.cache.clear()
@@ -237,13 +235,21 @@ def setter(name, value):
if not has_method(cls, '_cmp_key'):
raise TypeError("'%s' doesn't define _cmp_key()." % cls.__name__)
setter('__eq__', lambda s,o: (s is o) or (o is not None and s._cmp_key() == o._cmp_key()))
setter('__lt__', lambda s,o: o is not None and s._cmp_key() < o._cmp_key())
setter('__le__', lambda s,o: o is not None and s._cmp_key() <= o._cmp_key())
setter('__eq__',
lambda s, o:
(s is o) or (o is not None and s._cmp_key() == o._cmp_key()))
setter('__lt__',
lambda s, o: o is not None and s._cmp_key() < o._cmp_key())
setter('__le__',
lambda s, o: o is not None and s._cmp_key() <= o._cmp_key())
setter('__ne__', lambda s,o: (s is not o) and (o is None or s._cmp_key() != o._cmp_key()))
setter('__gt__', lambda s,o: o is None or s._cmp_key() > o._cmp_key())
setter('__ge__', lambda s,o: o is None or s._cmp_key() >= o._cmp_key())
setter('__ne__',
lambda s, o:
(s is not o) and (o is None or s._cmp_key() != o._cmp_key()))
setter('__gt__',
lambda s, o: o is None or s._cmp_key() > o._cmp_key())
setter('__ge__',
lambda s, o: o is None or s._cmp_key() >= o._cmp_key())
setter('__hash__', lambda self: hash(self._cmp_key()))
@@ -254,10 +260,10 @@ def setter(name, value):
class HashableMap(dict):
"""This is a hashable, comparable dictionary. Hash is performed on
a tuple of the values in the dictionary."""
def _cmp_key(self):
return tuple(sorted(self.values()))
def copy(self):
"""Type-agnostic clone method. Preserves subclass type."""
# Construct a new dict of my type
@@ -336,24 +342,39 @@ def match(string):
return match
def DictWrapper(dictionary):
"""Returns a class that wraps a dictionary and enables it to be used
like an object."""
class wrapper(object):
def __getattr__(self, name): return dictionary[name]
def __setattr__(self, name, value): dictionary[name] = value
def setdefault(self, *args): return dictionary.setdefault(*args)
def get(self, *args): return dictionary.get(*args)
def keys(self): return dictionary.keys()
def values(self): return dictionary.values()
def items(self): return dictionary.items()
def __iter__(self): return iter(dictionary)
def __getattr__(self, name):
return dictionary[name]
def __setattr__(self, name, value):
dictionary[name] = value
def setdefault(self, *args):
return dictionary.setdefault(*args)
def get(self, *args):
return dictionary.get(*args)
def keys(self):
return dictionary.keys()
def values(self):
return dictionary.values()
def items(self):
return dictionary.items()
def __iter__(self):
return iter(dictionary)
return wrapper()
class RequiredAttributeError(ValueError):
def __init__(self, message):
super(RequiredAttributeError, self).__init__(message)

View File

@@ -23,12 +23,13 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
"""LinkTree class for setting up trees of symbolic links."""
__all__ = ['LinkTree']
import os
import shutil
from llnl.util.filesystem import *
__all__ = ['LinkTree']
empty_file_name = '.spack-empty'
@@ -43,13 +44,13 @@ class LinkTree(object):
modified.
"""
def __init__(self, source_root):
if not os.path.exists(source_root):
raise IOError("No such file or directory: '%s'", source_root)
self._root = source_root
def find_conflict(self, dest_root, **kwargs):
"""Returns the first file in dest that conflicts with src"""
kwargs['follow_nonexisting'] = False
@@ -61,9 +62,9 @@ def find_conflict(self, dest_root, **kwargs):
return dest
return None
def merge(self, dest_root, **kwargs):
"""Link all files in src into dest, creating directories if necessary."""
"""Link all files in src into dest, creating directories
if necessary."""
kwargs['order'] = 'pre'
for src, dest in traverse_tree(self._root, dest_root, **kwargs):
if os.path.isdir(src):
@@ -83,7 +84,6 @@ def merge(self, dest_root, **kwargs):
assert(not os.path.exists(dest))
os.symlink(src, dest)
def unmerge(self, dest_root, **kwargs):
"""Unlink all files in dest that exist in src.

View File

@@ -28,6 +28,9 @@
import time
import socket
__all__ = ['Lock', 'LockTransaction', 'WriteTransaction', 'ReadTransaction',
'LockError']
# Default timeout in seconds, after which locks will raise exceptions.
_default_timeout = 60
@@ -36,13 +39,21 @@
class Lock(object):
def __init__(self,file_path):
"""This is an implementation of a filesystem lock using Python's lockf.
In Python, `lockf` actually calls `fcntl`, so this should work with any
filesystem implementation that supports locking through the fcntl calls.
This includes distributed filesystems like Lustre (when flock is enabled)
and recent NFS versions.
"""
def __init__(self, file_path):
self._file_path = file_path
self._fd = None
self._reads = 0
self._writes = 0
def _lock(self, op, timeout):
"""This takes a lock using POSIX locks (``fnctl.lockf``).
@@ -63,7 +74,9 @@ def _lock(self, op, timeout):
fcntl.lockf(self._fd, op | fcntl.LOCK_NB)
if op == fcntl.LOCK_EX:
os.write(self._fd, "pid=%s,host=%s" % (os.getpid(), socket.getfqdn()))
os.write(
self._fd,
"pid=%s,host=%s" % (os.getpid(), socket.getfqdn()))
return
except IOError as error:
@@ -75,7 +88,6 @@ def _lock(self, op, timeout):
raise LockError("Timed out waiting for lock.")
def _unlock(self):
"""Releases a lock using POSIX locks (``fcntl.lockf``)
@@ -83,11 +95,10 @@ def _unlock(self):
be masquerading as write locks, but this removes either.
"""
fcntl.lockf(self._fd,fcntl.LOCK_UN)
fcntl.lockf(self._fd, fcntl.LOCK_UN)
os.close(self._fd)
self._fd = None
def acquire_read(self, timeout=_default_timeout):
"""Acquires a recursive, shared lock for reading.
@@ -107,7 +118,6 @@ def acquire_read(self, timeout=_default_timeout):
self._reads += 1
return False
def acquire_write(self, timeout=_default_timeout):
"""Acquires a recursive, exclusive lock for writing.
@@ -127,7 +137,6 @@ def acquire_write(self, timeout=_default_timeout):
self._writes += 1
return False
def release_read(self):
"""Releases a read lock.
@@ -148,7 +157,6 @@ def release_read(self):
self._reads -= 1
return False
def release_write(self):
"""Releases a write lock.
@@ -170,6 +178,70 @@ def release_write(self):
return False
class LockTransaction(object):
"""Simple nested transaction context manager that uses a file lock.
This class can trigger actions when the lock is acquired for the
first time and released for the last.
If the acquire_fn returns a value, it is used as the return value for
__enter__, allowing it to be passed as the `as` argument of a `with`
statement.
If acquire_fn returns a context manager, *its* `__enter__` function will be
called in `__enter__` after acquire_fn, and its `__exit__` funciton will be
called before `release_fn` in `__exit__`, allowing you to nest a context
manager to be used along with the lock.
Timeout for lock is customizable.
"""
def __init__(self, lock, acquire_fn=None, release_fn=None,
timeout=_default_timeout):
self._lock = lock
self._timeout = timeout
self._acquire_fn = acquire_fn
self._release_fn = release_fn
self._as = None
def __enter__(self):
if self._enter() and self._acquire_fn:
self._as = self._acquire_fn()
if hasattr(self._as, '__enter__'):
return self._as.__enter__()
else:
return self._as
def __exit__(self, type, value, traceback):
suppress = False
if self._exit():
if self._as and hasattr(self._as, '__exit__'):
if self._as.__exit__(type, value, traceback):
suppress = True
if self._release_fn:
if self._release_fn(type, value, traceback):
suppress = True
return suppress
class ReadTransaction(LockTransaction):
def _enter(self):
return self._lock.acquire_read(self._timeout)
def _exit(self):
return self._lock.release_read()
class WriteTransaction(LockTransaction):
def _enter(self):
return self._lock.acquire_write(self._timeout)
def _exit(self):
return self._lock.release_write()
class LockError(Exception):
"""Raised when an attempt to acquire a lock times out."""
pass

View File

@@ -36,6 +36,7 @@
_verbose = False
indent = " "
def is_verbose():
return _verbose
@@ -64,12 +65,14 @@ def info(message, *args, **kwargs):
format = kwargs.get('format', '*b')
stream = kwargs.get('stream', sys.stdout)
wrap = kwargs.get('wrap', False)
break_long_words = kwargs.get('break_long_words', False)
cprint("@%s{==>} %s" % (format, cescape(str(message))), stream=stream)
for arg in args:
if wrap:
lines = textwrap.wrap(
str(arg), initial_indent=indent, subsequent_indent=indent)
str(arg), initial_indent=indent, subsequent_indent=indent,
break_long_words=break_long_words)
for line in lines:
stream.write(line + '\n')
else:
@@ -146,7 +149,8 @@ def get_yes_or_no(prompt, **kwargs):
elif default_value is False:
prompt += ' [y/N] '
else:
raise ValueError("default for get_yes_no() must be True, False, or None.")
raise ValueError(
"default for get_yes_no() must be True, False, or None.")
result = None
while result is None:
@@ -172,8 +176,9 @@ def hline(label=None, **kwargs):
char = kwargs.pop('char', '-')
max_width = kwargs.pop('max_width', 64)
if kwargs:
raise TypeError("'%s' is an invalid keyword argument for this function."
% next(kwargs.iterkeys()))
raise TypeError(
"'%s' is an invalid keyword argument for this function."
% next(kwargs.iterkeys()))
rows, cols = terminal_size()
if not cols:
@@ -198,7 +203,8 @@ def terminal_size():
"""Gets the dimensions of the console: (rows, cols)."""
def ioctl_GWINSZ(fd):
try:
rc = struct.unpack('hh', fcntl.ioctl(fd, termios.TIOCGWINSZ, '1234'))
rc = struct.unpack('hh', fcntl.ioctl(
fd, termios.TIOCGWINSZ, '1234'))
except:
return
return rc

View File

@@ -27,15 +27,14 @@
"""
import os
import sys
import fcntl
import termios
import struct
from StringIO import StringIO
from llnl.util.tty import terminal_size
from llnl.util.tty.color import clen, cextra
class ColumnConfig:
def __init__(self, cols):
self.cols = cols
self.line_length = 0
@@ -43,7 +42,8 @@ def __init__(self, cols):
self.widths = [0] * cols # does not include ansi colors
def __repr__(self):
attrs = [(a,getattr(self, a)) for a in dir(self) if not a.startswith("__")]
attrs = [(a, getattr(self, a))
for a in dir(self) if not a.startswith("__")]
return "<Config: %s>" % ", ".join("%s: %r" % a for a in attrs)
@@ -68,7 +68,7 @@ def config_variable_cols(elts, console_width, padding, cols=0):
max_cols = min(len(elts), max_cols)
# Range of column counts to try. If forced, use the supplied value.
col_range = [cols] if cols else xrange(1, max_cols+1)
col_range = [cols] if cols else xrange(1, max_cols + 1)
# Determine the most columns possible for the console width.
configs = [ColumnConfig(c) for c in col_range]
@@ -106,7 +106,6 @@ def config_uniform_cols(elts, console_width, padding, cols=0):
# 'clen' ignores length of ansi color sequences.
max_len = max(clen(e) for e in elts) + padding
max_clen = max(len(e) for e in elts) + padding
if cols == 0:
cols = max(1, console_width / max_len)
cols = min(len(elts), cols)
@@ -130,17 +129,19 @@ def colify(elts, **options):
output=<stream> A file object to write to. Default is sys.stdout.
indent=<int> Optionally indent all columns by some number of spaces.
padding=<int> Spaces between columns. Default is 2.
width=<int> Width of the output. Default is 80 if tty is not detected.
width=<int> Width of the output. Default is 80 if tty not detected.
cols=<int> Force number of columns. Default is to size to terminal,
or single-column if no tty
tty=<bool> Whether to attempt to write to a tty. Default is to
autodetect a tty. Set to False to force single-column output.
autodetect a tty. Set to False to force
single-column output.
method=<string> Method to use to fit columns. Options are variable or uniform.
Variable-width columns are tighter, uniform columns are all the
same width and fit less data on the screen.
method=<string> Method to use to fit columns. Options are variable or
uniform. Variable-width columns are tighter, uniform
columns are all the same width and fit less data on
the screen.
"""
# Get keyword arguments or set defaults
cols = options.pop("cols", 0)
@@ -152,8 +153,9 @@ def colify(elts, **options):
console_cols = options.pop("width", None)
if options:
raise TypeError("'%s' is an invalid keyword argument for this function."
% next(options.iterkeys()))
raise TypeError(
"'%s' is an invalid keyword argument for this function."
% next(options.iterkeys()))
# elts needs to be an array of strings so we can count the elements
elts = [str(elt) for elt in elts]
@@ -167,7 +169,8 @@ def colify(elts, **options):
r, c = env_size.split('x')
console_rows, console_cols = int(r), int(c)
tty = True
except: pass
except:
pass
# Use only one column if not a tty.
if not tty:
@@ -198,8 +201,13 @@ def colify(elts, **options):
for col in xrange(cols):
elt = col * rows + row
width = config.widths[col] + cextra(elts[elt])
fmt = '%%-%ds' % width
output.write(fmt % elts[elt])
if col < cols - 1:
fmt = '%%-%ds' % width
output.write(fmt % elts[elt])
else:
# Don't pad the rightmost column (sapces can wrap on
# small teriminals if one line is overlong)
output.write(elts[elt])
output.write("\n")
row += 1
@@ -223,6 +231,7 @@ def colify_table(table, **options):
raise ValueError("Table is empty in colify_table!")
columns = len(table[0])
def transpose():
for i in xrange(columns):
for row in table:

View File

@@ -75,25 +75,27 @@
import re
import sys
class ColorParseError(Exception):
"""Raised when a color format fails to parse."""
def __init__(self, message):
super(ColorParseError, self).__init__(message)
# Text styles for ansi codes
styles = {'*' : '1', # bold
'_' : '4', # underline
None : '0' } # plain
styles = {'*': '1', # bold
'_': '4', # underline
None: '0'} # plain
# Dim and bright ansi colors
colors = {'k' : 30, 'K' : 90, # black
'r' : 31, 'R' : 91, # red
'g' : 32, 'G' : 92, # green
'y' : 33, 'Y' : 93, # yellow
'b' : 34, 'B' : 94, # blue
'm' : 35, 'M' : 95, # magenta
'c' : 36, 'C' : 96, # cyan
'w' : 37, 'W' : 97 } # white
colors = {'k': 30, 'K': 90, # black
'r': 31, 'R': 91, # red
'g': 32, 'G': 92, # green
'y': 33, 'Y': 93, # yellow
'b': 34, 'B': 94, # blue
'm': 35, 'M': 95, # magenta
'c': 36, 'C': 96, # cyan
'w': 37, 'W': 97} # white
# Regex to be used for color formatting
color_re = r'@(?:@|\.|([*_])?([a-zA-Z])?(?:{((?:[^}]|}})*)})?)'
@@ -104,6 +106,7 @@ def __init__(self, message):
class match_to_ansi(object):
def __init__(self, color=True):
self.color = color
@@ -179,12 +182,14 @@ def cprint(string, stream=sys.stdout, color=None):
"""Same as cwrite, but writes a trailing newline to the stream."""
cwrite(string + "\n", stream, color)
def cescape(string):
"""Replace all @ with @@ in the string provided."""
return str(string).replace('@', '@@')
class ColorStream(object):
def __init__(self, stream, color=None):
self._stream = stream
self._color = color
@@ -196,7 +201,7 @@ def write(self, string, **kwargs):
color = self._color
if self._color is None:
if raw:
color=True
color = True
else:
color = self._stream.isatty() or _force_color
raw_write(colorize(string, color=color))

View File

@@ -36,6 +36,7 @@
# Use this to strip escape sequences
_escape = re.compile(r'\x1b[^m]*m|\x1b\[?1034h')
def _strip(line):
"""Strip color and control characters from a line."""
return _escape.sub('', line)
@@ -58,10 +59,10 @@ class keyboard_input(object):
When the with block completes, this will restore settings before
canonical and echo were disabled.
"""
def __init__(self, stream):
self.stream = stream
def __enter__(self):
self.old_cfg = None
@@ -86,10 +87,9 @@ def __enter__(self):
# Apply new settings for terminal
termios.tcsetattr(fd, termios.TCSADRAIN, self.new_cfg)
except Exception, e:
except Exception:
pass # Some OS's do not support termios, so ignore.
def __exit__(self, exc_type, exception, traceback):
# If termios was avaialble, restore old settings after the
# with block
@@ -114,6 +114,7 @@ class log_output(object):
Closes the provided stream when done with the block.
If echo is True, also prints the output to stdout.
"""
def __init__(self, stream, echo=False, force_color=False, debug=False):
self.stream = stream
@@ -122,7 +123,7 @@ def __init__(self, stream, echo=False, force_color=False, debug=False):
self.force_color = force_color
self.debug = debug
# Default is to try file-descriptor reassignment unless the system
# Default is to try file-descriptor reassignment unless the system
# out/err streams do not have an associated file descriptor
self.directAssignment = False
@@ -130,7 +131,6 @@ def trace(self, frame, event, arg):
"""Jumps to __exit__ on the child process."""
raise _SkipWithBlock()
def __enter__(self):
"""Redirect output from the with block to a file.
@@ -154,7 +154,8 @@ def __enter__(self):
with self.stream as log_file:
with keyboard_input(sys.stdin):
while True:
rlist, w, x = select.select([read_file, sys.stdin], [], [])
rlist, w, x = select.select(
[read_file, sys.stdin], [], [])
if not rlist:
break
@@ -211,7 +212,6 @@ def __enter__(self):
if self.debug:
tty._debug = True
def __exit__(self, exc_type, exception, traceback):
"""Exits on child, handles skipping the with block on parent."""
# Child should just exit here.
@@ -235,7 +235,7 @@ def __exit__(self, exc_type, exception, traceback):
sys.stderr = self._stderr
else:
os.dup2(self._stdout, sys.stdout.fileno())
os.dup2(self._stderr, sys.stderr.fileno())
os.dup2(self._stderr, sys.stderr.fileno())
return False

View File

@@ -1,3 +1,4 @@
# flake8: noqa
##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
@@ -39,13 +40,26 @@
lib_path = join_path(spack_root, "lib", "spack")
build_env_path = join_path(lib_path, "env")
module_path = join_path(lib_path, "spack")
platform_path = join_path(module_path, 'platforms')
compilers_path = join_path(module_path, "compilers")
operating_system_path = join_path(module_path, 'operating_systems')
test_path = join_path(module_path, "test")
hooks_path = join_path(module_path, "hooks")
var_path = join_path(spack_root, "var", "spack")
stage_path = join_path(var_path, "stage")
repos_path = join_path(var_path, "repos")
share_path = join_path(spack_root, "share", "spack")
cache_path = join_path(var_path, "cache")
# User configuration location
user_config_path = os.path.expanduser('~/.spack')
import spack.fetch_strategy
fetch_cache = spack.fetch_strategy.FsCache(cache_path)
from spack.file_cache import FileCache
user_cache_path = join_path(user_config_path, 'cache')
user_cache = FileCache(user_cache_path)
prefix = spack_root
opt_path = join_path(prefix, "opt")
@@ -105,7 +119,7 @@
# Version information
from spack.version import Version
spack_version = Version("0.9")
spack_version = Version("0.9.1")
#
# Executables used by Spack
@@ -134,7 +148,7 @@
_tmp_candidates = (_default_tmp, '/nfs/tmp2', '/tmp', '/var/tmp')
for path in _tmp_candidates:
# don't add a second username if it's already unique by user.
if not _tmp_user in path:
if _tmp_user not in path:
tmp_dirs.append(join_path(path, '%u', 'spack-stage'))
else:
tmp_dirs.append(join_path(path, 'spack-stage'))
@@ -166,13 +180,17 @@
# Spack internal code should call 'import spack' and accesses other
# variables (spack.repo, paths, etc.) directly.
#
# TODO: maybe this should be separated out and should go in build_environment.py?
# TODO: it's not clear where all the stuff that needs to be included in packages
# should live. This file is overloaded for spack core vs. for packages.
# TODO: maybe this should be separated out to build_environment.py?
# TODO: it's not clear where all the stuff that needs to be included in
# packages should live. This file is overloaded for spack core vs.
# for packages.
#
__all__ = ['Package', 'Version', 'when', 'ver']
__all__ = ['Package', 'StagedPackage', 'CMakePackage',
'Version', 'when', 'ver', 'alldeps', 'nolink']
from spack.package import Package, ExtensionConflictError
from spack.package import StagedPackage, CMakePackage
from spack.version import Version, ver
from spack.spec import DependencySpec, alldeps, nolink
from spack.multimethod import when
import llnl.util.filesystem
@@ -188,8 +206,8 @@
__all__ += spack.util.executable.__all__
from spack.package import \
install_dependency_symlinks, flatten_dependencies, DependencyConflictError, \
InstallError, ExternalPackageError
install_dependency_symlinks, flatten_dependencies, \
DependencyConflictError, InstallError, ExternalPackageError
__all__ += [
'install_dependency_symlinks', 'flatten_dependencies', 'DependencyConflictError',
'InstallError', 'ExternalPackageError']
'install_dependency_symlinks', 'flatten_dependencies',
'DependencyConflictError', 'InstallError', 'ExternalPackageError']

View File

@@ -30,14 +30,15 @@
from spack.util.executable import Executable, ProcessError
from llnl.util.lang import memoized
class ABI(object):
"""This class provides methods to test ABI compatibility between specs.
The current implementation is rather rough and could be improved."""
def architecture_compatible(self, parent, child):
"""Returns true iff the parent and child specs have ABI compatible architectures."""
return not parent.architecture or not child.architecture or parent.architecture == child.architecture
"""Return true if parent and child have ABI compatible targets."""
return not parent.architecture or not child.architecture or \
parent.architecture == child.architecture
@memoized
def _gcc_get_libstdcxx_version(self, version):
@@ -60,8 +61,9 @@ def _gcc_get_libstdcxx_version(self, version):
else:
return None
try:
output = rungcc("--print-file-name=%s" % libname, return_output=True)
except ProcessError, e:
output = rungcc("--print-file-name=%s" % libname,
return_output=True)
except ProcessError:
return None
if not output:
return None
@@ -70,7 +72,6 @@ def _gcc_get_libstdcxx_version(self, version):
return None
return os.path.basename(libpath)
@memoized
def _gcc_compiler_compare(self, pversion, cversion):
"""Returns true iff the gcc version pversion and cversion
@@ -81,7 +82,6 @@ def _gcc_compiler_compare(self, pversion, cversion):
return False
return plib == clib
def _intel_compiler_compare(self, pversion, cversion):
"""Returns true iff the intel version pversion and cversion
are ABI compatible"""
@@ -91,9 +91,8 @@ def _intel_compiler_compare(self, pversion, cversion):
return False
return pversion.version[:2] == cversion.version[:2]
def compiler_compatible(self, parent, child, **kwargs):
"""Returns true iff the compilers for parent and child specs are ABI compatible"""
"""Return true if compilers for parent and child are ABI compatible."""
if not parent.compiler or not child.compiler:
return True
@@ -108,8 +107,8 @@ def compiler_compatible(self, parent, child, **kwargs):
# TODO: into compiler classes?
for pversion in parent.compiler.versions:
for cversion in child.compiler.versions:
# For a few compilers use specialized comparisons. Otherwise
# match on version match.
# For a few compilers use specialized comparisons.
# Otherwise match on version match.
if pversion.satisfies(cversion):
return True
elif (parent.compiler.name == "gcc" and
@@ -120,9 +119,8 @@ def compiler_compatible(self, parent, child, **kwargs):
return True
return False
def compatible(self, parent, child, **kwargs):
"""Returns true iff a parent and child spec are ABI compatible"""
loosematch = kwargs.get('loose', False)
return self.architecture_compatible(parent, child) and \
self.compiler_compatible(parent, child, loose=loosematch)
self.compiler_compatible(parent, child, loose=loosematch)

View File

@@ -22,68 +22,523 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import os
import re
import platform
"""
This module contains all the elements that are required to create an
architecture object. These include, the target processor, the operating system,
and the architecture platform (i.e. cray, darwin, linux, bgq, etc) classes.
from llnl.util.lang import memoized
On a multiple architecture machine, the architecture spec field can be set to
build a package against any target and operating system that is present on the
platform. On Cray platforms or any other architecture that has different front
and back end environments, the operating system will determine the method of
compiler
detection.
There are two different types of compiler detection:
1. Through the $PATH env variable (front-end detection)
2. Through the tcl module system. (back-end detection)
Depending on which operating system is specified, the compiler will be detected
using one of those methods.
For platforms such as linux and darwin, the operating system is autodetected
and the target is set to be x86_64.
The command line syntax for specifying an architecture is as follows:
target=<Target name> os=<OperatingSystem name>
If the user wishes to use the defaults, either target or os can be left out of
the command line and Spack will concretize using the default. These defaults
are set in the 'platforms/' directory which contains the different subclasses
for platforms. If the machine has multiple architectures, the user can
also enter front-end, or fe or back-end or be. These settings will concretize
to their respective front-end and back-end targets and operating systems.
Additional platforms can be added by creating a subclass of Platform
and adding it inside the platform directory.
Platforms are an abstract class that are extended by subclasses. If the user
wants to add a new type of platform (such as cray_xe), they can create a
subclass and set all the class attributes such as priority, front_target,
back_target, front_os, back_os. Platforms also contain a priority class
attribute. A lower number signifies higher priority. These numbers are
arbitrarily set and can be changed though often there isn't much need unless a
new platform is added and the user wants that to be detected first.
Targets are created inside the platform subclasses. Most architecture
(like linux, and darwin) will have only one target (x86_64) but in the case of
Cray machines, there is both a frontend and backend processor. The user can
specify which targets are present on front-end and back-end architecture
Depending on the platform, operating systems are either auto-detected or are
set. The user can set the front-end and back-end operating setting by the class
attributes front_os and back_os. The operating system as described earlier,
will be responsible for compiler detection.
"""
import os
import inspect
from llnl.util.lang import memoized, list_modules, key_ordering
from llnl.util.filesystem import join_path
import llnl.util.tty as tty
import spack
import spack.compilers
from spack.util.naming import mod_to_class
from spack.util.environment import get_path
from spack.util.multiproc import parmap
import spack.error as serr
class InvalidSysTypeError(serr.SpackError):
def __init__(self, sys_type):
super(InvalidSysTypeError,
self).__init__("Invalid sys_type value for Spack: " + sys_type)
class NoPlatformError(serr.SpackError):
class NoSysTypeError(serr.SpackError):
def __init__(self):
super(NoSysTypeError,
self).__init__("Could not determine sys_type for this machine.")
super(NoPlatformError, self).__init__(
"Could not determine a platform for this machine.")
def get_sys_type_from_spack_globals():
"""Return the SYS_TYPE from spack globals, or None if it isn't set."""
if not hasattr(spack, "sys_type"):
return None
elif hasattr(spack.sys_type, "__call__"):
return spack.sys_type()
@key_ordering
class Target(object):
""" Target is the processor of the host machine.
The host machine may have different front-end and back-end targets,
especially if it is a Cray machine. The target will have a name and
also the module_name (e.g craype-compiler). Targets will also
recognize which platform they came from using the set_platform method.
Targets will have compiler finding strategies
"""
def __init__(self, name, module_name=None):
self.name = name # case of cray "ivybridge" but if it's x86_64
self.module_name = module_name # craype-ivybridge
# Sets only the platform name to avoid recursiveness
def _cmp_key(self):
return (self.name, self.module_name)
def __repr__(self):
return self.__str__()
def __str__(self):
return self.name
@key_ordering
class Platform(object):
""" Abstract class that each type of Platform will subclass.
Will return a instance of it once it
is returned
"""
priority = None # Subclass sets number. Controls detection order
front_end = None
back_end = None
default = None # The default back end target. On cray ivybridge
front_os = None
back_os = None
default_os = None
def __init__(self, name):
self.targets = {}
self.operating_sys = {}
self.name = name
def add_target(self, name, target):
"""Used by the platform specific subclass to list available targets.
Raises an error if the platform specifies a name
that is reserved by spack as an alias.
"""
if name in ['frontend', 'fe', 'backend', 'be', 'default_target']:
raise ValueError(
"%s is a spack reserved alias "
"and cannot be the name of a target" % name)
self.targets[name] = target
def target(self, name):
"""This is a getter method for the target dictionary
that handles defaulting based on the values provided by default,
front-end, and back-end. This can be overwritten
by a subclass for which we want to provide further aliasing options.
"""
if name == 'default_target':
name = self.default
elif name == 'frontend' or name == 'fe':
name = self.front_end
elif name == 'backend' or name == 'be':
name = self.back_end
return self.targets.get(name, None)
def add_operating_system(self, name, os_class):
""" Add the operating_system class object into the
platform.operating_sys dictionary
"""
if name in ['frontend', 'fe', 'backend', 'be', 'default_os']:
raise ValueError(
"%s is a spack reserved alias "
"and cannot be the name of an OS" % name)
self.operating_sys[name] = os_class
def operating_system(self, name):
if name == 'default_os':
name = self.default_os
if name == 'frontend' or name == "fe":
name = self.front_os
if name == 'backend' or name == 'be':
name = self.back_os
return self.operating_sys.get(name, None)
@classmethod
def setup_platform_environment(self, pkg, env):
""" Subclass can override this method if it requires any
platform-specific build environment modifications.
"""
pass
@classmethod
def detect(self):
""" Subclass is responsible for implementing this method.
Returns True if the Platform class detects that
it is the current platform
and False if it's not.
"""
raise NotImplementedError()
def __repr__(self):
return self.__str__()
def __str__(self):
return self.name
def _cmp_key(self):
t_keys = ''.join(str(t._cmp_key()) for t in
sorted(self.targets.values()))
o_keys = ''.join(str(o._cmp_key()) for o in
sorted(self.operating_sys.values()))
return (self.name,
self.default,
self.front_end,
self.back_end,
self.default_os,
self.front_os,
self.back_os,
t_keys,
o_keys)
@key_ordering
class OperatingSystem(object):
""" Operating System will be like a class similar to platform extended
by subclasses for the specifics. Operating System will contain the
compiler finding logic. Instead of calling two separate methods to
find compilers we call find_compilers method for each operating system
"""
def __init__(self, name, version):
self.name = name
self.version = version
def __str__(self):
return self.name + self.version
def __repr__(self):
return self.__str__()
def _cmp_key(self):
return (self.name, self.version)
def find_compilers(self, *paths):
"""
Return a list of compilers found in the suppied paths.
This invokes the find() method for each Compiler class,
and appends the compilers detected to a list.
"""
if not paths:
paths = get_path('PATH')
# Make sure path elements exist, and include /bin directories
# under prefixes.
filtered_path = []
for p in paths:
# Eliminate symlinks and just take the real directories.
p = os.path.realpath(p)
if not os.path.isdir(p):
continue
filtered_path.append(p)
# Check for a bin directory, add it if it exists
bin = join_path(p, 'bin')
if os.path.isdir(bin):
filtered_path.append(os.path.realpath(bin))
# Once the paths are cleaned up, do a search for each type of
# compiler. We can spawn a bunch of parallel searches to reduce
# the overhead of spelunking all these directories.
types = spack.compilers.all_compiler_types()
compiler_lists = parmap(lambda cmp_cls:
self.find_compiler(cmp_cls, *filtered_path),
types)
# ensure all the version calls we made are cached in the parent
# process, as well. This speeds up Spack a lot.
clist = reduce(lambda x, y: x + y, compiler_lists)
return clist
def find_compiler(self, cmp_cls, *path):
"""Try to find the given type of compiler in the user's
environment. For each set of compilers found, this returns
compiler objects with the cc, cxx, f77, fc paths and the
version filled in.
This will search for compilers with the names in cc_names,
cxx_names, etc. and it will group them if they have common
prefixes, suffixes, and versions. e.g., gcc-mp-4.7 would
be grouped with g++-mp-4.7 and gfortran-mp-4.7.
"""
dicts = parmap(
lambda t: cmp_cls._find_matches_in_path(*t),
[(cmp_cls.cc_names, cmp_cls.cc_version) + tuple(path),
(cmp_cls.cxx_names, cmp_cls.cxx_version) + tuple(path),
(cmp_cls.f77_names, cmp_cls.f77_version) + tuple(path),
(cmp_cls.fc_names, cmp_cls.fc_version) + tuple(path)])
all_keys = set()
for d in dicts:
all_keys.update(d)
compilers = {}
for k in all_keys:
ver, pre, suf = k
# Skip compilers with unknown version.
if ver == 'unknown':
continue
paths = tuple(pn[k] if k in pn else None for pn in dicts)
spec = spack.spec.CompilerSpec(cmp_cls.name, ver)
if ver in compilers:
prev = compilers[ver]
# prefer the one with more compilers.
prev_paths = [prev.cc, prev.cxx, prev.f77, prev.fc]
newcount = len([p for p in paths if p is not None])
prevcount = len([p for p in prev_paths if p is not None])
# Don't add if it's not an improvement over prev compiler.
if newcount <= prevcount:
continue
compilers[ver] = cmp_cls(spec, self, paths)
return list(compilers.values())
def to_dict(self):
d = {}
d['name'] = self.name
d['version'] = self.version
return d
@key_ordering
class Arch(object):
"""Architecture is now a class to help with setting attributes.
TODO: refactor so that we don't need this class.
"""
def __init__(self, plat=None, os=None, target=None):
self.platform = plat
if plat and os:
os = self.platform.operating_system(os)
self.platform_os = os
if plat and target:
target = self.platform.target(target)
self.target = target
# Hooks for parser to use when platform is set after target or os
self.target_string = None
self.os_string = None
@property
def concrete(self):
return all((self.platform is not None,
isinstance(self.platform, Platform),
self.platform_os is not None,
isinstance(self.platform_os, OperatingSystem),
self.target is not None, isinstance(self.target, Target)))
def __str__(self):
if self.platform or self.platform_os or self.target:
if self.platform.name == 'darwin':
os_name = self.platform_os.name if self.platform_os else "None"
else:
os_name = str(self.platform_os)
return (str(self.platform) + "-" +
os_name + "-" + str(self.target))
else:
return ''
def __contains__(self, string):
return string in str(self)
# TODO: make this unnecessary: don't include an empty arch on *every* spec.
def __nonzero__(self):
return (self.platform is not None or
self.platform_os is not None or
self.target is not None)
__bool__ = __nonzero__
def _cmp_key(self):
if isinstance(self.platform, Platform):
platform = self.platform.name
else:
platform = self.platform
if isinstance(self.platform_os, OperatingSystem):
platform_os = self.platform_os.name
else:
platform_os = self.platform_os
if isinstance(self.target, Target):
target = self.target.name
else:
target = self.target
return (platform, platform_os, target)
def to_dict(self):
d = {}
d['platform'] = str(self.platform) if self.platform else None
d['platform_os'] = str(self.platform_os) if self.platform_os else None
d['target'] = str(self.target) if self.target else None
return d
def _target_from_dict(target_name, plat=None):
""" Creates new instance of target and assigns all the attributes of
that target from the dictionary
"""
if not plat:
plat = platform()
return plat.target(target_name)
def _operating_system_from_dict(os_name, plat=None):
""" uses platform's operating system method to grab the constructed
operating systems that are valid on the platform.
"""
if not plat:
plat = platform()
if isinstance(os_name, dict):
name = os_name['name']
version = os_name['version']
return plat.operating_system(name + version)
else:
return spack.sys_type
return plat.operating_system(os_name)
def get_sys_type_from_environment():
"""Return $SYS_TYPE or None if it's not defined."""
return os.environ.get('SYS_TYPE')
def _platform_from_dict(platform_name):
""" Constructs a platform from a dictionary. """
platform_list = all_platforms()
for p in platform_list:
if platform_name.replace("_", "").lower() == p.__name__.lower():
return p()
def get_sys_type_from_platform():
"""Return the architecture from Python's platform module."""
sys_type = platform.system() + '-' + platform.machine()
sys_type = re.sub(r'[^\w-]', '_', sys_type)
return sys_type.lower()
def arch_from_dict(d):
""" Uses _platform_from_dict, _operating_system_from_dict, _target_from_dict
helper methods to recreate the arch tuple from the dictionary read from
a yaml file
"""
arch = Arch()
if isinstance(d, basestring):
# We have an old spec using a string for the architecture
arch.platform = Platform('spack_compatibility')
arch.platform_os = OperatingSystem('unknown', '')
arch.target = Target(d)
arch.os_string = None
arch.target_string = None
else:
if d is None:
return None
platform_name = d['platform']
os_name = d['platform_os']
target_name = d['target']
if platform_name:
arch.platform = _platform_from_dict(platform_name)
else:
arch.platform = None
if target_name:
arch.target = _target_from_dict(target_name, arch.platform)
else:
arch.target = None
if os_name:
arch.platform_os = _operating_system_from_dict(os_name,
arch.platform)
else:
arch.platform_os = None
arch.os_string = None
arch.target_string = None
return arch
@memoized
def all_platforms():
classes = []
mod_path = spack.platform_path
parent_module = "spack.platforms"
for name in list_modules(mod_path):
mod_name = '%s.%s' % (parent_module, name)
class_name = mod_to_class(name)
mod = __import__(mod_name, fromlist=[class_name])
if not hasattr(mod, class_name):
tty.die('No class %s defined in %s' % (class_name, mod_name))
cls = getattr(mod, class_name)
if not inspect.isclass(cls):
tty.die('%s.%s is not a class' % (mod_name, class_name))
classes.append(cls)
return classes
@memoized
def platform():
"""Detects the platform for this machine.
Gather a list of all available subclasses of platforms.
Sorts the list according to their priority looking. Priority is
an arbitrarily set number. Detects platform either using uname or
a file path (/opt/cray...)
"""
# Try to create a Platform object using the config file FIRST
platform_list = all_platforms()
platform_list.sort(key=lambda a: a.priority)
for platform_cls in platform_list:
if platform_cls.detect():
return platform_cls()
@memoized
def sys_type():
"""Returns a SysType for the current machine."""
methods = [get_sys_type_from_spack_globals, get_sys_type_from_environment,
get_sys_type_from_platform]
"""Print out the "default" platform-os-target tuple for this machine.
# search for a method that doesn't return None
sys_type = None
for method in methods:
sys_type = method()
if sys_type:
break
On machines with only one target OS/target, prints out the
platform-os-target for the frontend. For machines with a frontend
and a backend, prints the default backend.
# Couldn't determine the sys_type for this machine.
if sys_type is None:
return "unknown_arch"
TODO: replace with use of more explicit methods to get *all* the
backends, as client code should really be aware of cross-compiled
architectures.
if not isinstance(sys_type, basestring):
raise InvalidSysTypeError(sys_type)
return sys_type
"""
arch = Arch(platform(), 'default_os', 'default_target')
return str(arch)

View File

@@ -51,15 +51,16 @@
Skimming this module is a nice way to get acquainted with the types of
calls you can make from within the install() function.
"""
import multiprocessing
import os
import platform
import shutil
import sys
import shutil
import multiprocessing
import platform
import spack
import llnl.util.tty as tty
from llnl.util.filesystem import *
import spack
from spack.environment import EnvironmentModifications, validate
from spack.util.environment import *
from spack.util.executable import Executable, which
@@ -74,20 +75,19 @@
# set_build_environment_variables and used to pass parameters to
# Spack's compiler wrappers.
#
SPACK_ENV_PATH = 'SPACK_ENV_PATH'
SPACK_DEPENDENCIES = 'SPACK_DEPENDENCIES'
SPACK_PREFIX = 'SPACK_PREFIX'
SPACK_INSTALL = 'SPACK_INSTALL'
SPACK_DEBUG = 'SPACK_DEBUG'
SPACK_SHORT_SPEC = 'SPACK_SHORT_SPEC'
SPACK_DEBUG_LOG_DIR = 'SPACK_DEBUG_LOG_DIR'
SPACK_ENV_PATH = 'SPACK_ENV_PATH'
SPACK_DEPENDENCIES = 'SPACK_DEPENDENCIES'
SPACK_PREFIX = 'SPACK_PREFIX'
SPACK_INSTALL = 'SPACK_INSTALL'
SPACK_DEBUG = 'SPACK_DEBUG'
SPACK_SHORT_SPEC = 'SPACK_SHORT_SPEC'
SPACK_DEBUG_LOG_DIR = 'SPACK_DEBUG_LOG_DIR'
# Platform-specific library suffix.
dso_suffix = 'dylib' if sys.platform == 'darwin' else 'so'
class MakeExecutable(Executable):
"""Special callable executable object for make so the user can
specify parallel or not on a per-invocation basis. Using
@@ -98,6 +98,7 @@ class MakeExecutable(Executable):
Note that if the SPACK_NO_PARALLEL_MAKE env var is set it overrides
everything.
"""
def __init__(self, name, jobs):
super(MakeExecutable, self).__init__(name)
self.jobs = jobs
@@ -113,30 +114,95 @@ def __call__(self, *args, **kwargs):
return super(MakeExecutable, self).__call__(*args, **kwargs)
def load_module(mod):
"""Takes a module name and removes modules until it is possible to
load that module. It then loads the provided module. Depends on the
modulecmd implementation of modules used in cray and lmod.
"""
# Create an executable of the module command that will output python code
modulecmd = which('modulecmd')
modulecmd.add_default_arg('python')
# Read the module and remove any conflicting modules
# We do this without checking that they are already installed
# for ease of programming because unloading a module that is not
# loaded does nothing.
text = modulecmd('show', mod, output=str, error=str).split()
for i, word in enumerate(text):
if word == 'conflict':
exec(compile(modulecmd('unload', text[i + 1], output=str,
error=str), '<string>', 'exec'))
# Load the module now that there are no conflicts
load = modulecmd('load', mod, output=str, error=str)
exec(compile(load, '<string>', 'exec'))
def get_path_from_module(mod):
"""Inspects a TCL module for entries that indicate the absolute path
at which the library supported by said module can be found.
"""
# Create a modulecmd executable
modulecmd = which('modulecmd')
modulecmd.add_default_arg('python')
# Read the module
text = modulecmd('show', mod, output=str, error=str).split('\n')
# If it lists its package directory, return that
for line in text:
if line.find(mod.upper() + '_DIR') >= 0:
words = line.split()
return words[2]
# If it lists a -rpath instruction, use that
for line in text:
rpath = line.find('-rpath/')
if rpath >= 0:
return line[rpath + 6:line.find('/lib')]
# If it lists a -L instruction, use that
for line in text:
L = line.find('-L/')
if L >= 0:
return line[L + 2:line.find('/lib')]
# If it sets the LD_LIBRARY_PATH or CRAY_LD_LIBRARY_PATH, use that
for line in text:
if line.find('LD_LIBRARY_PATH') >= 0:
words = line.split()
path = words[2]
return path[:path.find('/lib')]
# Unable to find module path
return None
def set_compiler_environment_variables(pkg, env):
assert pkg.spec.concrete
assert(pkg.spec.concrete)
compiler = pkg.compiler
flags = pkg.spec.compiler_flags
# Set compiler variables used by CMake and autotools
assert all(key in pkg.compiler.link_paths for key in ('cc', 'cxx', 'f77', 'fc'))
assert all(key in compiler.link_paths for key in (
'cc', 'cxx', 'f77', 'fc'))
# Populate an object with the list of environment modifications
# and return it
# TODO : add additional kwargs for better diagnostics, like requestor, ttyout, ttyerr, etc.
# TODO : add additional kwargs for better diagnostics, like requestor,
# ttyout, ttyerr, etc.
link_dir = spack.build_env_path
env.set('CC', join_path(link_dir, pkg.compiler.link_paths['cc']))
env.set('CXX', join_path(link_dir, pkg.compiler.link_paths['cxx']))
env.set('F77', join_path(link_dir, pkg.compiler.link_paths['f77']))
env.set('FC', join_path(link_dir, pkg.compiler.link_paths['fc']))
# Set SPACK compiler variables so that our wrapper knows what to call
compiler = pkg.compiler
if compiler.cc:
env.set('SPACK_CC', compiler.cc)
env.set('SPACK_CC', compiler.cc)
env.set('CC', join_path(link_dir, compiler.link_paths['cc']))
if compiler.cxx:
env.set('SPACK_CXX', compiler.cxx)
env.set('CXX', join_path(link_dir, compiler.link_paths['cxx']))
if compiler.f77:
env.set('SPACK_F77', compiler.f77)
env.set('F77', join_path(link_dir, compiler.link_paths['f77']))
if compiler.fc:
env.set('SPACK_FC', compiler.fc)
env.set('FC', join_path(link_dir, compiler.link_paths['fc']))
# Set SPACK compiler rpath flags so that our wrapper knows what to use
env.set('SPACK_CC_RPATH_ARG', compiler.cc_rpath_arg)
@@ -144,13 +210,26 @@ def set_compiler_environment_variables(pkg, env):
env.set('SPACK_F77_RPATH_ARG', compiler.f77_rpath_arg)
env.set('SPACK_FC_RPATH_ARG', compiler.fc_rpath_arg)
# Add every valid compiler flag to the environment, prefixed with "SPACK_"
for flag in spack.spec.FlagMap.valid_compiler_flags():
# Concreteness guarantees key safety here
if flags[flag] != []:
env.set('SPACK_' + flag.upper(), ' '.join(f for f in flags[flag]))
env.set('SPACK_COMPILER_SPEC', str(pkg.spec.compiler))
for mod in compiler.modules:
load_module(mod)
return env
def set_build_environment_variables(pkg, env):
def set_build_environment_variables(pkg, env, dirty=False):
"""
This ensures a clean install environment when we build packages
This ensures a clean install environment when we build packages.
Arguments:
dirty -- skip unsetting the user's environment settings.
"""
# Add spack build environment path with compiler wrappers first in
# the path. We add both spack.env_path, which includes default
@@ -163,7 +242,8 @@ def set_build_environment_variables(pkg, env):
# handled by putting one in the <build_env_path>/case-insensitive
# directory. Add that to the path too.
env_paths = []
for item in [spack.build_env_path, join_path(spack.build_env_path, pkg.compiler.name)]:
compiler_specific = join_path(spack.build_env_path, pkg.compiler.name)
for item in [spack.build_env_path, compiler_specific]:
env_paths.append(item)
ci = join_path(item, 'case-insensitive')
if os.path.isdir(ci):
@@ -174,9 +254,11 @@ def set_build_environment_variables(pkg, env):
env.set_path(SPACK_ENV_PATH, env_paths)
# Prefixes of all of the package's dependencies go in SPACK_DEPENDENCIES
dep_prefixes = [d.prefix for d in pkg.spec.traverse(root=False)]
dep_prefixes = [d.prefix
for d in pkg.spec.traverse(root=False, deptype='build')]
env.set_path(SPACK_DEPENDENCIES, dep_prefixes)
env.set_path('CMAKE_PREFIX_PATH', dep_prefixes) # Add dependencies to CMAKE_PREFIX_PATH
# Add dependencies to CMAKE_PREFIX_PATH
env.set_path('CMAKE_PREFIX_PATH', dep_prefixes)
# Install prefix
env.set(SPACK_PREFIX, pkg.prefix)
@@ -184,15 +266,30 @@ def set_build_environment_variables(pkg, env):
# Install root prefix
env.set(SPACK_INSTALL, spack.install_path)
# Remove these vars from the environment during build because they
# can affect how some packages find libraries. We want to make
# sure that builds never pull in unintended external dependencies.
env.unset('LD_LIBRARY_PATH')
env.unset('LD_RUN_PATH')
env.unset('DYLD_LIBRARY_PATH')
# Stuff in here sanitizes the build environemnt to eliminate
# anything the user has set that may interfere.
if not dirty:
# Remove these vars from the environment during build because they
# can affect how some packages find libraries. We want to make
# sure that builds never pull in unintended external dependencies.
env.unset('LD_LIBRARY_PATH')
env.unset('LIBRARY_PATH')
env.unset('CPATH')
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]))
bin_dirs = reversed(
filter(os.path.isdir, ['%s/bin' % prefix for prefix in dep_prefixes]))
for item in bin_dirs:
env.prepend_path('PATH', item)
@@ -203,13 +300,14 @@ def set_build_environment_variables(pkg, env):
env.set(SPACK_DEBUG_LOG_DIR, spack.spack_working_dir)
# Add any pkgconfig directories to PKG_CONFIG_PATH
pkg_config_dirs = []
for p in dep_prefixes:
for maybe in ('lib', 'lib64', 'share'):
pcdir = join_path(p, maybe, 'pkgconfig')
for pre in dep_prefixes:
for directory in ('lib', 'lib64', 'share'):
pcdir = join_path(pre, directory, 'pkgconfig')
if os.path.isdir(pcdir):
pkg_config_dirs.append(pcdir)
env.set_path('PKG_CONFIG_PATH', pkg_config_dirs)
env.prepend_path('PKG_CONFIG_PATH', pcdir)
if pkg.spec.architecture.target.module_name:
load_module(pkg.spec.architecture.target.module_name)
return env
@@ -218,7 +316,7 @@ def set_module_variables_for_package(pkg, module):
"""Populate the module scope of install() with some useful functions.
This makes things easier for package writers.
"""
# number of jobs spack will to build with.
# number of jobs spack will build with.
jobs = multiprocessing.cpu_count()
if not pkg.parallel:
jobs = 1
@@ -229,8 +327,9 @@ def set_module_variables_for_package(pkg, module):
m.make_jobs = jobs
# TODO: make these build deps that can be installed if not found.
m.make = MakeExecutable('make', jobs)
m.make = MakeExecutable('make', jobs)
m.gmake = MakeExecutable('gmake', jobs)
m.scons = MakeExecutable('scons', jobs)
# easy shortcut to os.environ
m.env = os.environ
@@ -239,11 +338,8 @@ def set_module_variables_for_package(pkg, module):
# Don't use which for this; we want to find it in the current dir.
m.configure = Executable('./configure')
# TODO: shouldn't really use "which" here. Consider adding notion
# TODO: of build dependencies, as opposed to link dependencies.
# TODO: Currently, everything is a link dependency, but tools like
# TODO: this shouldn't be.
m.cmake = Executable('cmake')
m.ctest = Executable('ctest')
# standard CMake arguments
m.std_cmake_args = ['-DCMAKE_INSTALL_PREFIX=%s' % pkg.prefix,
@@ -253,33 +349,34 @@ def set_module_variables_for_package(pkg, module):
# Set up CMake rpath
m.std_cmake_args.append('-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE')
m.std_cmake_args.append('-DCMAKE_INSTALL_RPATH=%s' % ":".join(get_rpaths(pkg)))
m.std_cmake_args.append('-DCMAKE_INSTALL_RPATH=%s' %
":".join(get_rpaths(pkg)))
# Put spack compiler paths in module scope.
link_dir = spack.build_env_path
m.spack_cc = join_path(link_dir, pkg.compiler.link_paths['cc'])
m.spack_cc = join_path(link_dir, pkg.compiler.link_paths['cc'])
m.spack_cxx = join_path(link_dir, pkg.compiler.link_paths['cxx'])
m.spack_f77 = join_path(link_dir, pkg.compiler.link_paths['f77'])
m.spack_fc = join_path(link_dir, pkg.compiler.link_paths['fc'])
m.spack_fc = join_path(link_dir, pkg.compiler.link_paths['fc'])
# Emulate some shell commands for convenience
m.pwd = os.getcwd
m.cd = os.chdir
m.mkdir = os.mkdir
m.makedirs = os.makedirs
m.remove = os.remove
m.removedirs = os.removedirs
m.symlink = os.symlink
m.pwd = os.getcwd
m.cd = os.chdir
m.mkdir = os.mkdir
m.makedirs = os.makedirs
m.remove = os.remove
m.removedirs = os.removedirs
m.symlink = os.symlink
m.mkdirp = mkdirp
m.install = install
m.mkdirp = mkdirp
m.install = install
m.install_tree = install_tree
m.rmtree = shutil.rmtree
m.move = shutil.move
m.rmtree = shutil.rmtree
m.move = shutil.move
# Useful directories within the prefix are encapsulated in
# a Prefix object.
m.prefix = pkg.prefix
m.prefix = pkg.prefix
# Platform-specific library suffix.
m.dso_suffix = dso_suffix
@@ -288,30 +385,45 @@ def set_module_variables_for_package(pkg, module):
def get_rpaths(pkg):
"""Get a list of all the rpaths for a package."""
rpaths = [pkg.prefix.lib, pkg.prefix.lib64]
rpaths.extend(d.prefix.lib for d in pkg.spec.dependencies.values()
deps = pkg.spec.dependencies(deptype='link')
rpaths.extend(d.prefix.lib for d in deps
if os.path.isdir(d.prefix.lib))
rpaths.extend(d.prefix.lib64 for d in pkg.spec.dependencies.values()
rpaths.extend(d.prefix.lib64 for d in deps
if os.path.isdir(d.prefix.lib64))
# Second module is our compiler mod name. We use that to get rpaths from
# module show output.
if pkg.compiler.modules and len(pkg.compiler.modules) > 1:
rpaths.append(get_path_from_module(pkg.compiler.modules[1]))
return rpaths
def parent_class_modules(cls):
"""Get list of super class modules that are all descend from spack.Package"""
"""
Get list of super class modules that are all descend from spack.Package
"""
if not issubclass(cls, spack.Package) or issubclass(spack.Package, cls):
return []
result = []
module = sys.modules.get(cls.__module__)
if module:
result = [ module ]
result = [module]
for c in cls.__bases__:
result.extend(parent_class_modules(c))
return result
def setup_package(pkg):
def load_external_modules(pkg):
""" traverse the spec list and find any specs that have external modules.
"""
for dep in list(pkg.spec.traverse()):
if dep.external_module:
load_module(dep.external_module)
def setup_package(pkg, dirty=False):
"""Execute all environment setup routines."""
spack_env = EnvironmentModifications()
run_env = EnvironmentModifications()
run_env = EnvironmentModifications()
# Before proceeding, ensure that specs and packages are consistent
#
@@ -327,14 +439,16 @@ def setup_package(pkg):
# throwaway environment, but it is kind of dirty.
#
# TODO: Think about how to avoid this fix and do something cleaner.
for s in pkg.spec.traverse(): s.package.spec = s
for s in pkg.spec.traverse():
s.package.spec = s
set_compiler_environment_variables(pkg, spack_env)
set_build_environment_variables(pkg, spack_env)
set_build_environment_variables(pkg, spack_env, dirty)
pkg.spec.architecture.platform.setup_platform_environment(pkg, spack_env)
load_external_modules(pkg)
# traverse in postorder so package can use vars from its dependencies
spec = pkg.spec
for dspec in pkg.spec.traverse(order='post', root=False):
for dspec in pkg.spec.traverse(order='post', root=False, deptype='build'):
# If a user makes their own package repo, e.g.
# spack.repos.mystuff.libelf.Libelf, and they inherit from
# an existing class like spack.repos.original.libelf.Libelf,
@@ -359,7 +473,7 @@ def setup_package(pkg):
spack_env.apply_modifications()
def fork(pkg, function):
def fork(pkg, function, dirty=False):
"""Fork a child process to do part of a spack build.
Arguments:
@@ -367,6 +481,7 @@ def fork(pkg, function):
pkg -- pkg whose environemnt we should set up the
forked process for.
function -- arg-less function to run in the child process.
dirty -- If True, do NOT clean the environment before building.
Usage:
def child_fun():
@@ -390,7 +505,7 @@ def child_fun():
if pid == 0:
# Give the child process the package's build environment.
setup_package(pkg)
setup_package(pkg, dirty=dirty)
try:
# call the forked function.
@@ -415,7 +530,9 @@ def child_fun():
# message. Just make the parent exit with an error code.
pid, returncode = os.waitpid(pid, 0)
if returncode != 0:
raise InstallError("Installation process had nonzero exit code.".format(str(returncode)))
message = "Installation process had nonzero exit code : {code}"
strcode = str(returncode)
raise InstallError(message.format(code=strcode))
class InstallError(spack.error.SpackError):

View File

@@ -27,16 +27,18 @@
import sys
import llnl.util.tty as tty
from llnl.util.lang import attr_setdefault
import spack
import spack.spec
import spack.config
import spack.spec
from llnl.util.lang import *
from llnl.util.tty.colify import *
from llnl.util.tty.color import *
#
# Settings for commands that modify configuration
#
# Commands that modify confguration By default modify the *highest* priority scope.
# Commands that modify confguration By default modify the *highest*
# priority scope.
default_modify_scope = spack.config.highest_precedence_scope().name
# Commands that list confguration list *all* scopes by default.
default_list_scope = None
@@ -48,7 +50,7 @@
ignore_files = r'^\.|^__init__.py$|^#'
SETUP_PARSER = "setup_parser"
DESCRIPTION = "description"
DESCRIPTION = "description"
command_path = os.path.join(spack.lib_path, "spack", "cmd")
@@ -71,7 +73,7 @@ def get_module(name):
module_name, fromlist=[name, SETUP_PARSER, DESCRIPTION],
level=0)
attr_setdefault(module, SETUP_PARSER, lambda *args: None) # null-op
attr_setdefault(module, SETUP_PARSER, lambda *args: None) # null-op
attr_setdefault(module, DESCRIPTION, "")
fn_name = get_cmd_function_name(name)
@@ -101,17 +103,17 @@ def parse_specs(args, **kwargs):
specs = spack.spec.parse(args)
for spec in specs:
if concretize:
spec.concretize() # implies normalize
spec.concretize() # implies normalize
elif normalize:
spec.normalize()
return specs
except spack.parse.ParseError, e:
except spack.parse.ParseError as e:
tty.error(e.message, e.string, e.pos * " " + "^")
sys.exit(1)
except spack.spec.SpecError, e:
except spack.spec.SpecError as e:
tty.error(e.message)
sys.exit(1)
@@ -127,7 +129,7 @@ def elide_list(line_list, max_num=10):
[1, 2, 3, '...', 6]
"""
if len(line_list) > max_num:
return line_list[:max_num-1] + ['...'] + line_list[-1:]
return line_list[:max_num - 1] + ['...'] + line_list[-1:]
else:
return line_list
@@ -138,10 +140,104 @@ def disambiguate_spec(spec):
tty.die("Spec '%s' matches no installed packages." % spec)
elif len(matching_specs) > 1:
args = ["%s matches multiple packages." % spec,
"Matching packages:"]
args = ["%s matches multiple packages." % spec,
"Matching packages:"]
args += [" " + str(s) for s in matching_specs]
args += ["Use a more specific spec."]
tty.die(*args)
return matching_specs[0]
def ask_for_confirmation(message):
while True:
tty.msg(message + '[y/n]')
choice = raw_input().lower()
if choice == 'y':
break
elif choice == 'n':
raise SystemExit('Operation aborted')
tty.warn('Please reply either "y" or "n"')
def gray_hash(spec, length):
return colorize('@K{%s}' % spec.dag_hash(length))
def display_specs(specs, **kwargs):
mode = kwargs.get('mode', 'short')
hashes = kwargs.get('long', False)
namespace = kwargs.get('namespace', False)
flags = kwargs.get('show_flags', False)
variants = kwargs.get('variants', False)
hlen = 7
if kwargs.get('very_long', False):
hashes = True
hlen = None
nfmt = '.' if namespace else '_'
ffmt = '$%+' if flags else ''
vfmt = '$+' if variants else ''
format_string = '$%s$@%s%s' % (nfmt, ffmt, vfmt)
# Make a dict with specs keyed by architecture and compiler.
index = index_by(specs, ('architecture', 'compiler'))
# Traverse the index and print out each package
for i, (architecture, compiler) in enumerate(sorted(index)):
if i > 0:
print
header = "%s{%s} / %s{%s}" % (spack.spec.architecture_color,
architecture, spack.spec.compiler_color,
compiler)
tty.hline(colorize(header), char='-')
specs = index[(architecture, compiler)]
specs.sort()
abbreviated = [s.format(format_string, color=True) for s in specs]
if mode == 'paths':
# Print one spec per line along with prefix path
width = max(len(s) for s in abbreviated)
width += 2
format = " %%-%ds%%s" % width
for abbrv, spec in zip(abbreviated, specs):
if hashes:
print(gray_hash(spec, hlen), )
print(format % (abbrv, spec.prefix))
elif mode == 'deps':
for spec in specs:
print(spec.tree(
format=format_string,
color=True,
indent=4,
prefix=(lambda s: gray_hash(s, hlen)) if hashes else None))
elif mode == 'short':
# Print columns of output if not printing flags
if not flags:
def fmt(s):
string = ""
if hashes:
string += gray_hash(s, hlen) + ' '
string += s.format('$-%s$@%s' % (nfmt, vfmt), color=True)
return string
colify(fmt(s) for s in specs)
# Print one entry per line if including flags
else:
for spec in specs:
# Print the hash if necessary
hsh = gray_hash(spec, hlen) + ' ' if hashes else ''
print(hsh + spec.format(format_string, color=True) + '\n')
else:
raise ValueError(
"Invalid mode for display_specs: %s. Must be one of (paths,"
"deps, short)." % mode)

View File

@@ -29,12 +29,14 @@
description = "Activate a package extension."
def setup_parser(subparser):
subparser.add_argument(
'-f', '--force', action='store_true',
help="Activate without first activating dependencies.")
subparser.add_argument(
'spec', nargs=argparse.REMAINDER, help="spec of package extension to activate.")
'spec', nargs=argparse.REMAINDER,
help="spec of package extension to activate.")
def activate(parser, args):

View File

@@ -22,14 +22,10 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import spack
import spack.architecture as architecture
description = "Print the architecture for this machine"
def arch(parser, args):
configured_sys_type = architecture.get_sys_type_from_spack_globals()
if not configured_sys_type:
configured_sys_type = "autodetect"
print "Configured sys_type: %s" % configured_sys_type
print "Autodetected default sys_type: %s" % architecture.sys_type()
print architecture.sys_type()

View File

@@ -23,7 +23,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import os
from subprocess import check_call
import llnl.util.tty as tty
from llnl.util.filesystem import join_path, mkdirp
@@ -31,26 +30,49 @@
import spack
from spack.util.executable import which
_SPACK_UPSTREAM = 'https://github.com/llnl/spack'
description = "Create a new installation of spack in another prefix"
def setup_parser(subparser):
subparser.add_argument('prefix', help="names of prefix where we should install spack")
subparser.add_argument(
'-r', '--remote', action='store', dest='remote',
help="name of the remote to bootstrap from", default='origin')
subparser.add_argument(
'prefix',
help="names of prefix where we should install spack")
def get_origin_url():
def get_origin_info(remote):
git_dir = join_path(spack.prefix, '.git')
git = which('git', required=True)
origin_url = git(
'--git-dir=%s' % git_dir, 'config', '--get', 'remote.origin.url',
output=str)
return origin_url.strip()
try:
branch = git('symbolic-ref', '--short', 'HEAD', output=str)
except ProcessError:
branch = 'develop'
tty.warn('No branch found; using default branch: %s' % branch)
if remote == 'origin' and \
branch not in ('master', 'develop'):
branch = 'develop'
tty.warn('Unknown branch found; using default branch: %s' % branch)
try:
origin_url = git(
'--git-dir=%s' % git_dir,
'config', '--get', 'remote.%s.url' % remote,
output=str)
except ProcessError:
origin_url = _SPACK_UPSTREAM
tty.warn('No git repository found; '
'using default upstream URL: %s' % origin_url)
return (origin_url.strip(), branch.strip())
def bootstrap(parser, args):
origin_url = get_origin_url()
origin_url, branch = get_origin_info(args.remote)
prefix = args.prefix
tty.msg("Fetching spack from origin: %s" % origin_url)
tty.msg("Fetching spack from '%s': %s" % (args.remote, origin_url))
if os.path.isfile(prefix):
tty.die("There is already a file at %s" % prefix)
@@ -62,7 +84,8 @@ def bootstrap(parser, args):
files_in_the_way = os.listdir(prefix)
if files_in_the_way:
tty.die("There are already files there! Delete these files before boostrapping spack.",
tty.die("There are already files there! "
"Delete these files before boostrapping spack.",
*files_in_the_way)
tty.msg("Installing:",
@@ -73,8 +96,10 @@ def bootstrap(parser, args):
git = which('git', required=True)
git('init', '--shared', '-q')
git('remote', 'add', 'origin', origin_url)
git('fetch', 'origin', 'master:refs/remotes/origin/master', '-n', '-q')
git('reset', '--hard', 'origin/master', '-q')
git('fetch', 'origin', '%s:refs/remotes/origin/%s' % (branch, branch),
'-n', '-q')
git('reset', '--hard', 'origin/%s' % branch, '-q')
git('checkout', '-B', branch, 'origin/%s' % branch, '-q')
tty.msg("Successfully created a new spack in %s" % prefix,
"Run %s/bin/spack to use this installation." % prefix)

View File

@@ -25,7 +25,8 @@
import spack.cmd.location
import spack.modules
description="cd to spack directories in the shell."
description = "cd to spack directories in the shell."
def setup_parser(subparser):
"""This is for decoration -- spack cd is used through spack's

View File

@@ -42,7 +42,8 @@ def setup_parser(subparser):
'--keep-stage', action='store_true', dest='keep_stage',
help="Don't clean up staging area when command completes.")
subparser.add_argument(
'versions', nargs=argparse.REMAINDER, help='Versions to generate checksums for')
'versions', nargs=argparse.REMAINDER,
help='Versions to generate checksums for')
def get_checksums(versions, urls, **kwargs):
@@ -59,10 +60,10 @@ def get_checksums(versions, urls, **kwargs):
with Stage(url, keep=keep_stage) as stage:
stage.fetch()
if i == 0 and first_stage_function:
first_stage_function(stage)
first_stage_function(stage, url)
hashes.append((version,
spack.util.crypto.checksum(hashlib.md5, stage.archive_file)))
hashes.append((version, spack.util.crypto.checksum(
hashlib.md5, stage.archive_file)))
i += 1
except FailedDownloadError as e:
tty.msg("Failed to fetch %s" % url)
@@ -79,12 +80,12 @@ def checksum(parser, args):
# If the user asked for specific versions, use those.
if args.versions:
versions = {}
for v in args.versions:
v = ver(v)
if not isinstance(v, Version):
for version in args.versions:
version = ver(version)
if not isinstance(version, Version):
tty.die("Cannot generate checksums for version lists or " +
"version ranges. Use unambiguous versions.")
versions[v] = pkg.url_for_version(v)
versions[version] = pkg.url_for_version(version)
else:
versions = pkg.fetch_remote_versions()
if not versions:
@@ -111,5 +112,7 @@ def checksum(parser, args):
if not version_hashes:
tty.die("Could not fetch any versions for %s" % pkg.name)
version_lines = [" version('%s', '%s')" % (v, h) for v, h in version_hashes]
version_lines = [
" version('%s', '%s')" % (v, h) for v, h in version_hashes
]
tty.msg("Checksummed new versions of %s:" % pkg.name, *version_lines)

View File

@@ -31,6 +31,7 @@
description = "Remove build stage and source tarball for packages."
def setup_parser(subparser):
subparser.add_argument('packages', nargs=argparse.REMAINDER,
help="specs of packages to clean")

View File

@@ -0,0 +1,24 @@
##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/llnl/spack
# Please also see the LICENSE file for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (as
# published by the Free Software Foundation) version 2.1, February 1999.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
# conditions of the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################

View File

@@ -0,0 +1,96 @@
##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/llnl/spack
# Please also see the LICENSE file for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (as
# published by the Free Software Foundation) version 2.1, February 1999.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
# conditions of the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import argparse
import spack.modules
from spack.util.pattern import Bunch
__all__ = ['add_common_arguments']
_arguments = {}
def add_common_arguments(parser, list_of_arguments):
for argument in list_of_arguments:
if argument not in _arguments:
message = 'Trying to add non existing argument "{0}" to a command'
raise KeyError(message.format(argument))
x = _arguments[argument]
parser.add_argument(*x.flags, **x.kwargs)
class ConstraintAction(argparse.Action):
"""Constructs a list of specs based on a constraint given on the command line
An instance of this class is supposed to be used as an argument action
in a parser. It will read a constraint and will attach a list of matching
specs to the namespace
"""
qualifiers = {}
def __call__(self, parser, namespace, values, option_string=None):
# Query specs from command line
d = self.qualifiers.get(namespace.subparser_name, {})
specs = [s for s in spack.installed_db.query(**d)]
values = ' '.join(values)
if values:
specs = [x for x in specs if x.satisfies(values, strict=True)]
namespace.specs = specs
parms = Bunch(
flags=('constraint',),
kwargs={
'nargs': '*',
'help': 'Constraint to select a subset of installed packages',
'action': ConstraintAction
})
_arguments['constraint'] = parms
parms = Bunch(
flags=('-m', '--module-type'),
kwargs={
'help': 'Type of module files',
'default': 'tcl',
'choices': spack.modules.module_types
})
_arguments['module_type'] = parms
parms = Bunch(
flags=('-y', '--yes-to-all'),
kwargs={
'action': 'store_true',
'dest': 'yes_to_all',
'help': 'Assume "yes" is the answer to every confirmation request.'
})
_arguments['yes_to_all'] = parms
parms = Bunch(
flags=('-r', '--dependencies'),
kwargs={
'action': 'store_true',
'dest': 'recurse_dependencies',
'help': 'Recursively traverse spec dependencies'
})
_arguments['recurse_dependencies'] = parms

View File

@@ -37,6 +37,7 @@
description = "Manage compilers"
def setup_parser(subparser):
sp = subparser.add_subparsers(
metavar='SUBCOMMAND', dest='compiler_command')
@@ -44,43 +45,58 @@ def setup_parser(subparser):
scopes = spack.config.config_scopes
# Find
find_parser = sp.add_parser('find', aliases=['add'], help='Search the system for compilers to add to the Spack configuration.')
find_parser = sp.add_parser(
'find', aliases=['add'],
help='Search the system for compilers to add to Spack configuration.')
find_parser.add_argument('add_paths', nargs=argparse.REMAINDER)
find_parser.add_argument('--scope', choices=scopes, default=spack.cmd.default_modify_scope,
help="Configuration scope to modify.")
find_parser.add_argument(
'--scope', choices=scopes, default=spack.cmd.default_modify_scope,
help="Configuration scope to modify.")
# Remove
remove_parser = sp.add_parser('remove', aliases=['rm'], help='Remove compiler by spec.')
remove_parser = sp.add_parser(
'remove', aliases=['rm'], help='Remove compiler by spec.')
remove_parser.add_argument(
'-a', '--all', action='store_true', help='Remove ALL compilers that match spec.')
'-a', '--all', action='store_true',
help='Remove ALL compilers that match spec.')
remove_parser.add_argument('compiler_spec')
remove_parser.add_argument('--scope', choices=scopes, default=spack.cmd.default_modify_scope,
help="Configuration scope to modify.")
remove_parser.add_argument(
'--scope', choices=scopes, default=spack.cmd.default_modify_scope,
help="Configuration scope to modify.")
# List
list_parser = sp.add_parser('list', help='list available compilers')
list_parser.add_argument('--scope', choices=scopes, default=spack.cmd.default_list_scope,
help="Configuration scope to read from.")
list_parser.add_argument(
'--scope', choices=scopes, default=spack.cmd.default_list_scope,
help="Configuration scope to read from.")
# Info
info_parser = sp.add_parser('info', help='Show compiler paths.')
info_parser.add_argument('compiler_spec')
info_parser.add_argument('--scope', choices=scopes, default=spack.cmd.default_list_scope,
help="Configuration scope to read from.")
info_parser.add_argument(
'--scope', choices=scopes, default=spack.cmd.default_list_scope,
help="Configuration scope to read from.")
def compiler_find(args):
"""Search either $PATH or a list of paths for compilers and add them
to Spack's configuration."""
"""Search either $PATH or a list of paths OR MODULES for compilers and
add them to Spack's configuration.
"""
paths = args.add_paths
if not paths:
paths = get_path('PATH')
compilers = [c for c in spack.compilers.find_compilers(*args.add_paths)
if c.spec not in spack.compilers.all_compilers(scope=args.scope)]
# Don't initialize compilers config via compilers.get_compiler_config.
# Just let compiler_find do the
# entire process and return an empty config from all_compilers
# Default for any other process is init_config=True
compilers = [c for c in spack.compilers.find_compilers(*paths)
if c.spec not in spack.compilers.all_compilers(
scope=args.scope, init_config=False)]
if compilers:
spack.compilers.add_compilers_to_config(compilers, scope=args.scope)
spack.compilers.add_compilers_to_config(compilers, scope=args.scope,
init_config=False)
n = len(compilers)
s = 's' if n > 1 else ''
filename = spack.config.get_config_filename(args.scope, 'compilers')
@@ -93,17 +109,17 @@ def compiler_find(args):
def compiler_remove(args):
cspec = CompilerSpec(args.compiler_spec)
compilers = spack.compilers.compilers_for_spec(cspec, scope=args.scope)
if not compilers:
tty.die("No compilers match spec %s" % cspec)
elif not args.all and len(compilers) > 1:
tty.error("Multiple compilers match spec %s. Choose one:" % cspec)
colify(reversed(sorted([c.spec for c in compilers])), indent=4)
tty.msg("Or, you can use `spack compiler remove -a` to remove all of them.")
tty.msg("Or, use `spack compiler remove -a` to remove all of them.")
sys.exit(1)
for compiler in compilers:
spack.compilers.remove_compiler_from_config(compiler.spec, scope=args.scope)
spack.compilers.remove_compiler_from_config(
compiler.spec, scope=args.scope)
tty.msg("Removed compiler %s" % compiler.spec)
@@ -121,13 +137,16 @@ def compiler_info(args):
print "\tcxx = %s" % c.cxx
print "\tf77 = %s" % c.f77
print "\tfc = %s" % c.fc
print "\tmodules = %s" % c.modules
print "\toperating system = %s" % c.operating_system
def compiler_list(args):
tty.msg("Available compilers")
index = index_by(spack.compilers.all_compilers(scope=args.scope), 'name')
for i, (name, compilers) in enumerate(index.items()):
if i >= 1: print
if i >= 1:
print
cname = "%s{%s}" % (spack.spec.compiler_color, name)
tty.hline(colorize(cname), char='-')
@@ -135,10 +154,10 @@ def compiler_list(args):
def compiler(parser, args):
action = { 'add' : compiler_find,
'find' : compiler_find,
'remove' : compiler_remove,
'rm' : compiler_remove,
'info' : compiler_info,
'list' : compiler_list }
action = {'add': compiler_find,
'find': compiler_find,
'remove': compiler_remove,
'rm': compiler_remove,
'info': compiler_info,
'list': compiler_list}
action[args.compiler_command](args)

View File

@@ -22,18 +22,16 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import llnl.util.tty as tty
from llnl.util.tty.colify import colify
from llnl.util.lang import index_by
import spack
from spack.cmd.compiler import compiler_list
description = "List available compilers. Same as 'spack compiler list'."
def setup_parser(subparser):
subparser.add_argument('--scope', choices=spack.config.config_scopes,
help="Configuration scope to read/modify.")
def compilers(parser, args):
compiler_list(args)

View File

@@ -22,15 +22,11 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import sys
import argparse
import llnl.util.tty as tty
import spack.config
description = "Get and set configuration options."
def setup_parser(subparser):
# User can only choose one
scope_group = subparser.add_mutually_exclusive_group()
@@ -64,6 +60,6 @@ def config_edit(args):
def config(parser, args):
action = { 'get' : config_get,
'edit' : config_edit }
action = {'get': config_get,
'edit': config_edit}
action[args.config_command](args)

View File

@@ -1,4 +1,3 @@
_copyright = """\
##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
@@ -23,10 +22,8 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
"""
import string
import os
import hashlib
import re
from ordereddict_backport import OrderedDict
@@ -41,16 +38,37 @@
from spack.spec import Spec
from spack.util.naming import *
from spack.repository import Repo, RepoError
import spack.util.crypto as crypto
from spack.util.executable import which
from spack.stage import Stage
description = "Create a new package file from an archive URL"
package_template = string.Template(
_copyright + """
package_template = string.Template("""\
##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/llnl/spack
# Please also see the LICENSE file for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (as
# published by the Free Software Foundation) version 2.1, February 1999.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
# conditions of the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
#
# This is a template package file for Spack. We've put "FIXME"
# next to all the things you'll want to change. Once you've handled
@@ -68,26 +86,107 @@
#
from spack import *
class ${class_name}(Package):
""\"FIXME: put a proper description of your package here.""\"
# FIXME: add a proper url for your package's homepage here.
""\"FIXME: Put a proper description of your package here.""\"
# FIXME: Add a proper url for your package's homepage here.
homepage = "http://www.example.com"
url = "${url}"
${versions}
# FIXME: Add dependencies if this package requires them.
# depends_on("foo")
${dependencies}
def install(self, spec, prefix):
# FIXME: Modify the configure line to suit your build system here.
${configure}
# FIXME: Add logic to build and install here
make()
make("install")
${install}
""")
# Build dependencies and extensions
dependencies_dict = {
'autotools': """\
# FIXME: Add dependencies if required.
# depends_on('foo')""",
'cmake': """\
# FIXME: Add additional dependencies if required.
depends_on('cmake', type='build')""",
'scons': """\
# FIXME: Add additional dependencies if required.
depends_on('scons', type='build')""",
'python': """\
extends('python')
# FIXME: Add additional dependencies if required.
# depends_on('py-setuptools', type='build')
# depends_on('py-foo', type=nolink)""",
'R': """\
extends('R')
# FIXME: Add additional dependencies if required.
# depends_on('r-foo', type=nolink)""",
'octave': """\
extends('octave')
# FIXME: Add additional dependencies if required.
# depends_on('octave-foo', type=nolink)""",
'unknown': """\
# FIXME: Add dependencies if required.
# depends_on('foo')"""
}
# Default installation instructions
install_dict = {
'autotools': """\
# FIXME: Modify the configure line to suit your build system here.
configure('--prefix={0}'.format(prefix))
# FIXME: Add logic to build and install here.
make()
make('install')""",
'cmake': """\
with working_dir('spack-build', create=True):
# FIXME: Modify the cmake line to suit your build system here.
cmake('..', *std_cmake_args)
# FIXME: Add logic to build and install here.
make()
make('install')""",
'scons': """\
# FIXME: Add logic to build and install here.
scons('prefix={0}'.format(prefix))
scons('install')""",
'python': """\
# FIXME: Add logic to build and install here.
setup_py('install', '--prefix={0}'.format(prefix))""",
'R': """\
# FIXME: Add logic to build and install here.
R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
self.stage.source_path)""",
'octave': """\
# FIXME: Add logic to build and install here.
octave('--quiet', '--norc',
'--built-in-docstrings-file=/dev/null',
'--texi-macros-file=/dev/null',
'--eval', 'pkg prefix {0}; pkg install {1}'.format(
prefix, self.stage.archive_file))""",
'unknown': """\
# FIXME: Unknown build system
make()
make('install')"""
}
def make_version_calls(ver_hash_tuples):
"""Adds a version() call to the package for each version found."""
@@ -118,41 +217,53 @@ def setup_parser(subparser):
setup_parser.subparser = subparser
class ConfigureGuesser(object):
def __call__(self, stage):
"""Try to guess the type of build system used by the project, and return
an appropriate configure line.
"""
autotools = "configure('--prefix=%s' % prefix)"
cmake = "cmake('.', *std_cmake_args)"
python = "python('setup.py', 'install', '--prefix=%s' % prefix)"
r = "R('CMD', 'INSTALL', '--library=%s' % self.module.r_lib_dir, '%s' % self.stage.archive_file)"
class BuildSystemGuesser(object):
config_lines = ((r'/configure$', 'autotools', autotools),
(r'/CMakeLists.txt$', 'cmake', cmake),
(r'/setup.py$', 'python', python),
(r'/NAMESPACE$', 'r', r))
def __call__(self, stage, url):
"""Try to guess the type of build system used by a project based on
the contents of its archive or the URL it was downloaded from."""
# Peek inside the tarball.
tar = which('tar')
output = tar(
"--exclude=*/*/*", "-tf", stage.archive_file, output=str)
lines = output.split("\n")
# Most octave extensions are hosted on Octave-Forge:
# http://octave.sourceforge.net/index.html
# They all have the same base URL.
if 'downloads.sourceforge.net/octave/' in url:
self.build_system = 'octave'
return
# Set the configure line to the one that matched.
for pattern, bs, cl in config_lines:
if any(re.search(pattern, l) for l in lines):
config_line = cl
build_system = bs
break
# A list of clues that give us an idea of the build system a package
# uses. If the regular expression matches a file contained in the
# archive, the corresponding build system is assumed.
clues = [
(r'/configure$', 'autotools'),
(r'/CMakeLists.txt$', 'cmake'),
(r'/SConstruct$', 'scons'),
(r'/setup.py$', 'python'),
(r'/NAMESPACE$', 'R')
]
# Peek inside the compressed file.
if stage.archive_file.endswith('.zip'):
try:
unzip = which('unzip')
output = unzip('-l', stage.archive_file, output=str)
except:
output = ''
else:
# None matched -- just put both, with cmake commented out
config_line = "# FIXME: Spack couldn't guess one, so here are some options:\n"
config_line += " # " + autotools + "\n"
config_line += " # " + cmake
build_system = 'unknown'
try:
tar = which('tar')
output = tar('--exclude=*/*/*', '-tf',
stage.archive_file, output=str)
except:
output = ''
lines = output.split('\n')
# Determine the build system based on the files contained
# in the archive.
build_system = 'unknown'
for pattern, bs in clues:
if any(re.search(pattern, l) for l in lines):
build_system = bs
self.configure = config_line
self.build_system = build_system
@@ -168,7 +279,7 @@ def guess_name_and_version(url, args):
else:
try:
name = spack.url.parse_name(url, version)
except spack.url.UndetectableNameError, e:
except spack.url.UndetectableNameError:
# Use a user-supplied name if one is present
tty.die("Couldn't guess a name for this package. Try running:", "",
"spack create --name <name> <url>")
@@ -182,7 +293,8 @@ def guess_name_and_version(url, args):
def find_repository(spec, args):
# figure out namespace for spec
if spec.namespace and args.namespace and spec.namespace != args.namespace:
tty.die("Namespaces '%s' and '%s' do not match." % (spec.namespace, args.namespace))
tty.die("Namespaces '%s' and '%s' do not match." % (spec.namespace,
args.namespace))
if not spec.namespace and args.namespace:
spec.namespace = args.namespace
@@ -193,8 +305,8 @@ def find_repository(spec, args):
try:
repo = Repo(repo_path)
if spec.namespace and spec.namespace != repo.namespace:
tty.die("Can't create package with namespace %s in repo with namespace %s"
% (spec.namespace, repo.namespace))
tty.die("Can't create package with namespace %s in repo with "
"namespace %s" % (spec.namespace, repo.namespace))
except RepoError as e:
tty.die(str(e))
else:
@@ -214,11 +326,7 @@ def find_repository(spec, args):
def fetch_tarballs(url, name, version):
"""Try to find versions of the supplied archive by scraping the web.
Prompts the user to select how many to download if many are found.
"""
Prompts the user to select how many to download if many are found."""
versions = spack.util.web.find_versions_of_archive(url)
rkeys = sorted(versions.keys(), reverse=True)
versions = OrderedDict(zip(rkeys, (versions[v] for v in rkeys)))
@@ -226,11 +334,11 @@ def fetch_tarballs(url, name, version):
archives_to_fetch = 1
if not versions:
# If the fetch failed for some reason, revert to what the user provided
versions = { version : url }
versions = {version: url}
elif len(versions) > 1:
tty.msg("Found %s versions of %s:" % (len(versions), name),
*spack.cmd.elide_list(
["%-10s%s" % (v,u) for v, u in versions.iteritems()]))
["%-10s%s" % (v, u) for v, u in versions.iteritems()]))
print
archives_to_fetch = tty.get_number(
"Include how many checksums in the package file?",
@@ -253,7 +361,7 @@ def create(parser, args):
# Figure out a name and repo for the package.
name, version = guess_name_and_version(url, args)
spec = Spec(name)
name = spec.name # factors out namespace, if any
name = spec.name.lower() # factors out namespace, if any
repo = find_repository(spec, args)
tty.msg("This looks like a URL for %s version %s" % (name, version))
@@ -262,8 +370,8 @@ def create(parser, args):
# Fetch tarballs (prompting user if necessary)
versions, urls = fetch_tarballs(url, name, version)
# Try to guess what configure system is used.
guesser = ConfigureGuesser()
# Try to guess what build system is used.
guesser = BuildSystemGuesser()
ver_hash_tuples = spack.cmd.checksum.get_checksums(
versions, urls,
first_stage_function=guesser,
@@ -272,13 +380,13 @@ def create(parser, args):
if not ver_hash_tuples:
tty.die("Could not fetch any tarballs for %s" % name)
# Prepend 'py-' to python package names, by convention.
# Add prefix to package name if it is an extension.
if guesser.build_system == 'python':
name = 'py-%s' % name
# Prepend 'r-' to R package names, by convention.
if guesser.build_system == 'r':
name = 'r-%s' % name
name = 'py-{0}'.format(name)
if guesser.build_system == 'R':
name = 'r-{0}'.format(name)
if guesser.build_system == 'octave':
name = 'octave-{0}'.format(name)
# Create a directory for the new package.
pkg_path = repo.filename_for_package_name(name)
@@ -292,10 +400,11 @@ def create(parser, args):
pkg_file.write(
package_template.substitute(
name=name,
configure=guesser.configure,
class_name=mod_to_class(name),
url=url,
versions=make_version_calls(ver_hash_tuples)))
versions=make_version_calls(ver_hash_tuples),
dependencies=dependencies_dict[guesser.build_system],
install=install_dict[guesser.build_system]))
# If everything checks out, go ahead and edit.
spack.editor(pkg_path)

View File

@@ -31,6 +31,7 @@
description = "Deactivate a package extension."
def setup_parser(subparser):
subparser.add_argument(
'-f', '--force', action='store_true',
@@ -40,7 +41,8 @@ def setup_parser(subparser):
help="Deactivate all extensions of an extendable package, or "
"deactivate an extension AND its dependencies.")
subparser.add_argument(
'spec', nargs=argparse.REMAINDER, help="spec of package extension to deactivate.")
'spec', nargs=argparse.REMAINDER,
help="spec of package extension to deactivate.")
def deactivate(parser, args):
@@ -65,7 +67,8 @@ def deactivate(parser, args):
if not args.force and not spec.package.activated:
tty.die("%s is not activated." % pkg.spec.short_spec)
tty.msg("Deactivating %s and all dependencies." % pkg.spec.short_spec)
tty.msg("Deactivating %s and all dependencies." %
pkg.spec.short_spec)
topo_order = topological_sort(spec)
index = spec.index()
@@ -79,7 +82,9 @@ def deactivate(parser, args):
epkg.do_deactivate(force=args.force)
else:
tty.die("spack deactivate --all requires an extendable package or an extension.")
tty.die(
"spack deactivate --all requires an extendable package "
"or an extension.")
else:
if not pkg.is_extension:

View File

@@ -31,9 +31,11 @@
description = "Show installed packages that depend on another."
def setup_parser(subparser):
subparser.add_argument(
'spec', nargs=argparse.REMAINDER, help="specs to list dependencies of.")
'spec', nargs=argparse.REMAINDER,
help="specs to list dependencies of.")
def dependents(parser, args):
@@ -42,5 +44,6 @@ def dependents(parser, args):
tty.die("spack dependents takes only one spec.")
fmt = '$_$@$%@$+$=$#'
deps = [d.format(fmt, color=True) for d in specs[0].package.installed_dependents]
deps = [d.format(fmt, color=True)
for d in specs[0].package.installed_dependents]
tty.msg("Dependents of %s" % specs[0].format(fmt, color=True), *deps)

View File

@@ -35,6 +35,7 @@
description = "Do-It-Yourself: build from an existing source directory."
def setup_parser(subparser):
subparser.add_argument(
'-i', '--ignore-dependencies', action='store_true', dest='ignore_deps',
@@ -50,7 +51,7 @@ def setup_parser(subparser):
help="Do not display verbose build output while installing.")
subparser.add_argument(
'spec', nargs=argparse.REMAINDER,
help="specs to use for install. Must contain package AND verison.")
help="specs to use for install. Must contain package AND version.")
def diy(self, args):
@@ -76,14 +77,17 @@ def diy(self, args):
return
if not spec.versions.concrete:
tty.die("spack diy spec must have a single, concrete version. Did you forget a package version number?")
tty.die(
"spack diy spec must have a single, concrete version. "
"Did you forget a package version number?")
spec.concretize()
package = spack.repo.get(spec)
if package.installed:
tty.error("Already installed in %s" % package.prefix)
tty.msg("Uninstall or try adding a version suffix for this DIY build.")
tty.msg("Uninstall or try adding a version suffix for this "
"DIY build.")
sys.exit(1)
# Forces the build to run out of the current directory.

View File

@@ -25,6 +25,7 @@
description = "Run pydoc from within spack."
def setup_parser(subparser):
subparser.add_argument('entity', help="Run pydoc help on entity")

View File

@@ -68,7 +68,7 @@ def edit_package(name, repo_path, namespace, force=False):
if os.path.exists(path):
if not os.path.isfile(path):
tty.die("Something's wrong. '%s' is not a file!" % path)
if not os.access(path, os.R_OK|os.W_OK):
if not os.access(path, os.R_OK | os.W_OK):
tty.die("Insufficient permissions on '%s'!" % path)
elif not force:
tty.die("No package '%s'. Use spack create, or supply -f/--force "
@@ -93,19 +93,23 @@ def setup_parser(subparser):
# Various filetypes you can edit directly from the cmd line.
excl_args.add_argument(
'-c', '--command', dest='path', action='store_const',
const=spack.cmd.command_path, help="Edit the command with the supplied name.")
const=spack.cmd.command_path,
help="Edit the command with the supplied name.")
excl_args.add_argument(
'-t', '--test', dest='path', action='store_const',
const=spack.test_path, help="Edit the test with the supplied name.")
excl_args.add_argument(
'-m', '--module', dest='path', action='store_const',
const=spack.module_path, help="Edit the main spack module with the supplied name.")
const=spack.module_path,
help="Edit the main spack module with the supplied name.")
# Options for editing packages
excl_args.add_argument(
'-r', '--repo', default=None, help="Path to repo to edit package in.")
'-r', '--repo', default=None,
help="Path to repo to edit package in.")
excl_args.add_argument(
'-N', '--namespace', default=None, help="Namespace of package to edit.")
'-N', '--namespace', default=None,
help="Namespace of package to edit.")
subparser.add_argument(
'name', nargs='?', default=None, help="name of package to edit")

View File

@@ -28,11 +28,13 @@
import spack.cmd
import spack.build_environment as build_env
description = "Run a command with the environment for a particular spec's install."
description = "Run a command with the install environment for a spec."
def setup_parser(subparser):
subparser.add_argument(
'spec', nargs=argparse.REMAINDER, help="specs of package environment to emulate.")
'spec', nargs=argparse.REMAINDER,
help="specs of package environment to emulate.")
def env(parser, args):
@@ -47,7 +49,7 @@ def env(parser, args):
if sep in args.spec:
s = args.spec.index(sep)
spec = args.spec[:s]
cmd = args.spec[s+1:]
cmd = args.spec[s + 1:]
else:
spec = args.spec[0]
cmd = args.spec[1:]

View File

@@ -22,7 +22,6 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import sys
import argparse
import llnl.util.tty as tty
@@ -34,6 +33,7 @@
description = "List extensions for package."
def setup_parser(subparser):
format_group = subparser.add_mutually_exclusive_group()
format_group.add_argument(
@@ -47,7 +47,8 @@ def setup_parser(subparser):
help='Show full dependency DAG of extensions')
subparser.add_argument(
'spec', nargs=argparse.REMAINDER, help='Spec of package to list extensions for')
'spec', nargs=argparse.REMAINDER,
help='Spec of package to list extensions for')
def extensions(parser, args):
@@ -85,7 +86,8 @@ def extensions(parser, args):
#
# List specs of installed extensions.
#
installed = [s.spec for s in spack.installed_db.installed_extensions_for(spec)]
installed = [
s.spec for s in spack.installed_db.installed_extensions_for(spec)]
print
if not installed:
tty.msg("None installed.")
@@ -102,4 +104,5 @@ def extensions(parser, args):
tty.msg("None activated.")
return
tty.msg("%d currently activated:" % len(activated))
spack.cmd.find.display_specs(activated.values(), mode=args.mode, long=args.long)
spack.cmd.find.display_specs(
activated.values(), mode=args.mode, long=args.long)

View File

@@ -29,16 +29,21 @@
description = "Fetch archives for packages"
def setup_parser(subparser):
subparser.add_argument(
'-n', '--no-checksum', action='store_true', dest='no_checksum',
help="Do not check packages against checksum")
subparser.add_argument(
'-m', '--missing', action='store_true', help="Also fetch all missing dependencies")
'-m', '--missing', action='store_true',
help="Also fetch all missing dependencies")
subparser.add_argument(
'-D', '--dependencies', action='store_true', help="Also fetch all dependencies")
'-D', '--dependencies', action='store_true',
help="Also fetch all dependencies")
subparser.add_argument(
'packages', nargs=argparse.REMAINDER, help="specs of packages to fetch")
'packages', nargs=argparse.REMAINDER,
help="specs of packages to fetch")
def fetch(parser, args):
if not args.packages:
@@ -50,8 +55,7 @@ def fetch(parser, args):
specs = spack.cmd.parse_specs(args.packages, concretize=True)
for spec in specs:
if args.missing or args.dependencies:
to_fetch = set()
for s in spec.traverse():
for s in spec.traverse(deptype_query=spack.alldeps):
package = spack.repo.get(s)
if args.missing and package.installed:
continue

View File

@@ -22,144 +22,93 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import sys
import collections
import itertools
import argparse
from StringIO import StringIO
import sys
import llnl.util.tty as tty
from llnl.util.tty.colify import *
from llnl.util.tty.color import *
from llnl.util.lang import *
import spack
import spack.spec
from llnl.util.lang import *
from llnl.util.tty.colify import *
from llnl.util.tty.color import *
from spack.cmd import display_specs
description = "Find installed spack packages"
description ="Find installed spack packages"
def setup_parser(subparser):
format_group = subparser.add_mutually_exclusive_group()
format_group.add_argument('-s', '--short',
action='store_const',
dest='mode',
const='short',
help='Show only specs (default)')
format_group.add_argument('-p', '--paths',
action='store_const',
dest='mode',
const='paths',
help='Show paths to package install directories')
format_group.add_argument(
'-s', '--short', action='store_const', dest='mode', const='short',
help='Show only specs (default)')
format_group.add_argument(
'-p', '--paths', action='store_const', dest='mode', const='paths',
help='Show paths to package install directories')
format_group.add_argument(
'-d', '--deps', action='store_const', dest='mode', const='deps',
'-d', '--deps',
action='store_const',
dest='mode',
const='deps',
help='Show full dependency DAG of installed packages')
subparser.add_argument(
'-l', '--long', action='store_true',
help='Show dependency hashes as well as versions.')
subparser.add_argument(
'-L', '--very-long', action='store_true',
help='Show dependency hashes as well as versions.')
subparser.add_argument('-l', '--long',
action='store_true',
dest='long',
help='Show dependency hashes as well as versions.')
subparser.add_argument('-L', '--very-long',
action='store_true',
dest='very_long',
help='Show dependency hashes as well as versions.')
subparser.add_argument('-f', '--show-flags',
action='store_true',
dest='show_flags',
help='Show spec compiler flags.')
subparser.add_argument(
'-e', '--explicit', action='store_true',
'-e', '--explicit',
action='store_true',
help='Show only specs that were installed explicitly')
subparser.add_argument(
'-E', '--implicit', action='store_true',
'-E', '--implicit',
action='store_true',
help='Show only specs that were installed as dependencies')
subparser.add_argument(
'-u', '--unknown', action='store_true',
'-u', '--unknown',
action='store_true',
dest='unknown',
help='Show only specs Spack does not have a package for.')
subparser.add_argument(
'-m', '--missing', action='store_true',
'-m', '--missing',
action='store_true',
dest='missing',
help='Show missing dependencies as well as installed specs.')
subparser.add_argument(
'-M', '--only-missing', action='store_true',
help='Show only missing dependencies.')
subparser.add_argument(
'-N', '--namespace', action='store_true',
help='Show fully qualified package names.')
'-v', '--variants',
action='store_true',
dest='variants',
help='Show variants in output (can be long)')
subparser.add_argument('-M', '--only-missing',
action='store_true',
dest='only_missing',
help='Show only missing dependencies.')
subparser.add_argument('-N', '--namespace',
action='store_true',
help='Show fully qualified package names.')
subparser.add_argument(
'query_specs', nargs=argparse.REMAINDER,
help='optional specs to filter results')
subparser.add_argument('query_specs',
nargs=argparse.REMAINDER,
help='optional specs to filter results')
def gray_hash(spec, length):
return colorize('@K{%s}' % spec.dag_hash(length))
def display_specs(specs, **kwargs):
mode = kwargs.get('mode', 'short')
hashes = kwargs.get('long', False)
namespace = kwargs.get('namespace', False)
hlen = 7
if kwargs.get('very_long', False):
hashes = True
hlen = None
# Make a dict with specs keyed by architecture and compiler.
index = index_by(specs, ('architecture', 'compiler'))
# Traverse the index and print out each package
for i, (architecture, compiler) in enumerate(sorted(index)):
if i > 0: print
header = "%s{%s} / %s{%s}" % (
spack.spec.architecture_color, architecture,
spack.spec.compiler_color, compiler)
tty.hline(colorize(header), char='-')
specs = index[(architecture,compiler)]
specs.sort()
nfmt = '.' if namespace else '_'
abbreviated = [s.format('$%s$@$+' % nfmt, color=True) for s in specs]
if mode == 'paths':
# Print one spec per line along with prefix path
width = max(len(s) for s in abbreviated)
width += 2
format = " %%-%ds%%s" % width
for abbrv, spec in zip(abbreviated, specs):
if hashes:
print gray_hash(spec, hlen),
print format % (abbrv, spec.prefix)
elif mode == 'deps':
for spec in specs:
print spec.tree(
format='$%s$@$+' % nfmt,
color=True,
indent=4,
prefix=(lambda s: gray_hash(s, hlen)) if hashes else None)
elif mode == 'short':
def fmt(s):
string = ""
if hashes:
string += gray_hash(s, hlen) + ' '
string += s.format('$-%s$@$+' % nfmt, color=True)
return string
colify(fmt(s) for s in specs)
else:
raise ValueError(
"Invalid mode for display_specs: %s. Must be one of (paths, deps, short)." % mode)
def find(parser, args):
# Filter out specs that don't exist.
query_specs = spack.cmd.parse_specs(args.query_specs)
query_specs, nonexisting = partition_list(
query_specs, lambda s: spack.repo.exists(s.name))
if nonexisting:
msg = "No such package%s: " % ('s' if len(nonexisting) > 1 else '')
msg += ", ".join(s.name for s in nonexisting)
tty.msg(msg)
if not query_specs:
return
def query_arguments(args):
# Check arguments
if args.explicit and args.implicit:
tty.error('You can\'t pass -E and -e options simultaneously.')
raise SystemExit(1)
# Set up query arguments.
installed, known = True, any
@@ -169,20 +118,37 @@ def find(parser, args):
installed = any
if args.unknown:
known = False
explicit = None
explicit = any
if args.explicit:
explicit = False
if args.implicit:
explicit = True
if args.implicit:
explicit = False
q_args = {'installed': installed, 'known': known, "explicit": explicit}
return q_args
q_args = { 'installed' : installed, 'known' : known, "explicit" : explicit }
def find(parser, args):
# Filter out specs that don't exist.
query_specs = spack.cmd.parse_specs(args.query_specs)
query_specs, nonexisting = partition_list(
query_specs, lambda s: spack.repo.exists(s.name) or not s.name)
if nonexisting:
msg = "No such package%s: " % ('s' if len(nonexisting) > 1 else '')
msg += ", ".join(s.name for s in nonexisting)
tty.msg(msg)
if not query_specs:
return
q_args = query_arguments(args)
# Get all the specs the user asked for
if not query_specs:
specs = set(spack.installed_db.query(**q_args))
else:
results = [set(spack.installed_db.query(qs, **q_args)) for qs in query_specs]
results = [set(spack.installed_db.query(qs, **q_args))
for qs in query_specs]
specs = set.union(*results)
if not args.mode:
@@ -190,7 +156,10 @@ def find(parser, args):
if sys.stdout.isatty():
tty.msg("%d installed packages." % len(specs))
display_specs(specs, mode=args.mode,
display_specs(specs,
mode=args.mode,
long=args.long,
very_long=args.very_long,
namespace=args.namespace)
show_flags=args.show_flags,
namespace=args.namespace,
variants=args.variants)

View File

@@ -30,6 +30,7 @@
description = "Generate graphs of package dependency relationships."
def setup_parser(subparser):
setup_parser.parser = subparser
@@ -42,10 +43,12 @@ def setup_parser(subparser):
help="Generate graph in dot format and print to stdout.")
subparser.add_argument(
'--concretize', action='store_true', help="Concretize specs before graphing.")
'--concretize', action='store_true',
help="Concretize specs before graphing.")
subparser.add_argument(
'specs', nargs=argparse.REMAINDER, help="specs of packages to graph.")
'specs', nargs=argparse.REMAINDER,
help="specs of packages to graph.")
def graph(parser, args):
@@ -56,11 +59,11 @@ def graph(parser, args):
setup_parser.parser.print_help()
return 1
if args.dot: # Dot graph only if asked for.
if args.dot: # Dot graph only if asked for.
graph_dot(*specs)
elif specs: # ascii is default: user doesn't need to provide it explicitly
elif specs: # ascii is default: user doesn't need to provide it explicitly
graph_ascii(specs[0], debug=spack.debug)
for spec in specs[1:]:
print # extra line bt/w independent graphs
print # extra line bt/w independent graphs
graph_ascii(spec, debug=spack.debug)

View File

@@ -22,14 +22,14 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import sys
description = "Get help on spack and its commands"
def setup_parser(subparser):
subparser.add_argument('help_command', nargs='?', default=None,
help='command to get help on')
def help(parser, args):
if args.help_command:
parser.parse_args([args.help_command, '-h'])

View File

@@ -29,9 +29,11 @@
description = "Get detailed information on a particular package"
def padder(str_list, extra=0):
"""Return a function to pad elements of a list."""
length = max(len(str(s)) for s in str_list) + extra
def pad(string):
string = str(string)
padding = max(0, length - len(string))
@@ -40,7 +42,8 @@ def pad(string):
def setup_parser(subparser):
subparser.add_argument('name', metavar="PACKAGE", help="Name of package to get info for.")
subparser.add_argument(
'name', metavar="PACKAGE", help="Name of package to get info for.")
def print_text_info(pkg):
@@ -81,12 +84,14 @@ def print_text_info(pkg):
print " " + fmt % (name, default, desc)
print
print "Dependencies:"
if pkg.dependencies:
colify(pkg.dependencies, indent=4)
else:
print " None"
for deptype in ('build', 'link', 'run'):
print
print "%s Dependencies:" % deptype.capitalize()
deps = sorted(pkg.dependencies_of_type(deptype))
if deps:
colify(deps, indent=4)
else:
print " None"
print
print "Virtual packages: "

View File

@@ -31,6 +31,7 @@
description = "Build and install packages"
def setup_parser(subparser):
subparser.add_argument(
'-i', '--ignore-dependencies', action='store_true', dest='ignore_deps',
@@ -52,9 +53,16 @@ def setup_parser(subparser):
help="Display verbose build output while installing.")
subparser.add_argument(
'--fake', action='store_true', dest='fake',
help="Fake install. Just remove the prefix and touch a fake file in it.")
help="Fake install. Just remove prefix and create a fake file.")
subparser.add_argument(
'packages', nargs=argparse.REMAINDER, help="specs of packages to install")
'--dirty', action='store_true', dest='dirty',
help="Install a package *without* cleaning the environment.")
subparser.add_argument(
'packages', nargs=argparse.REMAINDER,
help="specs of packages to install")
subparser.add_argument(
'--run-tests', action='store_true', dest='run_tests',
help="Run tests during installation of a package.")
def install(parser, args):
@@ -77,6 +85,8 @@ def install(parser, args):
keep_stage=args.keep_stage,
ignore_deps=args.ignore_deps,
make_jobs=args.jobs,
run_tests=args.run_tests,
verbose=args.verbose,
fake=args.fake,
dirty=args.dirty,
explicit=True)

View File

@@ -29,36 +29,62 @@
import spack
import fnmatch
import re
description = "List available spack packages"
description ="List available spack packages"
def setup_parser(subparser):
subparser.add_argument(
'filter', nargs=argparse.REMAINDER,
help='Optional glob patterns to filter results.')
subparser.add_argument(
'-i', '--insensitive', action='store_true', default=False,
help='Filtering will be case insensitive.')
'-s', '--sensitive', action='store_true', default=False,
help='Use case-sensitive filtering. Default is case sensitive, '
'unless the query contains a capital letter.')
subparser.add_argument(
'-d', '--search-description', action='store_true', default=False,
help='Filtering will also search the description for a match.')
def list(parser, args):
# Start with all package names.
pkgs = spack.repo.all_package_names()
pkgs = set(spack.repo.all_package_names())
# filter if a filter arg was provided
if args.filter:
def match(p, f):
if args.insensitive:
p = p.lower()
f = f.lower()
return fnmatch.fnmatchcase(p, f)
pkgs = [p for p in pkgs if any(match(p, f) for f in args.filter)]
res = []
for f in args.filter:
if '*' not in f and '?' not in f:
r = fnmatch.translate('*' + f + '*')
else:
r = fnmatch.translate(f)
re_flags = re.I
if any(l.isupper for l in f) or args.sensitive:
re_flags = 0
rc = re.compile(r, flags=re_flags)
res.append(rc)
if args.search_description:
def match(p, f):
if f.match(p):
return True
pkg = spack.repo.get(p)
if pkg.__doc__:
return f.match(pkg.__doc__)
return False
else:
def match(p, f):
return f.match(p)
pkgs = [p for p in pkgs if any(match(p, f) for f in res)]
# sort before displaying.
sorted_packages = sorted(pkgs, key=lambda s:s.lower())
sorted_packages = sorted(pkgs, key=lambda s: s.lower())
# Print all the package names in columns
indent=0
indent = 0
if sys.stdout.isatty():
tty.msg("%d packages." % len(sorted_packages))
colify(sorted_packages, indent=indent)

View File

@@ -25,13 +25,16 @@
import argparse
import spack.modules
description ="Add package to environment using modules."
description = "Add package to environment using modules."
def setup_parser(subparser):
"""Parser is only constructed so that this prints a nice help
message with -h. """
subparser.add_argument(
'spec', nargs=argparse.REMAINDER, help='Spec of package to load with modules.')
'spec', nargs=argparse.REMAINDER,
help="Spec of package to load with modules. "
"(If -, read specs from STDIN)")
def load(parser, args):

View File

@@ -22,8 +22,6 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import os
import sys
import argparse
import llnl.util.tty as tty
@@ -32,16 +30,19 @@
import spack
import spack.cmd
description="Print out locations of various directories used by Spack"
description = "Print out locations of various directories used by Spack"
def setup_parser(subparser):
global directories
directories = subparser.add_mutually_exclusive_group()
directories.add_argument(
'-m', '--module-dir', action='store_true', help="Spack python module directory.")
'-m', '--module-dir', action='store_true',
help="Spack python module directory.")
directories.add_argument(
'-r', '--spack-root', action='store_true', help="Spack installation root.")
'-r', '--spack-root', action='store_true',
help="Spack installation root.")
directories.add_argument(
'-i', '--install-dir', action='store_true',
@@ -53,15 +54,19 @@ def setup_parser(subparser):
'-P', '--packages', action='store_true',
help="Top-level packages directory for Spack.")
directories.add_argument(
'-s', '--stage-dir', action='store_true', help="Stage directory for a spec.")
'-s', '--stage-dir', action='store_true',
help="Stage directory for a spec.")
directories.add_argument(
'-S', '--stages', action='store_true', help="Top level Stage directory.")
'-S', '--stages', action='store_true',
help="Top level Stage directory.")
directories.add_argument(
'-b', '--build-dir', action='store_true',
help="Checked out or expanded source directory for a spec (requires it to be staged first).")
help="Checked out or expanded source directory for a spec "
"(requires it to be staged first).")
subparser.add_argument(
'spec', nargs=argparse.REMAINDER, help="spec of package to fetch directory for.")
'spec', nargs=argparse.REMAINDER,
help="spec of package to fetch directory for.")
def location(parser, args):
@@ -104,9 +109,9 @@ def location(parser, args):
if args.stage_dir:
print pkg.stage.path
else: # args.build_dir is the default.
else: # args.build_dir is the default.
if not pkg.stage.source_path:
tty.die("Build directory does not exist yet. Run this to create it:",
tty.die("Build directory does not exist yet. "
"Run this to create it:",
"spack stage " + " ".join(args.spec))
print pkg.stage.source_path

View File

@@ -36,7 +36,7 @@
def setup_parser(subparser):
setup_parser.parser = subparser
subparser.add_argument('files', nargs=argparse.REMAINDER,
help="Files to checksum.")
help="Files/urls to checksum.")
def compute_md5_checksum(url):
@@ -67,6 +67,7 @@ def md5(parser, args):
tty.warn("%s" % e)
# Dump the MD5s at last without interleaving them with downloads
tty.msg("%d MD5 checksums:" % len(results))
checksum = 'checksum' if len(results) == 1 else 'checksums'
tty.msg("%d MD5 %s:" % (len(results), checksum))
for checksum, url in results:
print "%s %s" % (checksum, url)

View File

@@ -23,7 +23,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import os
import sys
from datetime import datetime
import argparse
@@ -40,6 +39,7 @@
description = "Manage mirrors."
def setup_parser(subparser):
subparser.add_argument(
'-n', '--no-checksum', action='store_true', dest='no_checksum',
@@ -61,8 +61,9 @@ def setup_parser(subparser):
'-D', '--dependencies', action='store_true',
help="Also fetch all dependencies")
create_parser.add_argument(
'-o', '--one-version-per-spec', action='store_const', const=1, default=0,
help="Only fetch one 'preferred' version per spec, not all known versions.")
'-o', '--one-version-per-spec', action='store_const',
const=1, default=0,
help="Only fetch one 'preferred' version per spec, not all known.")
scopes = spack.config.config_scopes
@@ -70,7 +71,7 @@ def setup_parser(subparser):
add_parser = sp.add_parser('add', help=mirror_add.__doc__)
add_parser.add_argument('name', help="Mnemonic name for mirror.")
add_parser.add_argument(
'url', help="URL of mirror directory created by 'spack mirror create'.")
'url', help="URL of mirror directory from 'spack mirror create'.")
add_parser.add_argument(
'--scope', choices=scopes, default=spack.cmd.default_modify_scope,
help="Configuration scope to modify.")
@@ -107,7 +108,7 @@ def mirror_add(args):
tty.die("Mirror with url %s already exists." % url)
# should only be one item per mirror dict.
items = [(n,u) for n,u in mirrors.items()]
items = [(n, u) for n, u in mirrors.items()]
items.insert(0, (args.name, url))
mirrors = syaml_dict(items)
spack.config.update_config('mirrors', mirrors, scope=args.scope)
@@ -121,7 +122,7 @@ def mirror_remove(args):
if not mirrors:
mirrors = syaml_dict()
if not name in mirrors:
if name not in mirrors:
tty.die("No mirror with name %s" % name)
old_value = mirrors.pop(name)
@@ -152,7 +153,7 @@ def _read_specs_from_file(filename):
s.package
specs.append(s)
except SpackError, e:
tty.die("Parse error in %s, line %d:" % (args.file, i+1),
tty.die("Parse error in %s, line %d:" % (args.file, i + 1),
">>> " + string, str(e))
return specs
@@ -179,7 +180,7 @@ def mirror_create(args):
new_specs = set()
for spec in specs:
spec.concretize()
for s in spec.traverse():
for s in spec.traverse(deptype_query=spack.alldeps):
new_specs.add(s)
specs = list(new_specs)
@@ -214,10 +215,10 @@ def mirror_create(args):
def mirror(parser, args):
action = { 'create' : mirror_create,
'add' : mirror_add,
'remove' : mirror_remove,
'rm' : mirror_remove,
'list' : mirror_list }
action = {'create': mirror_create,
'add': mirror_add,
'remove': mirror_remove,
'rm': mirror_remove,
'list': mirror_list}
action[args.mirror_command](args)

View File

@@ -22,83 +22,241 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from __future__ import print_function
import collections
import os
import shutil
import sys
import llnl.util.tty as tty
import spack.cmd
from llnl.util.filesystem import mkdirp
import spack.cmd.common.arguments as arguments
import llnl.util.filesystem as filesystem
from spack.modules import module_types
from spack.util.string import *
description = "Manipulate modules and dotkits."
description = "Manipulate module files"
# Dictionary that will be populated with the list of sub-commands
# Each sub-command must be callable and accept 3 arguments :
# - mtype : the type of the module file
# - specs : the list of specs to be processed
# - args : namespace containing the parsed command line arguments
callbacks = {}
def subcommand(subparser_name):
"""Registers a function in the callbacks dictionary"""
def decorator(callback):
callbacks[subparser_name] = callback
return callback
return decorator
def setup_parser(subparser):
sp = subparser.add_subparsers(metavar='SUBCOMMAND', dest='module_command')
sp = subparser.add_subparsers(metavar='SUBCOMMAND', dest='subparser_name')
sp.add_parser('refresh', help='Regenerate all module files.')
# spack module refresh
refresh_parser = sp.add_parser('refresh', help='Regenerate module files')
refresh_parser.add_argument(
'--delete-tree',
help='Delete the module file tree before refresh',
action='store_true'
)
arguments.add_common_arguments(
refresh_parser, ['constraint', 'module_type', 'yes_to_all']
)
find_parser = sp.add_parser('find', help='Find module files for packages.')
find_parser.add_argument('module_type',
help="Type of module to find file for. [" +
'|'.join(module_types) + "]")
find_parser.add_argument('spec',
nargs='+',
help='spec to find a module file for.')
# spack module find
find_parser = sp.add_parser('find', help='Find module files for packages')
arguments.add_common_arguments(find_parser, ['constraint', 'module_type'])
# spack module rm
rm_parser = sp.add_parser('rm', help='Remove module files')
arguments.add_common_arguments(
rm_parser, ['constraint', 'module_type', 'yes_to_all']
)
# spack module loads
loads_parser = sp.add_parser(
'loads',
help='Prompt the list of modules associated with a constraint'
)
loads_parser.add_argument(
'--input-only', action='store_false', dest='shell',
help='Generate input for module command (instead of a shell script)'
)
loads_parser.add_argument(
'-p', '--prefix', dest='prefix', default='',
help='Prepend to module names when issuing module load commands'
)
arguments.add_common_arguments(
loads_parser, ['constraint', 'module_type', 'recurse_dependencies']
)
def module_find(mtype, spec_array):
"""Look at all installed packages and see if the spec provided
matches any. If it does, check whether there is a module file
of type <mtype> there, and print out the name that the user
should type to use that package's module.
class MultipleMatches(Exception):
pass
class NoMatch(Exception):
pass
@subcommand('loads')
def loads(mtype, specs, args):
"""Prompt the list of modules associated with a list of specs"""
# Get a comprehensive list of specs
if args.recurse_dependencies:
specs_from_user_constraint = specs[:]
specs = []
# FIXME : during module file creation nodes seem to be visited
# FIXME : multiple times even if cover='nodes' is given. This
# FIXME : work around permits to get a unique list of spec anyhow.
# FIXME : (same problem as in spack/modules.py)
seen = set()
seen_add = seen.add
for spec in specs_from_user_constraint:
specs.extend(
[item for item in spec.traverse(order='post', cover='nodes')
if not (item in seen or seen_add(item))]
)
module_cls = module_types[mtype]
modules = [(spec, module_cls(spec).use_name)
for spec in specs if os.path.exists(module_cls(spec).file_name)]
module_commands = {
'tcl': 'module load ',
'dotkit': 'dotkit use '
}
d = {
'command': '' if not args.shell else module_commands[mtype],
'prefix': args.prefix
}
prompt_template = '{comment}{command}{prefix}{name}'
for spec, mod in modules:
d['comment'] = '' if not args.shell else '# {0}\n'.format(
spec.format())
d['name'] = mod
print(prompt_template.format(**d))
@subcommand('find')
def find(mtype, specs, args):
"""
Look at all installed packages and see if the spec provided
matches any. If it does, check whether there is a module file
of type <mtype> there, and print out the name that the user
should type to use that package's module.
"""
if mtype not in module_types:
tty.die("Invalid module type: '%s'. Options are %s" %
(mtype, comma_or(module_types)))
specs = spack.cmd.parse_specs(spec_array)
if len(specs) > 1:
tty.die("You can only pass one spec.")
spec = specs[0]
specs = spack.installed_db.query(spec)
if len(specs) == 0:
tty.die("No installed packages match spec %s" % spec)
raise NoMatch()
if len(specs) > 1:
tty.error("Multiple matches for spec %s. Choose one:" % spec)
for s in specs:
sys.stderr.write(s.tree(color=True))
sys.exit(1)
raise MultipleMatches()
mt = module_types[mtype]
mod = mt(specs[0])
spec = specs.pop()
mod = module_types[mtype](spec)
if not os.path.isfile(mod.file_name):
tty.die("No %s module is installed for %s" % (mtype, spec))
print(mod.use_name)
def module_refresh():
"""Regenerate all module files for installed packages known to
spack (some packages may no longer exist)."""
specs = [s for s in spack.installed_db.query(installed=True, known=True)]
@subcommand('rm')
def rm(mtype, specs, args):
"""Deletes module files associated with items in specs"""
module_cls = module_types[mtype]
specs_with_modules = [
spec for spec in specs if os.path.exists(module_cls(spec).file_name)]
modules = [module_cls(spec) for spec in specs_with_modules]
for name, cls in module_types.items():
tty.msg("Regenerating %s module files." % name)
if os.path.isdir(cls.path):
shutil.rmtree(cls.path, ignore_errors=False)
mkdirp(cls.path)
for spec in specs:
cls(spec).write()
if not modules:
tty.msg('No module file matches your query')
raise SystemExit(1)
# Ask for confirmation
if not args.yes_to_all:
tty.msg(
'You are about to remove {0} module files the following specs:\n'
.format(mtype))
spack.cmd.display_specs(specs_with_modules, long=True)
print('')
spack.cmd.ask_for_confirmation('Do you want to proceed ? ')
# Remove the module files
for s in modules:
s.remove()
@subcommand('refresh')
def refresh(mtype, specs, args):
"""Regenerate module files for item in specs"""
# Prompt a message to the user about what is going to change
if not specs:
tty.msg('No package matches your query')
return
if not args.yes_to_all:
tty.msg(
'You are about to regenerate {name} module files for:\n'
.format(name=mtype))
spack.cmd.display_specs(specs, long=True)
print('')
spack.cmd.ask_for_confirmation('Do you want to proceed ? ')
cls = module_types[mtype]
# Detect name clashes
writers = [cls(spec) for spec in specs]
file2writer = collections.defaultdict(list)
for item in writers:
file2writer[item.file_name].append(item)
if len(file2writer) != len(writers):
message = 'Name clashes detected in module files:\n'
for filename, writer_list in file2writer.items():
if len(writer_list) > 1:
message += '\nfile : {0}\n'.format(filename)
for x in writer_list:
message += 'spec : {0}\n'.format(x.spec.format(color=True))
tty.error(message)
tty.error('Operation aborted')
raise SystemExit(1)
# Proceed regenerating module files
tty.msg('Regenerating {name} module files'.format(name=mtype))
if os.path.isdir(cls.path) and args.delete_tree:
shutil.rmtree(cls.path, ignore_errors=False)
filesystem.mkdirp(cls.path)
for x in writers:
x.write(overwrite=True)
def module(parser, args):
if args.module_command == 'refresh':
module_refresh()
# Qualifiers to be used when querying the db for specs
constraint_qualifiers = {
'refresh': {
'installed': True,
'known': True
},
}
arguments.ConstraintAction.qualifiers.update(constraint_qualifiers)
elif args.module_command == 'find':
module_find(args.module_type, args.spec)
module_type = args.module_type
constraint = args.constraint
try:
callbacks[args.subparser_name](module_type, args.specs, args)
except MultipleMatches:
message = ('the constraint \'{query}\' matches multiple packages, '
'and this is not allowed in this context')
tty.error(message.format(query=constraint))
for s in args.specs:
sys.stderr.write(s.format(color=True) + '\n')
raise SystemExit(1)
except NoMatch:
message = ('the constraint \'{query}\' match no package, '
'and this is not allowed in this context')
tty.die(message.format(query=constraint))

View File

@@ -22,10 +22,8 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import re
import cgi
from StringIO import StringIO
import llnl.util.tty as tty
from llnl.util.tty.colify import *
import spack
@@ -34,21 +32,22 @@
def github_url(pkg):
"""Link to a package file on github."""
return ("https://github.com/llnl/spack/blob/master/var/spack/packages/%s/package.py" %
pkg.name)
url = "https://github.com/llnl/spack/blob/master/var/spack/packages/%s/package.py"
return (url % pkg.name)
def rst_table(elts):
"""Print out a RST-style table."""
cols = StringIO()
ncol, widths = colify(elts, output=cols, tty=True)
header = " ".join("=" * (w-1) for w in widths)
header = " ".join("=" * (w - 1) for w in widths)
return "%s\n%s%s" % (header, cols.getvalue(), header)
def print_rst_package_list():
"""Print out information on all packages in restructured text."""
pkgs = sorted(spack.repo.all_packages(), key=lambda s:s.name.lower())
pkgs = sorted(spack.repo.all_packages(), key=lambda s: s.name.lower())
pkg_names = [p.name for p in pkgs]
print ".. _package-list:"
print
@@ -62,7 +61,7 @@ def print_rst_package_list():
print "Spack currently has %d mainline packages:" % len(pkgs)
print
print rst_table("`%s`_" % p.name for p in pkgs)
print rst_table("`%s`_" % p for p in pkg_names)
print
print "-----"
@@ -79,12 +78,17 @@ def print_rst_package_list():
print
if pkg.versions:
print "Versions:"
print " " + ", ".join(str(v) for v in reversed(sorted(pkg.versions)))
if pkg.dependencies:
print "Dependencies"
print " " + ", ".join("`%s`_" % d if d != "mpi" else d
for d in pkg.dependencies)
print
print " " + ", ".join(str(v) for v in
reversed(sorted(pkg.versions)))
for deptype in spack.alldeps:
deps = pkg.dependencies_of_type(deptype)
if deps:
print "%s Dependencies" % deptype.capitalize()
print " " + ", ".join("%s_" % d if d in pkg_names
else d for d in deps)
print
print "Description:"
print pkg.format_doc(indent=2)
print

View File

@@ -29,14 +29,16 @@
import spack
description="Patch expanded archive sources in preparation for install"
description = "Patch expanded archive sources in preparation for install"
def setup_parser(subparser):
subparser.add_argument(
'-n', '--no-checksum', action='store_true', dest='no_checksum',
help="Do not check downloaded packages against checksum")
subparser.add_argument(
'packages', nargs=argparse.REMAINDER, help="specs of packages to stage")
'packages', nargs=argparse.REMAINDER,
help="specs of packages to stage")
def patch(parser, args):

View File

@@ -33,6 +33,7 @@
description = "Query packages associated with particular git revisions."
def setup_parser(subparser):
sp = subparser.add_subparsers(
metavar='SUBCOMMAND', dest='pkg_command')
@@ -46,22 +47,28 @@ def setup_parser(subparser):
help="Revision to list packages for.")
diff_parser = sp.add_parser('diff', help=pkg_diff.__doc__)
diff_parser.add_argument('rev1', nargs='?', default='HEAD^',
help="Revision to compare against.")
diff_parser.add_argument('rev2', nargs='?', default='HEAD',
help="Revision to compare to rev1 (default is HEAD).")
diff_parser.add_argument(
'rev1', nargs='?', default='HEAD^',
help="Revision to compare against.")
diff_parser.add_argument(
'rev2', nargs='?', default='HEAD',
help="Revision to compare to rev1 (default is HEAD).")
add_parser = sp.add_parser('added', help=pkg_added.__doc__)
add_parser.add_argument('rev1', nargs='?', default='HEAD^',
help="Revision to compare against.")
add_parser.add_argument('rev2', nargs='?', default='HEAD',
help="Revision to compare to rev1 (default is HEAD).")
add_parser.add_argument(
'rev1', nargs='?', default='HEAD^',
help="Revision to compare against.")
add_parser.add_argument(
'rev2', nargs='?', default='HEAD',
help="Revision to compare to rev1 (default is HEAD).")
rm_parser = sp.add_parser('removed', help=pkg_removed.__doc__)
rm_parser.add_argument('rev1', nargs='?', default='HEAD^',
help="Revision to compare against.")
rm_parser.add_argument('rev2', nargs='?', default='HEAD',
help="Revision to compare to rev1 (default is HEAD).")
rm_parser.add_argument(
'rev1', nargs='?', default='HEAD^',
help="Revision to compare against.")
rm_parser.add_argument(
'rev2', nargs='?', default='HEAD',
help="Revision to compare to rev1 (default is HEAD).")
def get_git():
@@ -88,7 +95,8 @@ def pkg_add(args):
for pkg_name in args.packages:
filename = spack.repo.filename_for_package_name(pkg_name)
if not os.path.isfile(filename):
tty.die("No such package: %s. Path does not exist:" % pkg_name, filename)
tty.die("No such package: %s. Path does not exist:" %
pkg_name, filename)
git = get_git()
git('-C', spack.packages_path, 'add', filename)
@@ -112,7 +120,8 @@ def pkg_diff(args):
if u1:
print "%s:" % args.rev1
colify(sorted(u1), indent=4)
if u1: print
if u1:
print
if u2:
print "%s:" % args.rev2
@@ -122,19 +131,21 @@ def pkg_diff(args):
def pkg_removed(args):
"""Show packages removed since a commit."""
u1, u2 = diff_packages(args.rev1, args.rev2)
if u1: colify(sorted(u1))
if u1:
colify(sorted(u1))
def pkg_added(args):
"""Show packages added since a commit."""
u1, u2 = diff_packages(args.rev1, args.rev2)
if u2: colify(sorted(u2))
if u2:
colify(sorted(u2))
def pkg(parser, args):
action = { 'add' : pkg_add,
'diff' : pkg_diff,
'list' : pkg_list,
'removed' : pkg_removed,
'added' : pkg_added }
action = {'add': pkg_add,
'diff': pkg_diff,
'list': pkg_list,
'removed': pkg_removed,
'added': pkg_added}
action[args.pkg_command](args)

View File

@@ -22,7 +22,6 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import os
import argparse
from llnl.util.tty.colify import colify
@@ -30,11 +29,13 @@
import spack
import spack.cmd
description ="List packages that provide a particular virtual package"
description = "List packages that provide a particular virtual package"
def setup_parser(subparser):
subparser.add_argument('vpkg_spec', metavar='VPACKAGE_SPEC', nargs=argparse.REMAINDER,
help='Find packages that provide this virtual package')
subparser.add_argument(
'vpkg_spec', metavar='VPACKAGE_SPEC', nargs=argparse.REMAINDER,
help='Find packages that provide this virtual package')
def providers(parser, args):

View File

@@ -22,9 +22,37 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import spack
import spack.stage as stage
description = "Remove all temporary build files and downloaded archives"
description = "Remove temporary build files and/or downloaded archives"
def setup_parser(subparser):
subparser.add_argument(
'-s', '--stage', action='store_true', default=True,
help="Remove all temporary build stages (default).")
subparser.add_argument(
'-d', '--downloads', action='store_true',
help="Remove cached downloads.")
subparser.add_argument(
'-u', '--user-cache', action='store_true',
help="Remove caches in user home directory. Includes virtual indices.")
subparser.add_argument(
'-a', '--all', action='store_true',
help="Remove all of the above.")
def purge(parser, args):
stage.purge()
# Special case: no flags.
if not any((args.stage, args.downloads, args.user_cache, args.all)):
stage.purge()
return
# handle other flags with fall through.
if args.stage or args.all:
stage.purge()
if args.downloads or args.all:
spack.fetch_cache.destroy()
if args.user_cache or args.all:
spack.user_cache.destroy()

View File

@@ -30,18 +30,22 @@
import spack
def setup_parser(subparser):
subparser.add_argument(
'-c', dest='python_command', help='Command to execute.')
subparser.add_argument(
'python_args', nargs=argparse.REMAINDER, help="File to run plus arguments.")
'python_args', nargs=argparse.REMAINDER,
help="File to run plus arguments.")
description = "Launch an interpreter as spack would launch a command"
def python(parser, args):
# Fake a main python shell by setting __name__ to __main__.
console = code.InteractiveConsole({'__name__' : '__main__',
'spack' : spack})
console = code.InteractiveConsole({'__name__': '__main__',
'spack': spack})
if "PYTHONSTARTUP" in os.environ:
startup_file = os.environ["PYTHONSTARTUP"]

View File

@@ -22,10 +22,10 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import argparse
import spack
description = "Rebuild Spack's package database."
def reindex(parser, args):
spack.installed_db.reindex(spack.install_layout)

View File

@@ -23,20 +23,16 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import os
import re
import shutil
from external import argparse
import llnl.util.tty as tty
from llnl.util.filesystem import join_path, mkdirp
import spack.spec
import spack.config
from spack.util.environment import get_path
from spack.repository import *
description = "Manage package source repositories."
def setup_parser(subparser):
sp = subparser.add_subparsers(metavar='SUBCOMMAND', dest='repo_command')
scopes = spack.config.config_scopes
@@ -57,13 +53,15 @@ def setup_parser(subparser):
# Add
add_parser = sp.add_parser('add', help=repo_add.__doc__)
add_parser.add_argument('path', help="Path to a Spack package repository directory.")
add_parser.add_argument(
'path', help="Path to a Spack package repository directory.")
add_parser.add_argument(
'--scope', choices=scopes, default=spack.cmd.default_modify_scope,
help="Configuration scope to modify.")
# Remove
remove_parser = sp.add_parser('remove', help=repo_remove.__doc__, aliases=['rm'])
remove_parser = sp.add_parser(
'remove', help=repo_remove.__doc__, aliases=['rm'])
remove_parser.add_argument(
'path_or_namespace',
help="Path or namespace of a Spack package repository.")
@@ -100,7 +98,8 @@ def repo_add(args):
# If that succeeds, finally add it to the configuration.
repos = spack.config.get_config('repos', args.scope)
if not repos: repos = []
if not repos:
repos = []
if repo.root in repos or path in repos:
tty.die("Repository is already registered with Spack: %s" % path)
@@ -135,7 +134,7 @@ def repo_remove(args):
tty.msg("Removed repository %s with namespace '%s'."
% (repo.root, repo.namespace))
return
except RepoError as e:
except RepoError:
continue
tty.die("No repository with path or namespace: %s"
@@ -149,7 +148,7 @@ def repo_list(args):
for r in roots:
try:
repos.append(Repo(r))
except RepoError as e:
except RepoError:
continue
msg = "%d package repositor" % len(repos)
@@ -166,9 +165,9 @@ def repo_list(args):
def repo(parser, args):
action = { 'create' : repo_create,
'list' : repo_list,
'add' : repo_add,
'remove' : repo_remove,
'rm' : repo_remove}
action = {'create': repo_create,
'list': repo_list,
'add': repo_add,
'remove': repo_remove,
'rm': repo_remove}
action[args.repo_command](args)

View File

@@ -31,6 +31,7 @@
description = "Revert checked out package source code."
def setup_parser(subparser):
subparser.add_argument('packages', nargs=argparse.REMAINDER,
help="specs of packages to restage")

View File

@@ -0,0 +1,94 @@
##############################################################################
# Copyright (c) 2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Written by Elizabeth Fischer
# LLNL-CODE-647188
#
# For details, see https://github.com/llnl/spack
# Please also see the LICENSE file for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License (as published by
# the Free Software Foundation) version 2.1 dated February 1999.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
# conditions of the GNU General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import sys
import os
import argparse
import llnl.util.tty as tty
import spack
import spack.cmd
from spack.cmd.edit import edit_package
from spack.stage import DIYStage
description = "Create a configuration script and module, but don't build."
def setup_parser(subparser):
subparser.add_argument(
'-i', '--ignore-dependencies', action='store_true', dest='ignore_deps',
help="Do not try to install dependencies of requested packages.")
subparser.add_argument(
'-v', '--verbose', action='store_true', dest='verbose',
help="Display verbose build output while installing.")
subparser.add_argument(
'spec', nargs=argparse.REMAINDER,
help="specs to use for install. Must contain package AND version.")
def setup(self, args):
if not args.spec:
tty.die("spack setup requires a package spec argument.")
specs = spack.cmd.parse_specs(args.spec)
if len(specs) > 1:
tty.die("spack setup only takes one spec.")
# Take a write lock before checking for existence.
with spack.installed_db.write_transaction():
spec = specs[0]
if not spack.repo.exists(spec.name):
tty.warn("No such package: %s" % spec.name)
create = tty.get_yes_or_no("Create this package?", default=False)
if not create:
tty.msg("Exiting without creating.")
sys.exit(1)
else:
tty.msg("Running 'spack edit -f %s'" % spec.name)
edit_package(spec.name, spack.repo.first_repo(), None, True)
return
if not spec.versions.concrete:
tty.die(
"spack setup spec must have a single, concrete version. "
"Did you forget a package version number?")
spec.concretize()
package = spack.repo.get(spec)
# It's OK if the package is already installed.
# Forces the build to run out of the current directory.
package.stage = DIYStage(os.getcwd())
# TODO: make this an argument, not a global.
spack.do_checksum = False
package.do_install(
keep_prefix=True, # Don't remove install directory
ignore_deps=args.ignore_deps,
verbose=args.verbose,
keep_stage=True, # don't remove source dir for SETUP.
install_phases=set(['setup', 'provenance']))

View File

@@ -25,23 +25,22 @@
import argparse
import spack.cmd
import llnl.util.tty as tty
import spack
import spack.url as url
description = "print out abstract and concrete versions of a spec."
def setup_parser(subparser):
subparser.add_argument('-i', '--ids', action='store_true',
help="show numerical ids for dependencies.")
subparser.add_argument('specs', nargs=argparse.REMAINDER, help="specs of packages")
subparser.add_argument(
'specs', nargs=argparse.REMAINDER, help="specs of packages")
def spec(parser, args):
kwargs = { 'ids' : args.ids,
'indent' : 2,
'color' : True }
kwargs = {'ids': args.ids,
'indent': 2,
'color': True}
for spec in spack.cmd.parse_specs(args.specs):
print "Input spec"

View File

@@ -22,14 +22,14 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import os
import argparse
import llnl.util.tty as tty
import spack
import spack.cmd
description="Expand downloaded archive in preparation for install"
description = "Expand downloaded archive in preparation for install"
def setup_parser(subparser):
subparser.add_argument(

View File

@@ -36,25 +36,25 @@
from spack.build_environment import InstallError
from spack.fetch_strategy import FetchError
description = "Run package installation as a unit test, output formatted results."
description = "Run package install as a unit test, output formatted results."
def setup_parser(subparser):
subparser.add_argument('-j',
'--jobs',
action='store',
type=int,
help="Explicitly set number of make jobs. Default is #cpus.")
subparser.add_argument(
'-j', '--jobs', action='store', type=int,
help="Explicitly set number of make jobs. Default is #cpus.")
subparser.add_argument('-n',
'--no-checksum',
action='store_true',
dest='no_checksum',
help="Do not check packages against checksum")
subparser.add_argument(
'-n', '--no-checksum', action='store_true', dest='no_checksum',
help="Do not check packages against checksum")
subparser.add_argument('-o', '--output', action='store', help="test output goes in this file")
subparser.add_argument(
'-o', '--output', action='store',
help="test output goes in this file")
subparser.add_argument('package', nargs=argparse.REMAINDER, help="spec of package to install")
subparser.add_argument(
'package', nargs=argparse.REMAINDER,
help="spec of package to install")
class TestResult(object):
@@ -65,6 +65,7 @@ class TestResult(object):
class TestSuite(object):
def __init__(self, filename):
self.filename = filename
self.root = ET.Element('testsuite')
@@ -75,14 +76,17 @@ def __enter__(self):
def append(self, item):
if not isinstance(item, TestCase):
raise TypeError('only TestCase instances may be appended to a TestSuite instance')
raise TypeError(
'only TestCase instances may be appended to TestSuite')
self.tests.append(item) # Append the item to the list of tests
def __exit__(self, exc_type, exc_val, exc_tb):
# Prepare the header for the entire test suite
number_of_errors = sum(x.result_type == TestResult.ERRORED for x in self.tests)
number_of_errors = sum(
x.result_type == TestResult.ERRORED for x in self.tests)
self.root.set('errors', str(number_of_errors))
number_of_failures = sum(x.result_type == TestResult.FAILED for x in self.tests)
number_of_failures = sum(
x.result_type == TestResult.FAILED for x in self.tests)
self.root.set('failures', str(number_of_failures))
self.root.set('tests', str(len(self.tests)))
@@ -112,7 +116,8 @@ def __init__(self, classname, name, time=None):
self.element.set('time', str(time))
self.result_type = None
def set_result(self, result_type, message=None, error_type=None, text=None):
def set_result(self, result_type,
message=None, error_type=None, text=None):
self.result_type = result_type
result = TestCase.results[self.result_type]
if result is not None and result is not TestResult.PASSED:
@@ -133,7 +138,12 @@ def fetch_log(path):
def failed_dependencies(spec):
return set(item for item in spec.dependencies.itervalues() if not spack.repo.get(item).installed)
def get_deps(deptype):
return set(item for item in spec.dependencies(deptype)
if not spack.repo.get(item).installed)
link_deps = get_deps('link')
run_deps = get_deps('run')
return link_deps.union(run_deps)
def get_top_spec_or_die(args):
@@ -150,13 +160,19 @@ def install_single_spec(spec, number_of_jobs):
# If it is already installed, skip the test
if spack.repo.get(spec).installed:
testcase = TestCase(package.name, package.spec.short_spec, time=0.0)
testcase.set_result(TestResult.SKIPPED, message='Skipped [already installed]', error_type='already_installed')
testcase.set_result(
TestResult.SKIPPED,
message='Skipped [already installed]',
error_type='already_installed')
return testcase
# If it relies on dependencies that did not install, skip
if failed_dependencies(spec):
testcase = TestCase(package.name, package.spec.short_spec, time=0.0)
testcase.set_result(TestResult.SKIPPED, message='Skipped [failed dependencies]', error_type='dep_failed')
testcase.set_result(
TestResult.SKIPPED,
message='Skipped [failed dependencies]',
error_type='dep_failed')
return testcase
# Otherwise try to install the spec
@@ -172,26 +188,30 @@ def install_single_spec(spec, number_of_jobs):
testcase = TestCase(package.name, package.spec.short_spec, duration)
testcase.set_result(TestResult.PASSED)
except InstallError:
# An InstallError is considered a failure (the recipe didn't work correctly)
# An InstallError is considered a failure (the recipe didn't work
# correctly)
duration = time.time() - start_time
# Try to get the log
lines = fetch_log(package.build_log_path)
text = '\n'.join(lines)
testcase = TestCase(package.name, package.spec.short_spec, duration)
testcase.set_result(TestResult.FAILED, message='Installation failure', text=text)
testcase.set_result(TestResult.FAILED,
message='Installation failure', text=text)
except FetchError:
# A FetchError is considered an error (we didn't even start building)
duration = time.time() - start_time
testcase = TestCase(package.name, package.spec.short_spec, duration)
testcase.set_result(TestResult.ERRORED, message='Unable to fetch package')
testcase.set_result(TestResult.ERRORED,
message='Unable to fetch package')
return testcase
def get_filename(args, top_spec):
if not args.output:
fname = 'test-{x.name}-{x.version}-{hash}.xml'.format(x=top_spec, hash=top_spec.dag_hash())
fname = 'test-{x.name}-{x.version}-{hash}.xml'.format(
x=top_spec, hash=top_spec.dag_hash())
output_directory = join_path(os.getcwd(), 'test-output')
if not os.path.exists(output_directory):
os.mkdir(output_directory)

View File

@@ -23,33 +23,55 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import os
from pprint import pprint
from llnl.util.filesystem import join_path, mkdirp
from llnl.util.tty.colify import colify
from llnl.util.lang import list_modules
import spack
import spack.test
from spack.fetch_strategy import FetchError
description = "Run unit tests"
description ="Run unit tests"
def setup_parser(subparser):
subparser.add_argument(
'names', nargs='*', help="Names of tests to run.")
subparser.add_argument(
'-l', '--list', action='store_true', dest='list', help="Show available tests")
'-l', '--list', action='store_true', dest='list',
help="Show available tests")
subparser.add_argument(
'--createXmlOutput', action='store_true', dest='createXmlOutput',
'--createXmlOutput', action='store_true', dest='createXmlOutput',
help="Create JUnit XML from test results")
subparser.add_argument(
'--xmlOutputDir', dest='xmlOutputDir',
'--xmlOutputDir', dest='xmlOutputDir',
help="Nose creates XML files in this directory")
subparser.add_argument(
'-v', '--verbose', action='store_true', dest='verbose',
help="verbose output")
class MockCache(object):
def store(self, copyCmd, relativeDst):
pass
def fetcher(self, targetPath, digest):
return MockCacheFetcher()
class MockCacheFetcher(object):
def set_stage(self, stage):
pass
def fetch(self):
raise FetchError("Mock cache always fails for tests")
def __str__(self):
return "[mock fetcher]"
def test(parser, args):
if args.list:
print "Available tests:"
@@ -63,7 +85,8 @@ def test(parser, args):
outputDir = join_path(os.getcwd(), "test-output")
else:
outputDir = os.path.abspath(args.xmlOutputDir)
if not os.path.exists(outputDir):
mkdirp(outputDir)
spack.fetch_cache = MockCache()
spack.test.run(args.names, outputDir, args.verbose)

View File

@@ -30,7 +30,6 @@
import spack
import spack.cmd
import spack.repository
from spack.cmd.find import display_specs
description = "Remove an installed package"
@@ -39,51 +38,54 @@
b) use spack uninstall -a to uninstall ALL matching specs.
"""
def ask_for_confirmation(message):
while True:
tty.msg(message + '[y/n]')
choice = raw_input().lower()
if choice == 'y':
break
elif choice == 'n':
raise SystemExit('Operation aborted')
tty.warn('Please reply either "y" or "n"')
# Arguments for display_specs when we find ambiguity
display_args = {
'long': True,
'show_flags': True,
'variants': True
}
def setup_parser(subparser):
subparser.add_argument(
'-f', '--force', action='store_true', dest='force',
help="Remove regardless of whether other packages depend on this one.")
subparser.add_argument(
'-a', '--all', action='store_true', dest='all',
help="USE CAREFULLY. Remove ALL installed packages that match each " +
"supplied spec. i.e., if you say uninstall libelf, ALL versions of " +
"libelf are uninstalled. This is both useful and dangerous, like rm -r.")
help="USE CAREFULLY. Remove ALL installed packages that match each "
"supplied spec. i.e., if you say uninstall libelf, ALL versions "
"of libelf are uninstalled. This is both useful and dangerous, "
"like rm -r.")
subparser.add_argument(
'-d', '--dependents', action='store_true', dest='dependents',
help='Also uninstall any packages that depend on the ones given via command line.'
)
help='Also uninstall any packages that depend on the ones given '
'via command line.')
subparser.add_argument(
'-y', '--yes-to-all', action='store_true', dest='yes_to_all',
help='Assume "yes" is the answer to every confirmation asked to the user.'
help='Assume "yes" is the answer to every confirmation requested')
)
subparser.add_argument('packages', nargs=argparse.REMAINDER, help="specs of packages to uninstall")
subparser.add_argument(
'packages',
nargs=argparse.REMAINDER,
help="specs of packages to uninstall")
def concretize_specs(specs, allow_multiple_matches=False, force=False):
"""
Returns a list of specs matching the non necessarily concretized specs given from cli
"""Returns a list of specs matching the non necessarily
concretized specs given from cli
Args:
specs: list of specs to be matched against installed packages
allow_multiple_matches : boolean (if True multiple matches for each item in specs are admitted)
allow_multiple_matches : if True multiple matches are admitted
Return:
list of specs
"""
specs_from_cli = [] # List of specs that match expressions given via command line
# List of specs that match expressions given via command line
specs_from_cli = []
has_errors = False
for spec in specs:
matching = spack.installed_db.query(spec)
@@ -92,7 +94,7 @@ def concretize_specs(specs, allow_multiple_matches=False, force=False):
if not allow_multiple_matches and len(matching) > 1:
tty.error("%s matches multiple packages:" % spec)
print()
display_specs(matching, long=True)
spack.cmd.display_specs(matching, **display_args)
print()
has_errors = True
@@ -109,8 +111,8 @@ def concretize_specs(specs, allow_multiple_matches=False, force=False):
def installed_dependents(specs):
"""
Returns a dictionary that maps a spec with a list of its installed dependents
"""Returns a dictionary that maps a spec with a list of its
installed dependents
Args:
specs: list of specs to be checked for dependents
@@ -140,7 +142,7 @@ def do_uninstall(specs, force):
try:
# should work if package is known to spack
packages.append(item.package)
except spack.repository.UnknownPackageError as e:
except spack.repository.UnknownPackageError:
# The package.py file has gone away -- but still
# want to uninstall.
spack.Package(item).do_uninstall(force=True)
@@ -162,17 +164,20 @@ def uninstall(parser, args):
with spack.installed_db.write_transaction():
specs = spack.cmd.parse_specs(args.packages)
# Gets the list of installed specs that match the ones give via cli
uninstall_list = concretize_specs(specs, args.all, args.force) # takes care of '-a' is given in the cli
dependent_list = installed_dependents(uninstall_list) # takes care of '-d'
# takes care of '-a' is given in the cli
uninstall_list = concretize_specs(specs, args.all, args.force)
dependent_list = installed_dependents(
uninstall_list) # takes care of '-d'
# Process dependent_list and update uninstall_list
has_error = False
if dependent_list and not args.dependents and not args.force:
for spec, lst in dependent_list.items():
tty.error("Will not uninstall %s" % spec.format("$_$@$%@$#", color=True))
tty.error("Will not uninstall %s" %
spec.format("$_$@$%@$#", color=True))
print('')
print("The following packages depend on it:")
display_specs(lst, long=True)
spack.cmd.display_specs(lst, **display_args)
print('')
has_error = True
elif args.dependents:
@@ -181,14 +186,15 @@ def uninstall(parser, args):
uninstall_list = list(set(uninstall_list))
if has_error:
tty.die('You can use spack uninstall --dependents to uninstall these dependencies as well')
tty.die('You can use spack uninstall --dependents '
'to uninstall these dependencies as well')
if not args.yes_to_all:
tty.msg("The following packages will be uninstalled : ")
print('')
display_specs(uninstall_list, long=True)
spack.cmd.display_specs(uninstall_list, **display_args)
print('')
ask_for_confirmation('Do you want to proceed ? ')
spack.cmd.ask_for_confirmation('Do you want to proceed ? ')
# Uninstall everything on the list
do_uninstall(uninstall_list, args.force)

View File

@@ -25,13 +25,15 @@
import argparse
import spack.modules
description ="Remove package from environment using module."
description = "Remove package from environment using module."
def setup_parser(subparser):
"""Parser is only constructed so that this prints a nice help
message with -h. """
subparser.add_argument(
'spec', nargs=argparse.REMAINDER, help='Spec of package to unload with modules.')
'spec', nargs=argparse.REMAINDER,
help='Spec of package to unload with modules.')
def unload(parser, args):

View File

@@ -25,13 +25,15 @@
import argparse
import spack.modules
description ="Remove package from environment using dotkit."
description = "Remove package from environment using dotkit."
def setup_parser(subparser):
"""Parser is only constructed so that this prints a nice help
message with -h. """
subparser.add_argument(
'spec', nargs=argparse.REMAINDER, help='Spec of package to unuse with dotkit.')
'spec', nargs=argparse.REMAINDER,
help='Spec of package to unuse with dotkit.')
def unuse(parser, args):

View File

@@ -22,28 +22,28 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import sys
import llnl.util.tty as tty
import spack
import spack.url
from spack.util.web import find_versions_of_archive
description = "Show parsing of a URL, optionally spider web for other versions."
description = "Show parsing of a URL, optionally spider web for versions."
def setup_parser(subparser):
subparser.add_argument('url', help="url of a package archive")
subparser.add_argument(
'-s', '--spider', action='store_true', help="Spider the source page for versions.")
'-s', '--spider', action='store_true',
help="Spider the source page for versions.")
def print_name_and_version(url):
name, ns, nl, ntup, ver, vs, vl, vtup = spack.url.substitution_offsets(url)
underlines = [" "] * max(ns+nl, vs+vl)
for i in range(ns, ns+nl):
underlines = [" "] * max(ns + nl, vs + vl)
for i in range(ns, ns + nl):
underlines[i] = '-'
for i in range(vs, vs+vl):
for i in range(vs, vs + vl):
underlines[i] = '~'
print " %s" % url

View File

@@ -22,12 +22,12 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import sys
import spack
import spack.url
description = "Inspect urls used by packages in spack."
def setup_parser(subparser):
subparser.add_argument(
'-c', '--color', action='store_true',
@@ -53,6 +53,7 @@ def urls(parser, args):
for url in sorted(urls):
if args.color or args.extrapolation:
print spack.url.color_url(url, subs=args.extrapolation, errors=True)
print spack.url.color_url(
url, subs=args.extrapolation, errors=True)
else:
print url

View File

@@ -25,13 +25,15 @@
import argparse
import spack.modules
description ="Add package to environment using dotkit."
description = "Add package to environment using dotkit."
def setup_parser(subparser):
"""Parser is only constructed so that this prints a nice help
message with -h. """
subparser.add_argument(
'spec', nargs=argparse.REMAINDER, help='Spec of package to use with dotkit.')
'spec', nargs=argparse.REMAINDER,
help='Spec of package to use with dotkit.')
def use(parser, args):

View File

@@ -22,15 +22,16 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import os
from llnl.util.tty.colify import colify
import llnl.util.tty as tty
import spack
description ="List available versions of a package"
description = "List available versions of a package"
def setup_parser(subparser):
subparser.add_argument('package', metavar='PACKAGE', help='Package to list versions for')
subparser.add_argument('package', metavar='PACKAGE',
help='Package to list versions for')
def versions(parser, args):

295
lib/spack/spack/cmd/view.py Normal file
View File

@@ -0,0 +1,295 @@
##############################################################################
# Copyright (c) 2013, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/llnl/spack
# Please also see the LICENSE file for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License (as published by
# the Free Software Foundation) version 2.1 dated February 1999.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
# conditions of the GNU General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
'''Produce a "view" of a Spack DAG.
A "view" is file hierarchy representing the union of a number of
Spack-installed package file hierarchies. The union is formed from:
- specs resolved from the package names given by the user (the seeds)
- all depenencies of the seeds unless user specifies `--no-depenencies`
- less any specs with names matching the regular expressions given by
`--exclude`
The `view` can be built and tore down via a number of methods (the "actions"):
- symlink :: a file system view which is a directory hierarchy that is
the union of the hierarchies of the installed packages in the DAG
where installed files are referenced via symlinks.
- hardlink :: like the symlink view but hardlinks are used.
- statlink :: a view producing a status report of a symlink or
hardlink view.
The file system view concept is imspired by Nix, implemented by
brett.viren@gmail.com ca 2016.
'''
# Implementation notes:
#
# This is implemented as a visitor pattern on the set of package specs.
#
# The command line ACTION maps to a visitor_*() function which takes
# the set of package specs and any args which may be specific to the
# ACTION.
#
# To add a new view:
# 1. add a new cmd line args sub parser ACTION
# 2. add any action-specific options/arguments, most likely a list of specs.
# 3. add a visitor_MYACTION() function
# 4. add any visitor_MYALIAS assignments to match any command line aliases
import os
import re
import spack
import spack.cmd
import llnl.util.tty as tty
description = "Produce a single-rooted directory view of a spec."
def setup_parser(sp):
setup_parser.parser = sp
sp.add_argument(
'-v', '--verbose', action='store_true', default=False,
help="Display verbose output.")
sp.add_argument(
'-e', '--exclude', action='append', default=[],
help="Exclude packages with names matching the given regex pattern.")
sp.add_argument(
'-d', '--dependencies', choices=['true', 'false', 'yes', 'no'],
default='true',
help="Follow dependencies.")
ssp = sp.add_subparsers(metavar='ACTION', dest='action')
specs_opts = dict(metavar='spec', nargs='+',
help="Seed specs of the packages to view.")
# The action parameterizes the command but in keeping with Spack
# patterns we make it a subcommand.
file_system_view_actions = [
ssp.add_parser(
'symlink', aliases=['add', 'soft'],
help='Add package files to a filesystem view via symbolic links.'),
ssp.add_parser(
'hardlink', aliases=['hard'],
help='Add packages files to a filesystem via via hard links.'),
ssp.add_parser(
'remove', aliases=['rm'],
help='Remove packages from a filesystem view.'),
ssp.add_parser(
'statlink', aliases=['status', 'check'],
help='Check status of packages in a filesystem view.')
]
# All these options and arguments are common to every action.
for act in file_system_view_actions:
act.add_argument('path', nargs=1,
help="Path to file system view directory.")
act.add_argument('specs', **specs_opts)
return
def assuredir(path):
'Assure path exists as a directory'
if not os.path.exists(path):
os.makedirs(path)
def relative_to(prefix, path):
'Return end of `path` relative to `prefix`'
assert 0 == path.find(prefix)
reldir = path[len(prefix):]
if reldir.startswith('/'):
reldir = reldir[1:]
return reldir
def transform_path(spec, path, prefix=None):
'Return the a relative path corresponding to given path spec.prefix'
if os.path.isabs(path):
path = relative_to(spec.prefix, path)
subdirs = path.split(os.path.sep)
if subdirs[0] == '.spack':
lst = ['.spack', spec.name] + subdirs[1:]
path = os.path.join(*lst)
if prefix:
path = os.path.join(prefix, path)
return path
def purge_empty_directories(path):
'''Ascend up from the leaves accessible from `path`
and remove empty directories.'''
for dirpath, subdirs, files in os.walk(path, topdown=False):
for sd in subdirs:
sdp = os.path.join(dirpath, sd)
try:
os.rmdir(sdp)
except OSError:
pass
def filter_exclude(specs, exclude):
'Filter specs given sequence of exclude regex'
to_exclude = [re.compile(e) for e in exclude]
def exclude(spec):
for e in to_exclude:
if e.match(spec.name):
return True
return False
return [s for s in specs if not exclude(s)]
def flatten(seeds, descend=True):
'Normalize and flattend seed specs and descend hiearchy'
flat = set()
for spec in seeds:
if not descend:
flat.add(spec)
continue
flat.update(spec.normalized().traverse())
return flat
def check_one(spec, path, verbose=False):
'Check status of view in path against spec'
dotspack = os.path.join(path, '.spack', spec.name)
if os.path.exists(os.path.join(dotspack)):
tty.info('Package in view: "%s"' % spec.name)
return
tty.info('Package not in view: "%s"' % spec.name)
return
def remove_one(spec, path, verbose=False):
'Remove any files found in `spec` from `path` and purge empty directories.'
if not os.path.exists(path):
return # done, short circuit
dotspack = transform_path(spec, '.spack', path)
if not os.path.exists(dotspack):
if verbose:
tty.info('Skipping nonexistent package: "%s"' % spec.name)
return
if verbose:
tty.info('Removing package: "%s"' % spec.name)
for dirpath, dirnames, filenames in os.walk(spec.prefix):
if not filenames:
continue
targdir = transform_path(spec, dirpath, path)
for fname in filenames:
dst = os.path.join(targdir, fname)
if not os.path.exists(dst):
continue
os.unlink(dst)
def link_one(spec, path, link=os.symlink, verbose=False):
'Link all files in `spec` into directory `path`.'
dotspack = transform_path(spec, '.spack', path)
if os.path.exists(dotspack):
tty.warn('Skipping existing package: "%s"' % spec.name)
return
if verbose:
tty.info('Linking package: "%s"' % spec.name)
for dirpath, dirnames, filenames in os.walk(spec.prefix):
if not filenames:
continue # avoid explicitly making empty dirs
targdir = transform_path(spec, dirpath, path)
assuredir(targdir)
for fname in filenames:
src = os.path.join(dirpath, fname)
dst = os.path.join(targdir, fname)
if os.path.exists(dst):
if '.spack' in dst.split(os.path.sep):
continue # silence these
tty.warn("Skipping existing file: %s" % dst)
continue
link(src, dst)
def visitor_symlink(specs, args):
'Symlink all files found in specs'
path = args.path[0]
assuredir(path)
for spec in specs:
link_one(spec, path, verbose=args.verbose)
visitor_add = visitor_symlink
visitor_soft = visitor_symlink
def visitor_hardlink(specs, args):
'Hardlink all files found in specs'
path = args.path[0]
assuredir(path)
for spec in specs:
link_one(spec, path, os.link, verbose=args.verbose)
visitor_hard = visitor_hardlink
def visitor_remove(specs, args):
'Remove all files and directories found in specs from args.path'
path = args.path[0]
for spec in specs:
remove_one(spec, path, verbose=args.verbose)
purge_empty_directories(path)
visitor_rm = visitor_remove
def visitor_statlink(specs, args):
'Give status of view in args.path relative to specs'
path = args.path[0]
for spec in specs:
check_one(spec, path, verbose=args.verbose)
visitor_status = visitor_statlink
visitor_check = visitor_statlink
def view(parser, args):
'Produce a view of a set of packages.'
# Process common args
seeds = [spack.cmd.disambiguate_spec(s) for s in args.specs]
specs = flatten(seeds, args.dependencies.lower() in ['yes', 'true'])
specs = filter_exclude(specs, args.exclude)
# Execute the visitation.
try:
visitor = globals()['visitor_' + args.action]
except KeyError:
tty.error('Unknown action: "%s"' % args.action)
visitor(specs, args)

View File

@@ -25,21 +25,20 @@
import os
import re
import itertools
from datetime import datetime
import llnl.util.tty as tty
from llnl.util.lang import memoized
from llnl.util.filesystem import join_path
import spack.error
import spack.spec
import spack.architecture
from spack.util.multiproc import parmap
from spack.util.executable import *
from spack.util.environment import get_path
from spack.version import Version
__all__ = ['Compiler', 'get_compiler_version']
def _verify_executables(*paths):
for path in paths:
if not os.path.isfile(path) and os.access(path, os.X_OK):
@@ -48,8 +47,9 @@ def _verify_executables(*paths):
_version_cache = {}
def get_compiler_version(compiler_path, version_arg, regex='(.*)'):
if not compiler_path in _version_cache:
if compiler_path not in _version_cache:
compiler = Executable(compiler_path)
output = compiler(version_arg, output=str, error=str)
@@ -107,22 +107,41 @@ def f77_rpath_arg(self):
@property
def fc_rpath_arg(self):
return '-Wl,-rpath,'
# Cray PrgEnv name that can be used to load this compiler
PrgEnv = None
# Name of module used to switch versions of this compiler
PrgEnv_compiler = None
def __init__(self, cspec, cc, cxx, f77, fc):
def __init__(self, cspec, operating_system,
paths, modules=[], alias=None, **kwargs):
def check(exe):
if exe is None:
return None
_verify_executables(exe)
return exe
self.cc = check(cc)
self.cxx = check(cxx)
self.f77 = check(f77)
self.fc = check(fc)
self.cc = check(paths[0])
self.cxx = check(paths[1])
if len(paths) > 2:
self.f77 = check(paths[2])
if len(paths) == 3:
self.fc = self.f77
else:
self.fc = check(paths[3])
# Unfortunately have to make sure these params are accepted
# in the same order they are returned by sorted(flags)
# in compilers/__init__.py
self.flags = {}
for flag in spack.spec.FlagMap.valid_compiler_flags():
value = kwargs.get(flag, None)
if value is not None:
self.flags[flag] = value.split()
self.operating_system = operating_system
self.spec = cspec
self.modules = modules
self.alias = alias
@property
def version(self):
@@ -133,31 +152,30 @@ def version(self):
@property
def openmp_flag(self):
# If it is not overridden, assume it is not supported and warn the user
tty.die("The compiler you have chosen does not currently support OpenMP.",
"If you think it should, please edit the compiler subclass and",
"submit a pull request or issue.")
tty.die(
"The compiler you have chosen does not currently support OpenMP.",
"If you think it should, please edit the compiler subclass and",
"submit a pull request or issue.")
# This property should be overridden in the compiler subclass if
# C++11 is supported by that compiler
@property
def cxx11_flag(self):
# If it is not overridden, assume it is not supported and warn the user
tty.die("The compiler you have chosen does not currently support C++11.",
"If you think it should, please edit the compiler subclass and",
"submit a pull request or issue.")
tty.die(
"The compiler you have chosen does not currently support C++11.",
"If you think it should, please edit the compiler subclass and",
"submit a pull request or issue.")
# This property should be overridden in the compiler subclass if
# C++14 is supported by that compiler
@property
def cxx14_flag(self):
# If it is not overridden, assume it is not supported and warn the user
tty.die("The compiler you have chosen does not currently support C++14.",
"If you think it should, please edit the compiler subclass and",
"submit a pull request or issue.")
tty.die(
"The compiler you have chosen does not currently support C++14.",
"If you think it should, please edit the compiler subclass and",
"submit a pull request or issue.")
#
# Compiler classes have methods for querying the version of
@@ -166,7 +184,6 @@ def cxx14_flag(self):
# Compiler *instances* are just data objects, and can only be
# constructed from an actual set of executables.
#
@classmethod
def default_version(cls, cc):
"""Override just this to override all compiler version functions."""
@@ -188,7 +205,6 @@ def f77_version(cls, f77):
def fc_version(cls, fc):
return cls.default_version(fc)
@classmethod
def _find_matches_in_path(cls, compiler_names, detect_version, *path):
"""Finds compilers in the paths supplied.
@@ -234,91 +250,46 @@ def check(key):
version = detect_version(full_path)
return (version, prefix, suffix, full_path)
except ProcessError, e:
tty.debug("Couldn't get version for compiler %s" % full_path, e)
tty.debug(
"Couldn't get version for compiler %s" % full_path, e)
return None
except Exception, e:
# Catching "Exception" here is fine because it just
# means something went wrong running a candidate executable.
tty.debug("Error while executing candidate compiler %s" % full_path,
"%s: %s" %(e.__class__.__name__, e))
tty.debug("Error while executing candidate compiler %s"
% full_path,
"%s: %s" % (e.__class__.__name__, e))
return None
successful = [key for key in parmap(check, checks) if key is not None]
successful = [k for k in parmap(check, checks) if k is not None]
# The 'successful' list is ordered like the input paths.
# Reverse it here so that the dict creation (last insert wins)
# does not spoil the intented precedence.
successful.reverse()
return dict(((v, p, s), path) for v, p, s, path in successful)
@classmethod
def find(cls, *path):
"""Try to find this type of compiler in the user's
environment. For each set of compilers found, this returns
compiler objects with the cc, cxx, f77, fc paths and the
version filled in.
This will search for compilers with the names in cc_names,
cxx_names, etc. and it will group them if they have common
prefixes, suffixes, and versions. e.g., gcc-mp-4.7 would
be grouped with g++-mp-4.7 and gfortran-mp-4.7.
"""
dicts = parmap(
lambda t: cls._find_matches_in_path(*t),
[(cls.cc_names, cls.cc_version) + tuple(path),
(cls.cxx_names, cls.cxx_version) + tuple(path),
(cls.f77_names, cls.f77_version) + tuple(path),
(cls.fc_names, cls.fc_version) + tuple(path)])
all_keys = set()
for d in dicts:
all_keys.update(d)
compilers = {}
for k in all_keys:
ver, pre, suf = k
# Skip compilers with unknown version.
if ver == 'unknown':
continue
paths = tuple(pn[k] if k in pn else None for pn in dicts)
spec = spack.spec.CompilerSpec(cls.name, ver)
if ver in compilers:
prev = compilers[ver]
# prefer the one with more compilers.
prev_paths = [prev.cc, prev.cxx, prev.f77, prev.fc]
newcount = len([p for p in paths if p is not None])
prevcount = len([p for p in prev_paths if p is not None])
# Don't add if it's not an improvement over prev compiler.
if newcount <= prevcount:
continue
compilers[ver] = cls(spec, *paths)
return list(compilers.values())
def __repr__(self):
"""Return a string representation of the compiler toolchain."""
return self.__str__()
def __str__(self):
"""Return a string representation of the compiler toolchain."""
return "%s(%s)" % (
self.name, '\n '.join((str(s) for s in (self.cc, self.cxx, self.f77, self.fc))))
self.name, '\n '.join((str(s) for s in (
self.cc, self.cxx, self.f77, self.fc, self.modules,
str(self.operating_system)))))
class CompilerAccessError(spack.error.SpackError):
def __init__(self, path):
super(CompilerAccessError, self).__init__(
"'%s' is not a valid compiler." % path)
class InvalidCompilerError(spack.error.SpackError):
def __init__(self):
super(InvalidCompilerError, self).__init__(
"Compiler has no executables.")

View File

@@ -26,10 +26,9 @@
system and configuring Spack to use multiple compilers.
"""
import imp
import os
import platform
from llnl.util.lang import memoized, list_modules
from llnl.util.lang import list_modules
from llnl.util.filesystem import join_path
import spack
@@ -38,14 +37,12 @@
import spack.config
import spack.architecture
from spack.util.multiproc import parmap
from spack.compiler import Compiler
from spack.util.executable import which
from spack.util.naming import mod_to_class
from spack.util.environment import get_path
_imported_compilers_module = 'spack.compilers'
_required_instance_vars = ['cc', 'cxx', 'f77', 'fc']
_path_instance_vars = ['cc', 'cxx', 'f77', 'fc']
_other_instance_vars = ['modules', 'operating_system']
_cache_config_file = []
# TODO: customize order in config file
if platform.system() == 'Darwin':
@@ -64,107 +61,111 @@ def converter(cspec_like, *args, **kwargs):
def _to_dict(compiler):
"""Return a dict version of compiler suitable to insert in YAML."""
return {
str(compiler.spec) : dict(
(attr, getattr(compiler, attr, None))
for attr in _required_instance_vars)
}
d = {}
d['spec'] = str(compiler.spec)
d['paths'] = dict((attr, getattr(compiler, attr, None))
for attr in _path_instance_vars)
d['operating_system'] = str(compiler.operating_system)
d['modules'] = compiler.modules if compiler.modules else []
if compiler.alias:
d['alias'] = compiler.alias
return {'compiler': d}
def get_compiler_config(arch=None, scope=None):
def get_compiler_config(scope=None, init_config=True):
"""Return the compiler configuration for the specified architecture.
"""
# Check whether we're on a front-end (native) architecture.
my_arch = spack.architecture.sys_type()
if arch is None:
arch = my_arch
def init_compiler_config():
"""Compiler search used when Spack has no compilers."""
config[arch] = {}
compilers = find_compilers(*get_path('PATH'))
compilers = find_compilers()
compilers_dict = []
for compiler in compilers:
config[arch].update(_to_dict(compiler))
spack.config.update_config('compilers', config, scope=scope)
compilers_dict.append(_to_dict(compiler))
spack.config.update_config('compilers', compilers_dict, scope=scope)
config = spack.config.get_config('compilers', scope=scope)
# Update the configuration if there are currently no compilers
# configured. Avoid updating automatically if there ARE site
# compilers configured but no user ones.
if arch == my_arch and arch not in config:
if not config and init_config:
if scope is None:
# We know no compilers were configured in any scope.
init_compiler_config()
config = spack.config.get_config('compilers', scope=scope)
elif scope == 'user':
# Check the site config and update the user config if
# nothing is configured at the site level.
site_config = spack.config.get_config('compilers', scope='site')
if not site_config:
init_compiler_config()
return config[arch] if arch in config else {}
config = spack.config.get_config('compilers', scope=scope)
return config
elif config:
return config
else:
return [] # Return empty list which we will later append to.
def add_compilers_to_config(compilers, arch=None, scope=None):
def add_compilers_to_config(compilers, scope=None, init_config=True):
"""Add compilers to the config for the specified architecture.
Arguments:
- compilers: a list of Compiler objects.
- arch: arch to add compilers for.
- scope: configuration scope to modify.
"""
if arch is None:
arch = spack.architecture.sys_type()
compiler_config = get_compiler_config(arch, scope)
compiler_config = get_compiler_config(scope, init_config)
for compiler in compilers:
compiler_config[str(compiler.spec)] = dict(
(c, getattr(compiler, c, "None"))
for c in _required_instance_vars)
update = { arch : compiler_config }
spack.config.update_config('compilers', update, scope)
compiler_config.append(_to_dict(compiler))
global _cache_config_file
_cache_config_file = compiler_config
spack.config.update_config('compilers', compiler_config, scope)
@_auto_compiler_spec
def remove_compiler_from_config(compiler_spec, arch=None, scope=None):
def remove_compiler_from_config(compiler_spec, scope=None):
"""Remove compilers from the config, by spec.
Arguments:
- compiler_specs: a list of CompilerSpec objects.
- arch: arch to add compilers for.
- scope: configuration scope to modify.
"""
if arch is None:
arch = spack.architecture.sys_type()
# Need a better way for this
global _cache_config_file
compiler_config = get_compiler_config(arch, scope)
del compiler_config[str(compiler_spec)]
update = { arch : compiler_config }
compiler_config = get_compiler_config(scope)
config_length = len(compiler_config)
spack.config.update_config('compilers', update, scope)
filtered_compiler_config = [
comp for comp in compiler_config
if spack.spec.CompilerSpec(comp['compiler']['spec']) != compiler_spec]
# Update the cache for changes
_cache_config_file = filtered_compiler_config
if len(filtered_compiler_config) == config_length: # No items removed
CompilerSpecInsufficientlySpecificError(compiler_spec)
spack.config.update_config('compilers', filtered_compiler_config, scope)
def all_compilers_config(arch=None, scope=None):
def all_compilers_config(scope=None, init_config=True):
"""Return a set of specs for all the compiler versions currently
available to build with. These are instances of CompilerSpec.
"""
# Get compilers for this architecture.
arch_config = get_compiler_config(arch, scope)
# Merge 'all' compilers with arch-specific ones.
# Arch-specific compilers have higher precedence.
merged_config = get_compiler_config('all', scope=scope)
merged_config = spack.config._merge_yaml(merged_config, arch_config)
return merged_config
# Create a cache of the config file so we don't load all the time.
global _cache_config_file
if not _cache_config_file:
_cache_config_file = get_compiler_config(scope, init_config)
return _cache_config_file
else:
return _cache_config_file
def all_compilers(arch=None, scope=None):
def all_compilers(scope=None, init_config=True):
# Return compiler specs from the merged config.
return [spack.spec.CompilerSpec(s)
for s in all_compilers_config(arch, scope)]
return [spack.spec.CompilerSpec(s['compiler']['spec'])
for s in all_compilers_config(scope, init_config)]
def default_compiler():
@@ -179,36 +180,18 @@ def default_compiler():
return sorted(versions)[-1]
def find_compilers(*path):
def find_compilers(*paths):
"""Return a list of compilers found in the suppied paths.
This invokes the find() method for each Compiler class,
and appends the compilers detected to a list.
This invokes the find_compilers() method for each operating
system associated with the host platform, and appends
the compilers detected to a list.
"""
# Make sure path elements exist, and include /bin directories
# under prefixes.
filtered_path = []
for p in path:
# Eliminate symlinks and just take the real directories.
p = os.path.realpath(p)
if not os.path.isdir(p):
continue
filtered_path.append(p)
# Check for a bin directory, add it if it exists
bin = join_path(p, 'bin')
if os.path.isdir(bin):
filtered_path.append(os.path.realpath(bin))
# Once the paths are cleaned up, do a search for each type of
# compiler. We can spawn a bunch of parallel searches to reduce
# the overhead of spelunking all these directories.
types = all_compiler_types()
compiler_lists = parmap(lambda cls: cls.find(*filtered_path), types)
# ensure all the version calls we made are cached in the parent
# process, as well. This speeds up Spack a lot.
clist = reduce(lambda x,y: x+y, compiler_lists)
return clist
# Find compilers for each operating system class
oss = all_os_classes()
compiler_lists = []
for o in oss:
compiler_lists.extend(o.find_compilers(*paths))
return compiler_lists
def supported_compilers():
@@ -227,47 +210,85 @@ def supported(compiler_spec):
@_auto_compiler_spec
def find(compiler_spec, arch=None, scope=None):
def find(compiler_spec, scope=None):
"""Return specs of available compilers that match the supplied
compiler spec. Return an list if nothing found."""
return [c for c in all_compilers(arch, scope) if c.satisfies(compiler_spec)]
return [c for c in all_compilers(scope) if c.satisfies(compiler_spec)]
@_auto_compiler_spec
def compilers_for_spec(compiler_spec, arch=None, scope=None):
def compilers_for_spec(compiler_spec, scope=None, **kwargs):
"""This gets all compilers that satisfy the supplied CompilerSpec.
Returns an empty list if none are found.
"""
config = all_compilers_config(arch, scope)
platform = kwargs.get("platform", None)
config = all_compilers_config(scope)
def get_compiler(cspec):
items = config[str(cspec)]
def get_compilers(cspec):
compilers = []
if not all(n in items for n in _required_instance_vars):
raise InvalidCompilerConfigurationError(cspec)
for items in config:
if items['compiler']['spec'] != str(cspec):
continue
items = items['compiler']
cls = class_for_compiler_name(cspec.name)
compiler_paths = []
for c in _required_instance_vars:
compiler_path = items[c]
if compiler_path != "None":
compiler_paths.append(compiler_path)
if not ('paths' in items and
all(n in items['paths'] for n in _path_instance_vars)):
raise InvalidCompilerConfigurationError(cspec)
cls = class_for_compiler_name(cspec.name)
compiler_paths = []
for c in _path_instance_vars:
compiler_path = items['paths'][c]
if compiler_path != "None":
compiler_paths.append(compiler_path)
else:
compiler_paths.append(None)
mods = items.get('modules')
if mods == 'None':
mods = []
if 'operating_system' in items:
os = spack.architecture._operating_system_from_dict(
items['operating_system'], platform)
else:
compiler_paths.append(None)
os = None
return cls(cspec, *compiler_paths)
alias = items['alias'] if 'alias' in items else None
matches = find(compiler_spec, arch, scope)
return [get_compiler(cspec) for cspec in matches]
flags = {}
for f in spack.spec.FlagMap.valid_compiler_flags():
if f in items:
flags[f] = items[f]
compilers.append(
cls(cspec, os, compiler_paths, mods, alias, **flags))
return compilers
matches = set(find(compiler_spec, scope))
compilers = []
for cspec in matches:
compilers.extend(get_compilers(cspec))
return compilers
@_auto_compiler_spec
def compiler_for_spec(compiler_spec):
def compiler_for_spec(compiler_spec, arch):
"""Get the compiler that satisfies compiler_spec. compiler_spec must
be concrete."""
operating_system = arch.platform_os
assert(compiler_spec.concrete)
compilers = compilers_for_spec(compiler_spec)
assert(len(compilers) == 1)
compilers = [
c for c in compilers_for_spec(compiler_spec, platform=arch.platform)
if c.operating_system == operating_system]
if len(compilers) < 1:
raise NoCompilerForSpecError(compiler_spec, operating_system)
if len(compilers) > 1:
raise CompilerSpecInsufficientlySpecificError(compiler_spec)
return compilers[0]
@@ -285,18 +306,47 @@ def class_for_compiler_name(compiler_name):
return cls
def all_os_classes():
"""
Return the list of classes for all operating systems available on
this platform
"""
classes = []
platform = spack.architecture.platform()
for os_class in platform.operating_sys.values():
classes.append(os_class)
return classes
def all_compiler_types():
return [class_for_compiler_name(c) for c in supported_compilers()]
class InvalidCompilerConfigurationError(spack.error.SpackError):
def __init__(self, compiler_spec):
super(InvalidCompilerConfigurationError, self).__init__(
"Invalid configuration for [compiler \"%s\"]: " % compiler_spec,
"Compiler configuration must contain entries for all compilers: %s"
% _required_instance_vars)
% _path_instance_vars)
class NoCompilersError(spack.error.SpackError):
def __init__(self):
super(NoCompilersError, self).__init__("Spack could not find any compilers!")
super(NoCompilersError, self).__init__(
"Spack could not find any compilers!")
class NoCompilerForSpecError(spack.error.SpackError):
def __init__(self, compiler_spec, target):
super(NoCompilerForSpecError, self).__init__(
"No compilers for operating system %s satisfy spec %s"
% (target, compiler_spec))
class CompilerSpecInsufficientlySpecificError(spack.error.SpackError):
def __init__(self, compiler_spec):
super(CompilerSpecInsufficientlySpecificError, self).__init__(
"Multiple compilers satisfy spec %s" % compiler_spec)

View File

@@ -0,0 +1,55 @@
##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/llnl/spack
# Please also see the LICENSE file for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (as
# published by the Free Software Foundation) version 2.1, February 1999.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
# conditions of the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack.compiler import *
class Cce(Compiler):
"""Cray compiler environment compiler."""
# Subclasses use possible names of C compiler
cc_names = ['cc']
# Subclasses use possible names of C++ compiler
cxx_names = ['CC']
# Subclasses use possible names of Fortran 77 compiler
f77_names = ['ftn']
# Subclasses use possible names of Fortran 90 compiler
fc_names = ['ftn']
# MacPorts builds gcc versions with prefixes and -mp-X.Y suffixes.
suffixes = [r'-mp-\d\.\d']
PrgEnv = 'PrgEnv-cray'
PrgEnv_compiler = 'cce'
link_paths = {'cc': 'cc',
'cxx': 'c++',
'f77': 'f77',
'fc': 'fc'}
@classmethod
def default_version(cls, comp):
return get_compiler_version(comp, '-V', r'[Vv]ersion.*(\d+(\.\d+)+)')

View File

@@ -29,6 +29,7 @@
import llnl.util.tty as tty
from spack.version import ver
class Clang(Compiler):
# Subclasses use possible names of C compiler
cc_names = ['clang']
@@ -43,11 +44,12 @@ class Clang(Compiler):
fc_names = []
# Named wrapper links within spack.build_env_path
link_paths = { 'cc' : 'clang/clang',
'cxx' : 'clang/clang++',
# Use default wrappers for fortran, in case provided in compilers.yaml
'f77' : 'f77',
'fc' : 'f90' }
link_paths = {'cc': 'clang/clang',
'cxx': 'clang/clang++',
# Use default wrappers for fortran, in case provided in
# compilers.yaml
'f77': 'f77',
'fc': 'f90'}
@property
def is_apple(self):
@@ -73,7 +75,7 @@ def cxx11_flag(self):
return "-std=c++11"
@classmethod
def default_version(self, comp):
def default_version(cls, comp):
"""The '--version' option works for clang compilers.
On most platforms, output looks like this::
@@ -99,7 +101,7 @@ def default_version(self, comp):
ver = match.group(1) + '-apple'
else:
# Normal clang compiler versions are left as-is
match = re.search(r'^clang version ([^ )]+)', output)
match = re.search(r'clang version ([^ )]+)', output)
if match:
ver = match.group(1)

View File

@@ -26,6 +26,7 @@
from spack.compiler import *
from spack.version import ver
class Gcc(Compiler):
# Subclasses use possible names of C compiler
cc_names = ['gcc']
@@ -44,10 +45,13 @@ class Gcc(Compiler):
suffixes = [r'-mp-\d\.\d', r'-\d\.\d', r'-\d']
# Named wrapper links within spack.build_env_path
link_paths = {'cc' : 'gcc/gcc',
'cxx' : 'gcc/g++',
'f77' : 'gcc/gfortran',
'fc' : 'gcc/gfortran' }
link_paths = {'cc': 'gcc/gcc',
'cxx': 'gcc/g++',
'f77': 'gcc/gfortran',
'fc': 'gcc/gfortran'}
PrgEnv = 'PrgEnv-gnu'
PrgEnv_compiler = 'gcc'
@property
def openmp_flag(self):
@@ -76,7 +80,6 @@ def fc_version(cls, fc):
# older gfortran versions don't have simple dumpversion output.
r'(?:GNU Fortran \(GCC\))?(\d+\.\d+(?:\.\d+)?)')
@classmethod
def f77_version(cls, f77):
return cls.fc_version(f77)

Some files were not shown because too many files have changed in this diff Show More