Spack Documentation Release 0.9
Total Page:16
File Type:pdf, Size:1020Kb
Spack Documentation Release 0.9 Todd Gamblin January 03, 2017 Basics 1 Feature Overview 3 1.1 Simple package installation.......................................3 1.2 Custom versions & configurations....................................3 1.3 Customize dependencies.........................................4 1.4 Non-destructive installs.........................................4 1.5 Packages can peacefully coexist.....................................4 1.6 Creating packages is easy........................................4 2 Getting Started 7 2.1 Prerequisites...............................................7 2.2 Installation................................................7 2.3 Compiler configuration..........................................8 2.4 Vendor-Specific Compiler Configuration................................ 13 2.5 System Packages............................................. 15 2.6 Utilities Configuration.......................................... 17 2.7 Spack on Cray.............................................. 19 3 Basic Usage 23 3.1 Listing available packages........................................ 23 3.2 Installing and uninstalling........................................ 29 3.3 Seeing installed packages........................................ 31 3.4 Specs & dependencies.......................................... 33 3.5 Virtual dependencies........................................... 37 3.6 Extensions & Python support...................................... 40 3.7 Filesystem requirements......................................... 42 3.8 Getting Help............................................... 43 4 Workflows 47 4.1 Definitions................................................ 47 4.2 Building Packages............................................ 48 4.3 Running Binaries from Packages.................................... 50 4.4 Developing Software with Spack.................................... 55 4.5 Upstream Bug Fixes........................................... 60 5 Tutorial: Spack 101 63 5.1 Basic Installation Tutorial........................................ 63 5.2 Package Creation Tutorial........................................ 86 5.3 Module Configuration Tutorial...................................... 95 i 5.4 Feature Overview............................................ 109 6 Configuration Files in Spack 117 6.1 YAML Format.............................................. 117 6.2 Configuration Scopes........................................... 117 6.3 Platform-specific scopes......................................... 118 6.4 Scope precedence............................................ 118 7 Basic settings in config.yaml 121 7.1 Config file variables........................................... 122 7.2 install_tree ............................................ 122 7.3 module_roots ............................................ 122 7.4 build_stage ............................................. 123 7.5 source_cache ............................................ 123 7.6 misc_cache .............................................. 123 7.7 verify_ssl .............................................. 124 7.8 checksum ................................................ 124 7.9 dirty .................................................. 124 8 Build customization 125 8.1 External Packages............................................ 125 8.2 Concretization Preferences........................................ 126 9 Mirrors 129 9.1 spack mirror ............................................ 130 9.2 spack mirror create ....................................... 130 9.3 spack mirror add ......................................... 131 9.4 spack mirror list ........................................ 132 9.5 spack mirror remove ....................................... 132 9.6 Mirror precedence............................................ 132 9.7 Local Default Cache........................................... 132 10 Modules 133 10.1 Shell support............................................... 133 10.2 Using module files via Spack...................................... 133 10.3 Auto-generating Module Files...................................... 137 10.4 Configuration in modules.yaml ................................... 138 10.5 Maintaining Module Files........................................ 142 11 Package Repositories 145 11.1 repos.yaml .............................................. 145 11.2 Namespaces............................................... 146 11.3 Overriding built-in packages....................................... 147 11.4 spack repo .............................................. 149 11.5 Repo namespaces and Python...................................... 150 12 Command Index 153 13 Contribution Guide 155 13.1 Continuous Integration.......................................... 155 13.2 Git Workflows.............................................. 168 14 Packaging Guide 173 14.1 Creating & editing packages....................................... 173 14.2 Naming & directory structure...................................... 176 ii 14.3 Trusted Downloads............................................ 178 14.4 Package Version Numbers........................................ 178 14.5 Adding new versions........................................... 179 14.6 Fetching from VCS repositories..................................... 182 14.7 Standard repositories for python packages................................ 184 14.8 Expanding additional resources in the source tree............................ 185 14.9 Automatic caching of files fetched during installation.......................... 185 14.10 Licensed software............................................ 185 14.11 Patches.................................................. 187 14.12 Handling RPATHs............................................ 189 14.13 Finding new versions........................................... 189 14.14 Parallel builds.............................................. 191 14.15 Dependencies............................................... 191 14.16 Extensions................................................ 194 14.17 Virtual dependencies........................................... 196 14.18 Abstract & concrete specs........................................ 197 14.19 Inconsistent Specs............................................ 199 14.20 Implementing the install method.................................. 200 14.21 The install environment......................................... 200 14.22 Failing the build............................................. 203 14.23 Prefix objects............................................... 203 14.24 Spec objects............................................... 204 14.25 Shell command functions........................................ 207 14.26 Sanity checking an installation...................................... 207 14.27 File manipulation functions....................................... 208 14.28 Coding Style Guidelines......................................... 210 14.29 Packaging workflow commands..................................... 211 14.30 Graphing dependencies......................................... 212 14.31 Interactive shell support......................................... 215 15 Developer Guide 219 15.1 Overview................................................. 219 15.2 Directory Structure............................................ 220 15.3 Code Structure.............................................. 220 15.4 Spec objects............................................... 222 15.5 Package objects............................................. 222 15.6 Stage objects............................................... 223 15.7 Writing commands............................................ 223 15.8 Unit tests................................................. 223 15.9 Unit testing................................................ 223 15.10 Developer commands.......................................... 223 15.11 Profiling................................................. 223 16 spack package 225 16.1 Subpackages............................................... 225 16.2 Submodules............................................... 287 16.3 spack.abi module............................................. 287 16.4 spack.architecture module........................................ 287 16.5 spack.build_environment module.................................... 290 16.6 spack.compiler module.......................................... 292 16.7 spack.concretize module......................................... 293 16.8 spack.config module........................................... 294 16.9 spack.database module.......................................... 296 16.10 spack.directives module......................................... 297 iii 16.11 spack.directory_layout module...................................... 299 16.12 spack.environment module........................................ 301 16.13 spack.error module............................................ 303 16.14 spack.fetch_strategy module....................................... 303 16.15 spack.file_cache module......................................... 308 16.16 spack.graph module........................................... 308 16.17 spack.mirror module........................................... 309 16.18 spack.modules module.......................................... 310 16.19 spack.multimethod module........................................ 312 16.20 spack.package module.......................................... 313 16.21 spack.package_test module....................................... 323 16.22 spack.parse module...........................................