CMPT 373 Software Development Methods. Building Software. Nick Sumner wsumner@sfu.ca Some materials from Shlomi Fish & Kitware

Similar documents
Mastering CMake. Sixth Edition. Bill Martin & Hoffman. Ken. Andy Cedilnik, David Cole, Marcus Hanwell, Julien Jomier, Brad King, Robert Maynard,

Introduction CMake Language Specific cases. CMake Tutorial. How to setup your C/C++ projects? Luis Díaz Más.

Evaluation of the CMT and SCRAM Software Configuration, Build and Release Management Tools

Supported platforms & compilers Required software Where to download the packages Geant4 toolkit installation (release 9.6)

Installing OpenVSP on Windows 7

Magento Search Extension TECHNICAL DOCUMENTATION

Developing Platform Independent Software using the AutoTool Suite

Visual Basic Programming. An Introduction

MapGuide Open Source Repository Management Back up, restore, and recover your resource repository.

TNM093 Practical Data Visualization and Virtual Reality Laboratory Platform

Librarian. Integrating Secure Workflow and Revision Control into Your Production Environment WHITE PAPER

using version control in system administration

Getting off the ground when creating an RVM test-bench

C Programming Review & Productivity Tools

App-V Deploy and Publish

CMake/CTest/CDash OSCON 2009

Microsoft Windows PowerShell v2 For Administrators

Install guide for Websphere 7.0

RPC and TI-RPC Test Suite Test Plan Document

Lazy OpenCV installation and use with Visual Studio

Documentation Installation of the PDR code

BASIC SMARTFROG COMPONENTS AUTOMATED SOFTWARE INSTALLATION

Understanding and using catkin (and bloom) May 12, 2013 Dirk Thomas, William Woodall ROSCon 2013

Network Shutdown Module V3 Extension of the User Manual for IBM BladeCenter architecture

Building Software Systems. Multi-module C Programs. Example Multi-module C Program. Example Multi-module C Program

Code Estimation Tools Directions for a Services Engagement

Distribute your R code with R package

Automated Offsite Backup with rdiff-backup

DE4 NetFPGA Packet Generator Design User Guide

Automate Your BI Administration to Save Millions with Command Manager and System Manager

The "Eclipse Classic" version is recommended. Otherwise, a Java or RCP version of Eclipse is recommended.

Oracle R12 Apps DBA Course Contents:

1Y0-A09. Implementing Citrix XenServer Enterprise Edition

PetaLinux SDK User Guide. Application Development Guide

Table of Contents. The RCS MINI HOWTO

Using Dedicated Servers from the game

Development_Setting. Step I: Create an Android Project

Understanding Task Scheduler FIGURE Task Scheduler. The error reporting screen.

CNT5106C Project Description

Bitrix Site Manager ASP.NET. Installation Guide

Testing Tools using Visual Studio. Randy Pagels Sr. Developer Technology Specialist Microsoft Corporation

Creating OpenGL applications that use GLUT

Project Builder for Java. (Legacy)

Using Network Application Development (NAD) with InTouch

INTEL PARALLEL STUDIO EVALUATION GUIDE. Intel Cilk Plus: A Simple Path to Parallelism

ODBC Driver User s Guide. Objectivity/SQL++ ODBC Driver User s Guide. Release 10.2

Database Development Best Practices. Database Development Best Practices. Copyright 2006 Quest Software

Expedite for Windows Software Development Kit Programming Guide

Writing R packages. Tools for Reproducible Research. Karl Broman. Biostatistics & Medical Informatics, UW Madison

GIVE WINGS TO YOUR IDEAS TOOLS MANUAL

How To Deploy Lync 2010 Client Using SCCM 2012 R2

Setting up PostgreSQL

Network Security EDA /2012. Laboratory assignment 4. Revision A/576, :13:02Z

Creating a Java application using Perfect Developer and the Java Develo...

Tutorial: Packaging your server build

This document presents the new features available in ngklast release 4.4 and KServer 4.2.

Unix Shell Scripts. Contents. 1 Introduction. Norman Matloff. July 30, Introduction 1. 2 Invoking Shell Scripts 2

MATLAB as a Collaboration Platform Marta Wilczkowiak Senior Applications Engineer MathWorks

Tribal Build, Integrate, and Test System

gbuild: State of the LibreOffice build system

SendMIME Pro Installation & Users Guide

Oracle WebLogic Server

Application Note: AN00141 xcore-xa - Application Development

Deploying Microsoft Operations Manager with the BIG-IP system and icontrol

Android: How To. Thanks. Aman Nijhawan

Enterprise Service Bus

Contents. Apache Log4j. What is logging. Disadvantages 15/01/2013. What are the advantages of logging? Enterprise Systems Log4j and Maven

WebLogic Server Foundation Topology, Configuration and Administration

Integrating VoltDB with Hadoop

1z0-102 Q&A. DEMO Version

CRM 2013 Workflows. Description

SOFTWARE DEVELOPMENT BASICS SED

GTk+ and GTkGLExt Build Process for Windows 32- bit

RapidIO Network Management and Diagnostics

TAO Installation Guide v0.1. September 2012

Main Bullet #1 Main Bullet #2 Main Bullet #3

Installing (1.8.7) 9/2/ Installing jgrasp

Oracle EXAM - 1Z Oracle Weblogic Server 11g: System Administration I. Buy Full Product.

Jive Connects for Microsoft SharePoint: Troubleshooting Tips

To install Multifront you need to have familiarity with Internet Information Services (IIS), Microsoft.NET Framework and SQL Server 2008.

EXTENDED FILE SYSTEM FOR FMD AND NANO-10 PLC

To reduce or not to reduce, that is the question

MATLAB Tutorial. Chapter 6. Writing and calling functions

CLC Server Command Line Tools USER MANUAL

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science

Maven or how to automate java builds, tests and version management with open source tools

CMPT 373 Software Development Methods. Introduction. Nick Sumner

Transcription:

CMPT 373 Software Development Methods Building Software Nick Sumner wsumner@sfu.ca Some materials from Shlomi Fish & Kitware

What does it mean to build software? How many of you know how to build software? Really.

What does it mean to build software? How many of you know how to build software? Really. What does the process include?

What does it mean to build software? How many of you know how to build software? Really. What does the process include? How many of you have heard terms like Build Engineering? Build Configuration? Build Automation? Dependency Management? Continuous Integration?

What does it mean to build software? How many of you know how to build software? Really. What does the process include? How many of you have heard terms like Build Engineering? Build Configuration? Build Automation? Dependency Management? Continuous Integration? Just getting something to compile repeatably can be nontrivial

What does it mean to build software? Building software includes (at least): version control integration

What does it mean to build software? Building software includes (at least): version control integration identifying dependencies & their versions

What does it mean to build software? Building software includes (at least): version control integration identifying dependencies & their versions configuring build commands for different build modes & environments

What does it mean to build software? Building software includes (at least): version control integration identifying dependencies & their versions configuring build commands for different build modes & environments writing instructions for how to configure & build

What does it mean to build software? Building software includes (at least): version control integration identifying dependencies & their versions configuring build commands for different build modes & environments writing instructions for how to configure & build test configuration & execution (performance & correctness)

What does it mean to build software? Building software includes (at least): version control integration identifying dependencies & their versions configuring build commands for different build modes & environments writing instructions for how to configure & build test configuration & execution (performance & correctness) automated code quality checking

What does it mean to build software? Building software includes (at least): version control integration identifying dependencies & their versions configuring build commands for different build modes & environments writing instructions for how to configure & build test configuration & execution (performance & correctness) automated code quality checking scalable the compilation & linking

What does it mean to build software? Building software includes (at least): version control integration identifying dependencies & their versions configuring build commands for different build modes & environments writing instructions for how to configure & build test configuration & execution (performance & correctness) automated code quality checking scalable the compilation & linking possibly even deployment

What does it mean to build software? Building software includes (at least): version control integration identifying dependencies & their versions configuring build commands for different build modes & environments writing instructions for how to configure & build test configuration & execution (performance & correctness) automated code quality checking scalable the compilation & linking possibly even deployment It is the foundation of getting anything done.

What does it mean to build software? How many of you know how to build software? Really.

What does it mean to build software? How many of you know how to build software? Really. You should at least ask yourself: What tools do you use? What workflow? What benefits do you get? What are the painful points? Why haven't you made them less painful?

What will be be using? CMake Cross-platform build management tool Used by large projects like KDE, Wireshark, LLVM,...

What will be be using? CMake Cross-platform build management tool Used by large projects like KDE, Wireshark, LLVM,... What does it do? Given a specification & configuration of your project, CMake creates the build commands for you Analogous to autoconf (but easier to use)

What will be be using? CMake Cross-platform build management tool Used by large projects like KDE, Wireshark, LLVM,... What does it do? Given a specification & configuration of your project, CMake creates the build commands for you Analogous to autoconf (but easier to use) [DEMO]

What does this add? Why not just write makefiles manually?

What does this add? Why not just write makefiles manually? May need different makefiles for different...

What does this add? Why not just write makefiles manually? May need different makefiles for different Operating Systems Compilers Libraries Build Modes...

What does this add? Why not just write makefiles manually? May need different makefiles for different Operating Systems Compilers Libraries Build Modes... May need different source files for different

What does this add? Why not just write makefiles manually? May need different makefiles for different Operating Systems Compilers Libraries Build Modes... May need different source files for different Specification can clearly capture Libraries, versions, & even how to download them automatically Semantics of compilation & how to use in analysis tools

What does this add? Scalability Replace make with analogous scalable tools ( ninja )

What does this add? Scalability Replace make with analogous scalable tools ( ninja ) Easier tool integration CMake can export compilation rules for other tools

What does this add? Scalability Replace make with analogous scalable tools ( ninja ) Easier tool integration CMake can export compilation rules for other tools [DEMO]

Preliminary: Out of source builds A common bad habit is in source building

Preliminary: Out of source builds A common bad habit is in source building Why is this bad?

Preliminary: Out of source builds A common bad habit is in source building Why is this bad? May need multiple builds at once: debug, release,... Pollutes version control Makes clean builds complicated

Preliminary: Out of source builds A common bad habit is in source building Why is this bad? May need multiple builds at once: debug, release,... Pollutes version control Makes clean builds complicated Use out of source builds instead

Using CMake CMakeLists.txt A script in every directory of your project that controls how to build things in that directory

Using CMake CMakeLists.txt A script in every directory of your project that controls how to build things in that directory Simple syntax Case insensitive commands command( argument1 argument2 argument3...) Let's revisit demo 1!

Targets & Commands CMake allows you to specify targets Executables, libraries, objects add_executable(helloworld hellowworld.cpp) add_library(hellohelper hellohelper.cpp)

Targets & Commands CMake allows you to specify targets Executables, libraries, objects add_executable(helloworld hellowworld.cpp) add_library(hellohelper hellohelper.cpp) And commands that can describe how to build those targets Automatic for executable & library add_custom_command() can build others Documentation Media

Directories Specify to look for build scripts in subdirectories add_subdirectory(tools)

Directories Specify to look for build scripts in subdirectories add_subdirectory(tools) Specify search paths for header files or libraries include_directories(include) link_directories(lib)

Using libraries Specify that a specific target needs a library target_link_libraries(target ) lib1 lib2 lib3...

Using libraries Specify that a specific target needs a library target_link_libraries(target ) lib1 lib2 lib3... How might convenient library use affect program structure and design? How might it help us begin to handle complexity?

General project management Specifying project properties Define a project to access variables that control that project project(projectname)

General project management Specifying project properties Define a project to access variables that control that project project(projectname) Print information out during the build process message( Built with flags: ${CMAKE_CXX_FLAGS} )

General project management Specifying project properties Define a project to access variables that control that project project(projectname) Print information out during the build process message( Built with flags: ${CMAKE_CXX_FLAGS} ) Controlling where things are built set(cmake_runtime_output_directory "${PROJECT_BINARY_DIR}/bin") set(cmake_library_output_directory "${PROJECT_BINARY_DIR}/lib")

General project management Finding a resource that you need to use find_package(externalproject) find_library(library)

General project management Finding a resource that you need to use find_package(externalproject) find_library(library) Installation install(targets target1 target2... DESTINATION /tmp/ )

Control structures IF if(condition) elsif(condition2) else() endif()

Control structures IF if(condition) elsif(condition2) else() endif() Looping foreach(loop_var arg1 arg2...) command(${loop_var}) endforeach(loop_var) while(condition)...

Control structures IF if(condition) elsif(condition2) else() endif() Looping foreach(loop_var arg1 arg2...) command(${loop_var}) endforeach(loop_var) while(condition)... Functions function(function_name arg1 arg2...) command(${arg1}) endfunction(function_name)

Examples Let's take a look at some examples...