Release 0.11 Todd Gamblin
Total Page:16
File Type:pdf, Size:1020Kb
Spack Documentation Release 0.11 Todd Gamblin Feb 07, 2018 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 GPG Signing............................................... 20 2.8 Spack on Cray.............................................. 21 3 Basic Usage 25 3.1 Listing available packages........................................ 25 3.2 Installing and uninstalling........................................ 42 3.3 Seeing installed packages........................................ 44 3.4 Specs & dependencies.......................................... 46 3.5 Virtual dependencies........................................... 50 3.6 Extensions & Python support...................................... 53 3.7 Filesystem requirements......................................... 56 3.8 Getting Help............................................... 57 4 Workflows 61 4.1 Definitions................................................ 61 4.2 Building Packages............................................ 62 4.3 Running Binaries from Packages.................................... 64 4.4 Developing Software with Spack.................................... 69 4.5 Using Spack on Travis-CI........................................ 74 4.6 Using Spack to Create Docker Images.................................. 76 4.7 Upstream Bug Fixes........................................... 78 i 5 Tutorial: Spack 101 81 5.1 Basic Installation Tutorial........................................ 82 5.2 Configuration Tutorial.......................................... 123 5.3 Package Creation Tutorial........................................ 139 5.4 Spack Package Build Systems...................................... 150 5.5 Advanced Topics in Packaging...................................... 184 5.6 Module Files............................................... 193 6 Known Issues 223 6.1 Default variants are not taken into account during concretization.................... 223 6.2 Variants are not properly forwarded to dependencies.......................... 223 6.3 spack setup doesn’t work...................................... 224 7 Configuration Files in Spack 225 7.1 YAML Format.............................................. 225 7.2 Configuration Scopes........................................... 226 7.3 Platform-specific scopes......................................... 226 7.4 Scope precedence............................................ 227 7.5 Config file variables........................................... 229 8 Basic settings in config.yaml 231 8.1 install_tree ............................................ 232 8.2 install_hash_length and install_path_scheme ..................... 233 8.3 module_roots ............................................ 233 8.4 build_stage ............................................. 233 8.5 source_cache ............................................ 234 8.6 misc_cache .............................................. 234 8.7 verify_ssl .............................................. 234 8.8 checksum ................................................ 234 8.9 dirty .................................................. 234 8.10 build_jobs .............................................. 235 9 Build customization 237 9.1 External Packages............................................ 237 9.2 Concretization Preferences........................................ 238 10 Mirrors 241 10.1 spack mirror ............................................ 242 10.2 spack mirror create ....................................... 242 10.3 spack mirror add ......................................... 243 10.4 spack mirror list ........................................ 244 10.5 spack mirror remove ....................................... 244 10.6 Mirror precedence............................................ 244 10.7 Local Default Cache........................................... 244 11 Modules 245 11.1 Using module files via Spack...................................... 245 11.2 Module file customization........................................ 249 11.3 Maintaining Module Files........................................ 255 12 Package Repositories 259 12.1 repos.yaml .............................................. 260 12.2 Namespaces............................................... 260 12.3 Overriding built-in packages....................................... 261 12.4 spack repo .............................................. 263 ii 12.5 Repo namespaces and Python...................................... 265 13 Build caches 267 13.1 Creating build cache files........................................ 267 13.2 Finding or installing build cache files.................................. 267 13.3 Relocation................................................ 268 13.4 spack buildcache ......................................... 268 14 Command Index 271 15 Package List 273 16 Contribution Guide 275 16.1 Continuous Integration.......................................... 275 16.2 Coverage................................................. 279 16.3 Git Workflows.............................................. 280 17 Packaging Guide 285 17.1 Creating & editing packages....................................... 285 17.2 Naming & directory structure...................................... 288 17.3 Trusted Downloads............................................ 290 17.4 Versions and fetching.......................................... 290 17.5 Finding new versions........................................... 294 17.6 Fetching from code repositories..................................... 296 17.7 Resources (expanding extra tarballs)................................... 298 17.8 Licensed software............................................ 298 17.9 Patches.................................................. 300 17.10 Handling RPATHs............................................ 303 17.11 Parallel builds.............................................. 303 17.12 Dependencies............................................... 304 17.13 Conflicts................................................. 308 17.14 Extensions................................................ 308 17.15 Virtual dependencies........................................... 311 17.16 Abstract & concrete specs........................................ 312 17.17 Conflicting Specs............................................. 314 17.18 Implementing the installation procedure................................. 315 17.19 The build environment.......................................... 317 17.20 Spec objects............................................... 322 17.21 Compiler wrappers............................................ 325 17.22 MPI support in Spack.......................................... 326 17.23 Checking an installation......................................... 328 17.24 File manipulation functions....................................... 329 17.25 Style guidelines for packages...................................... 331 17.26 Packaging workflow commands..................................... 331 17.27 Graphing dependencies......................................... 333 17.28 Interactive shell support......................................... 338 18 Developer Guide 343 18.1 Overview................................................. 343 18.2 Directory Structure............................................ 344 18.3 Code Structure.............................................. 345 18.4 Spec objects............................................... 346 18.5 Package objects............................................. 346 18.6 Stage objects............................................... 347 18.7 Writing commands............................................ 347 iii 18.8 Unit tests................................................. 347 18.9 Unit testing................................................ 347 18.10 Developer commands.......................................... 347 18.11 Profiling................................................. 350 19 spack package 351 19.1 Subpackages............................................... 351 19.2 Submodules............................................... 451 19.3 spack.abi module............................................. 451 19.4 spack.architecture module........................................ 451 19.5 spack.binary_distribution module.................................... 453 19.6 spack.build_environment module.................................... 455 19.7 spack.compiler module.......................................... 457 19.8 spack.concretize module......................................... 458 19.9 spack.config module........................................... 459 19.10 spack.database module.......................................... 461 19.11 spack.dependency module........................................ 463 19.12