Spack Documentation Release
Total Page:16
File Type:pdf, Size:1020Kb
Spack Documentation Release Todd Gamblin May 25, 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..........................................9 2.4 Vendor-Specific Compiler Configuration................................ 13 2.5 System Packages............................................. 16 2.6 Utilities Configuration.......................................... 18 2.7 Spack on Cray.............................................. 21 3 Basic Usage 23 3.1 Listing available packages........................................ 23 3.2 Installing and uninstalling........................................ 33 3.3 Seeing installed packages........................................ 35 3.4 Specs & dependencies.......................................... 37 3.5 Virtual dependencies........................................... 41 3.6 Extensions & Python support...................................... 43 3.7 Filesystem requirements......................................... 46 3.8 Getting Help............................................... 47 4 Workflows 51 4.1 Definitions................................................ 51 4.2 Building Packages............................................ 52 4.3 Running Binaries from Packages.................................... 54 4.4 Developing Software with Spack.................................... 60 4.5 Upstream Bug Fixes........................................... 65 5 Tutorial: Spack 101 67 5.1 Basic Installation Tutorial........................................ 67 5.2 Package Creation Tutorial........................................ 91 i 5.3 Module Configuration Tutorial...................................... 102 6 Known Issues 123 6.1 Default variants are not taken into account during concretization.................... 123 6.2 spack extensions doesn’t work.................................. 123 6.3 spack setup doesn’t work...................................... 124 7 Configuration Files in Spack 125 7.1 YAML Format.............................................. 125 7.2 Configuration Scopes........................................... 126 7.3 Platform-specific scopes......................................... 126 7.4 Scope precedence............................................ 126 8 Basic settings in config.yaml 129 8.1 Config file variables........................................... 130 8.2 install_tree ............................................ 131 8.3 install_hash_length and install_path_scheme ..................... 131 8.4 module_roots ............................................ 131 8.5 build_stage ............................................. 131 8.6 source_cache ............................................ 132 8.7 misc_cache .............................................. 132 8.8 verify_ssl .............................................. 132 8.9 checksum ................................................ 132 8.10 dirty .................................................. 132 8.11 build_jobs .............................................. 133 9 Build customization 135 9.1 External Packages............................................ 135 9.2 Concretization Preferences........................................ 136 10 Mirrors 139 10.1 spack mirror ............................................ 140 10.2 spack mirror create ....................................... 140 10.3 spack mirror add ......................................... 141 10.4 spack mirror list ........................................ 142 10.5 spack mirror remove ....................................... 142 10.6 Mirror precedence............................................ 142 10.7 Local Default Cache........................................... 142 11 Modules 143 11.1 Shell support............................................... 143 11.2 Using module files via Spack...................................... 144 11.3 Auto-generating Module Files...................................... 147 11.4 Configuration in modules.yaml ................................... 148 11.5 Maintaining Module Files........................................ 153 12 Package Repositories 155 12.1 repos.yaml .............................................. 156 12.2 Namespaces............................................... 156 12.3 Overriding built-in packages....................................... 157 12.4 spack repo .............................................. 159 12.5 Repo namespaces and Python...................................... 161 13 Command Index 163 ii 14 Contribution Guide 165 14.1 Continuous Integration.......................................... 165 14.2 Git Workflows.............................................. 169 15 Packaging Guide 173 15.1 Creating & editing packages....................................... 173 15.2 Naming & directory structure...................................... 176 15.3 Trusted Downloads............................................ 178 15.4 Versions and fetching.......................................... 178 15.5 Finding new versions........................................... 183 15.6 Fetching from code repositories..................................... 184 15.7 Resources (expanding extra tarballs)................................... 186 15.8 Licensed software............................................ 186 15.9 Patches.................................................. 188 15.10 Handling RPATHs............................................ 190 15.11 Parallel builds.............................................. 191 15.12 Dependencies............................................... 192 15.13 Conflicts................................................. 194 15.14 Extensions................................................ 195 15.15 Virtual dependencies........................................... 197 15.16 Abstract & concrete specs........................................ 198 15.17 Conflicting Specs............................................. 200 15.18 Implementing the installation procedure................................. 201 15.19 The build environment.......................................... 203 15.20 Spec objects............................................... 206 15.21 Compiler wrappers............................................ 209 15.22 MPI support in Spack.......................................... 210 15.23 Checking an installation......................................... 212 15.24 File manipulation functions....................................... 213 15.25 Style guidelines for packages...................................... 215 15.26 Packaging workflow commands..................................... 216 15.27 Graphing dependencies......................................... 217 15.28 Interactive shell support......................................... 221 16 Developer Guide 225 16.1 Overview................................................. 225 16.2 Directory Structure............................................ 226 16.3 Code Structure.............................................. 227 16.4 Spec objects............................................... 228 16.5 Package objects............................................. 228 16.6 Stage objects............................................... 229 16.7 Writing commands............................................ 229 16.8 Unit tests................................................. 229 16.9 Unit testing................................................ 229 16.10 Developer commands.......................................... 229 16.11 Profiling................................................. 232 17 Testing 233 17.1 Testing a single build........................................... 233 17.2 CDash test suites............................................. 234 18 spack package 239 18.1 Subpackages............................................... 239 18.2 Submodules............................................... 322 18.3 spack.abi module............................................. 322 iii 18.4 spack.architecture module........................................ 322 18.5 spack.build_environment module.................................... 324 18.6 spack.compiler module.......................................... 327 18.7 spack.concretize module......................................... 328 18.8 spack.config module........................................... 329 18.9 spack.database module.......................................... 331 18.10 spack.directives module......................................... 333 18.11 spack.directory_layout module...................................... 334 18.12 spack.environment module........................................ 337 18.13 spack.error module............................................ 339 18.14 spack.fetch_strategy module....................................... 340 18.15 spack.file_cache module......................................... 344 18.16 spack.graph module........................................... 345 18.17 spack.main module............................................ 346 18.18 spack.mirror module........................................... 347 18.19 spack.modules module.........................................