Skip to content
Snippets Groups Projects
mpsd-software-environment.py 36 KiB
Newer Older
  • Learn to ignore specific revisions
  •                 subp.add_argument(
                        "--enable-build-cache",
                        action="store_true",
    
                            "Enable Spack build cache. Useful for reinstallation but "
                            "consumes time and disk space."
    
        # Carry out the action
        args = parser.parse_args()
    
        # target dir is the place where this script exists. the
    
        root_dir = Path(os.path.dirname(os.path.realpath(__file__)))
    
            get_installer_log_file_path(args.release, args.action, root_dir),
    
        # Check the command and run related function
    
        if args.action == "remove":
    
            remove_environment(args.release, args.toolchains, root_dir)
    
        elif args.action == "start-new":
    
            start_new_environment(args.from_release, args.to_release, root_dir)
    
        elif args.action == "install":
    
    Ashwin Kumar Karnad's avatar
    Ashwin Kumar Karnad committed
            install_environment(
    
                args.release, args.toolchains, root_dir, False, args.enable_build_cache
    
    Ashwin Kumar Karnad's avatar
    Ashwin Kumar Karnad committed
            )
    
        elif args.action == "prepare":
    
            prepare_environment(args.release, root_dir)
    
    Hans Fangohr's avatar
    Hans Fangohr committed
        elif args.action == "available":
    
            get_available_toolchains(args.release)
    
    Hans Fangohr's avatar
    Hans Fangohr committed
        else:
    
            message = (
                f"No known action found ({args.action=}). Should probably never happen."
            )
    
    Hans Fangohr's avatar
    Hans Fangohr committed
            logging.error(message)
            raise NotImplementedError(message)
    
    if __name__ == "__main__":