DOC PREVIEW
CU-Boulder CSCI 5828 - Build Management

This preview shows page 1-2-16-17-18-33-34 out of 34 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

© University of Colorado, 2009Build ManagementKenneth M. AndersonUniversity of Colorado, BoulderCSCI 5828 — Lecture 18 — 03/12/20091GoalsReview material from Chapter 6.5 of Pilone & MilesBuild ManagementHow do you build your codeExamplesmakeAntIDEs2Build Management (I)The process for constructing a system should be engineeredWhat are the steps to build a system?what subsystems need to be built?what libraries are needed?what resources are required?3Build Management (II)The process for constructing a system should be engineeredWho is authorized to build a system?Small projects: individual programmersLarge projects: build managers and/or configuration managers4Build Management (III)The process for constructing a system should be engineeredWhen are system builds performed?e.g. perhaps a system is so large that it can only be built at night when there are enough resources available…5Build Management (IV)Most modern programming environments have build management capabilities built into themFor instance, a Java development environment typically has the notion of a “project” and it can compile all project files in the correct order (and it only compiles files dependent on a change)These capabilities free developers from accidental difficultieshaving to remember the correct compilation ordercorrectly identifying all files dependent on a change6Make: The Granddaddy of Build Management SystemsIn Unix, a common build management tool is “make”Make provides very powerful capabilities via three types of specification stylesdeclarativeimperativerelationalThese styles are combined into one specification“the make file”7Why talk about Make?In modern projects, make is not used directlyIDEs: have build management features built inmodern build tools: ant, maven, etc. operate at higher levelopen source environments: autoconf and configure generate makefiles: developers write configure specs, autoconf does the restThe reason?The same reason calculus students learn how to do limits the “hard way” before they are taught l'Hôpital's rule8Specification Styles?Operational (or Imperative)Described according to desired actionsUsually given in terms of an execution modelDescriptive (or Declarative)Described according to desired propertiesUsually given in terms of axioms or algebrasStructural (or Relational)Described according to desired relationshipsUsually given in terms of a graphe.g. UML class diagrams9make Specification LanguageHybrid Declarative/Imperative/RelationalDependencies are RelationalMake specifies dependencies between artifactsRules are DeclarativeMake specifies rules for creating new artifactsActions are ImperativeMake specifies actions to carry out rulesThis is true of ant and other tools with similar specs. 10Example makefileTarget1: Target2 Target3 … TargetN!!\t!!!!!Action1!!\t!!!!!Action2!!\t!!!!!…!!\t!!!!!ActionNTarget2: Target5 Target6!!\t!!!!!Action3Target3: Target5 Target7!!\t!!!!!Action411Example makefileTarget1: Target2 Target3 … TargetN!!\t!!!!!Action1!!\t!!!!!Action2!!\t!!!!!…!!\t!!!!!ActionNTarget2: Target5 Target6!!\t!!!!!Action3Target3: Target5 Target7!!\t!!!!!Action411A Makefile consists of a set of rules.Each rule contains a target followed by a colon followed by a list of dependenciesEach subsequent line of a rule begins with a tab character (required) followed by an actionIf a dependency changes, make invokes a rule's action to recreate the targetWhat would happen if Target5 changed?Power from Integrationmake is well integrated into the Unix environmentTargets and Dependencies are file namesActions are shell commands12program: main.o input.o output.o g++ main.o input.o output.o -o programmain.o: main.cpp defs.h g++ -c main.cppinput.o: input.cpp defs.h g++ -c input.cppoutput.o: output.cpp defs.h g++ -c output.cppPower from Integrationmake is well integrated into the Unix environmentTargets and Dependencies are file namesActions are shell commands12program: main.o input.o output.o g++ main.o input.o output.o -o programmain.o: main.cpp defs.h g++ -c main.cppinput.o: input.cpp defs.h g++ -c input.cppoutput.o: output.cpp defs.h g++ -c output.cppWhen you realize that any shell command can go here, you begin to grok the power of makeIt is possible to automate the creation and deployment of large systems with makeWhy use make at all?Why use all the complexity of multiple specification styles when ultimately make just invokes shell commands?Why not just write a shell script?13#!/bin/bashg++ -c main.cppg++ -c input.cppg++ -c output.cppg++ main.o input.o output.o -o programWhy use make at all?Why use all the complexity of multiple specification styles when ultimately make just invokes shell commands?Why not just write a shell script?13#!/bin/bashg++ -c main.cppg++ -c input.cppg++ -c output.cppg++ main.o input.o output.o -o programWhat style does this specification use?Why not use a shell script?The (Primary) AnswerA shell script will compile each file every time its run… even if the file has not changed since the last compilation!When building large systems, such an approach does not scale!You only want to recompile changed files and the files that depend on themMake is much “smarter”by only recompiling changed files and their dependencies, make can scale to building large software systems14make wrap-upBuild management has been around a long timemake was created by Stuart Feldman in 1977Feldman was part of the group that created Unix at Bell LabsHe was an author of the first Fortran 77 compilerNow works for Google as Vice President of EngineeringWhen you click “build” in your IDE and it builds your project, you have make to thank15The Textbook ScenarioThe book highlights another reason for build managementConfiguration Management is not enough to support the day to day tasks of software developmentIf a new developer joins the team, simply checking out a copy of HEAD is not enoughHow do I compile the system?A search finds five main() methods, which one do I invoke?What configuration do I have to do before the system will run?16Building your project in one stepBuild management is all about reducing the complexity of creating your systemYou do some work up frontThen invoke a single command: “make” or “ant”Then run your systemAs the book says, modern applications are complex beastsconsisting of not just code, but libraries (aka frameworks), resources (images, sounds, movies, etc.) and more1718Example: Applications in


View Full Document

CU-Boulder CSCI 5828 - Build Management

Documents in this Course
Drupal

Drupal

31 pages

Deadlock

Deadlock

23 pages

Deadlock

Deadlock

23 pages

Deadlock

Deadlock

22 pages

Load more
Download Build Management
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Build Management and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Build Management 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?