Building with MPC Charles Calkins Principal Software Engineer Object Computing, Inc.

Slides:



Advertisements
Similar presentations
INTRODUCTION Chapter 1 1. Java CPSC 1100 University of Tennessee at Chattanooga 2  Difference between Visual Logic & Java  Lots  Visual Logic Flowcharts.
Advertisements

Transition from C to C++ …and a Review of Basic Problem Solving.
Lecture 3 Getting Started with ITK!. Goals for this lecture Learn how to use Cmake Build ITK Example programs that use ITK.
Documentation Generators: Internals of Doxygen John Tully.
CSE 1302 Lecture 8 Inheritance Richard Gesick Figures from Deitel, “Visual C#”, Pearson.
1 Mobile Computing Mobile First (formerly Worklight) Copyright 2015 by Janson Industries.
MC365 Ant. Today We Will Cover: Overview of Ant Installing Ant Using the Ant command line tool Various Ant commands available Using Ant in Eclipse.
Installing JDK Vijayan Sugumaran Department of DIS Oakland University.
Programming Introduction November 9 Unit 7. What is Programming? Besides being a huge industry? Programming is the process used to write computer programs.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Source Code Management Or Configuration Management: How I learned to Stop Worrying and Hate My Co-workers Less.
PHP Scripting Language. Introduction “PHP” is an acronym for “PHP: Hypertext Preprocessor.” It is an interpreted, server-side scripting language. Originally.
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
How to install CGAL Yuanzhen Wang. What is CGAL Computational Geometry Algorithms Library “Provide easy access to efficient and reliable geometric algorithms.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Doxygen: Source Code Documentation Generator John Tully.
Introduction to The Linaro Toolchain Embedded Processors Training Multicore Software Applications Literature Number: SPRPXXX 1.
1 Introduction to Tool chains. 2 Tool chain for the Sitara Family (but it is true for other ARM based devices as well) A tool chain is a collection of.
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
A First Program Using C#
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
11 Getting Started with C# Chapter Objectives You will be able to: 1. Say in general terms how C# differs from C. 2. Create, compile, and run a.
Lecture 8 Inheritance Richard Gesick. 2 OBJECTIVES How inheritance promotes software reusability. The concepts of base classes and derived classes. To.
Computing IV Visual C Introduction with OpenCV Example Xinwen Fu.
Using Visual Studio 2013 An Integrated Development Environment (IDE)
CS Tutorial 1 Getting Started with Visual Studio 2012 (Visual Studio 2010 are no longer available on MSDNAA, please choose Visual Studio 2012 which.
Software Engineering in Robotics Packaging and Deployment of Systems Henrik I. Christensen –
Computer Programming for Biologists Oct 30 th – Dec 11 th, 2014 Karsten Hokamp  Fill out.
Makefiles. makefiles Problem: You are working on one part of a large programming project (e. g., MS Word).  It consists of hundreds of individual.cpp.
Developing C/C++ applications with the Eclipse CDT David Gallardo.
Scons Writing Solid Code Overview What is scons? scons Basics Other cools scons stuff Resources.
Requirements and Software Development Charles Calkins Principal Software Engineer Object Computing, Inc.
JCreator Tonga Institute of Higher Education. Programming with the command line and notepad is difficult. DOS disadvantages  User Interface (UI) is not.
Active-HDL Interfaces Debugging C Code Course 10.
Chapter Ten g++ and make1 System Programming Software Development: g++ and make.
NA-MIC National Alliance for Medical Image Computing Slicer Building and Deployment Steve Pieper, PhD.
CGI Common Gateway Interface. CGI is the scheme to interface other programs to the Web Server.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
LATTICE TECHNOLOGY, INC. For Version 10.0 and later XVL Web Master Tutorial For Version 10.0 and later.
Setting up Cygwin Computer Organization I 1 May 2010 ©2010 McQuain Cygwin: getting the setup tool Free, almost complete UNIX environment emulation.
1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.
National Center for Supercomputing ApplicationsNational Computational Science Grid Packaging Technology Technical Talk University of Wisconsin Condor/GPT.
Test Specifications A Specification System for Multi-Platform Test Suite Configuration, Build, and Execution Greg Cooksey.
Dissecting the Windows CE Build Process James Y. Wilson Principal Engineer, Windows Embedded MVP CalAmp, Inc. James Y. Wilson Principal Engineer, Windows.
Copyright © 2015 Curt Hill Make An Indispensable Developer’s Tool.
M1G Introduction to Programming 2 5. Completing the program.
GLite build and integration system Building and Packaging Robert HARAKALY
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files 8/10/ :35 PM.
1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.
8 th Semester, Batch 2009 Department Of Computer Science SSUET.
Build Tools 1. Building a program for a large project is usually managed by a build tool that controls the various steps involved. These steps may include:
An EPICS IDE Using Eclipse Kenneth Evans, Jr. Presented at the EPICS Collaboration Meeting June 15, 2006 Argonne National Laboratory, Argonne, IL.
Jump-Start WDSc-RSE by Robert Arce from PrismaTech. Jump-Start WDSc-RSE Presented by: Robert Arce.
 CSC 215 : Procedural Programming with C C Compilers.
Programming C++ in Linux by various IDEs and editors by: Danial Khashabi Master: Dr.B.Taheri November 2008.
CMake - Cross-Platform Make R. Douglas Barbieri Made to Order Software Corporation.
Introduction to CMake, v. 2
CSC 215 : Procedural Programming with C
Development Environment Setup
OpenGL project setup.
Microprocessor and Assembly Language
PVS-Studio static analyzer: advanced features
CMPE 152: Compiler Design ANTLR 4 and C++
Using Visual Studio and VS Code for Embedded C/C++ Development
1. Open Visual Studio 2008.
Electronics II Physics 3620 / 6620
Lab 1 Introduction to C++.
Overview Unit testing Building Version control.
Presentation transcript:

Building with MPC Charles Calkins Principal Software Engineer Object Computing, Inc.

2 OCI’s Business Model Training –Offer over to 4-day classes OO design, languages, middleware, web tech Custom software development –Build proprietary applications for customers What I do Support of Open Source software –TAO, OpenDDS, QuickFIX/FAST, etc. These are multi-platform – need a build system

3 Makefile, Project and Workspace Creator (MPC) Started in 2002 Motivation was to build TAO on multiple architectures and compilers –Windows, Linux, … –MS Visual Studio, gcc, Borland, … Wanted a uniform way to express projects –…rather than creating Makefiles, plus a Visual Studio solution, plus… by hand

4 MPC Structure Portable – written in Perl Free – is Open Source, BSD-style license Define a project in a.mpc file –Represents a compiled module Executable or library, generally Define a workspace in a.mwc file –Represents a collection of projects Generate build files with: –mwc.pl –type.mwc

5 Hello World Executable, C++ Suppose this directory structure: Hello\ HelloCPP\ Hello.cpp Want to build under Linux, so create a Makefile

6 HelloCPP Makefile BIN = HelloCPP OBJS = Hello.o CXX = g++ CPPFLAGS = -g LD = $(CXX) $(CPPFLAGS) LDLIBS = -ldl -lpthread all: $(BIN) $(BIN): $(OBJS) $(LD) $(OBJS) $(LDLIBS) -o Hello.o: Hello.cpp $(CXX) $(CPPFLAGS) -c -o Hello.cpp

7 HelloCPP in Visual Studio 2010 Want to also build under Visual Studio –File → New Project… –Choose C++ → Win32 Console Application –Name it HelloCPP –Application Settings → Empty project toggle –Right click on the HelloCPP project, Add → Existing Item… –Select Hello.cpp

8 Time Passes… Already lots of error-prone steps, but over time the task gets bigger… –Add more projects –Use new or upgraded libraries Include and link paths, and library names, can change –Change compiler warning level across all projects –Change output directory of all projects –… and lots more After modifying all of the Makefiles, now do the Visual Studio projects, too Cumbersome, and easy to get wrong –e.g., offshored developers changed build paths to their system, checked in code to CVS - failed for us the next morning!

9 Scale With only a few projects, changes by hand are possible, but in the real world… –Flowlink (what I do) 155 projects in the workspace 700,000 lines of code –TAO/CIAO/DAnCE/OpenDDS 266 projects in the workspace 1.2 million lines of code

10 Use MPC Instead Hello\ HelloCPP\ Hello.cpp HelloCPP.mpc ← MPC file Hello.mwc ← MWC file

11 MPC Files In Hello.mwc : workspace { } In HelloCPP.mpc : project { }

12 MPC Files – For Defaults, That’s All For the workspace: –Subdirectories searched for MPC files to add For the project: –All CPP files in the current directory automatically included –Source searched for main(), if found then it is an executable, else it is a library project –Project name is set to the name of the MPC file –Default behavior can be overridden if needed, but projects often need little to nothing in each MPC file

13 Typical MPC Options exename =, libname = –Set project name to override default Source_Files {} –Specify files to compile after += –Establish dependency build current project after specified project libs += –Libraries to link to

14 Why MPC is Better MPC adds project inheritance –Workspace composition, too –Can’t do this with Makefiles or Visual Studio Create a base project in an.mpb file In mybase.mpb : project { … options … } In myproject.mpc : project: mybase { … options … }

15 Project Inheritance Set options in base projects and inherit from them (base projects can even inherit from other base projects) Options set only in one place, so only one place to change when they need modification For instance, a base project could represent a particular set of libraries – only need to update the one place when version numbers change –e.g. Apache POI for MS document management, as used by Flowlink

16 POIBase.mpb project { expand(FL_ROOT) { $FL_ROOT // base off of environment variable } // can rebase without problem libpaths += $(FL_ROOT)\bin\ikvm\poi-3.8 libpaths += $(FL_ROOT)\bin\ikvm\ikvm \bin lit_libs += $(FL_ROOT)\bin\ikvm\poi-3.8\poi- 3.8.dll lit_libs += $(FL_ROOT)\bin\ikvm\ikvm \bin\IKVM.OpenJDK.Core.dll lit_libs += $(FL_ROOT)\bin\ikvm\ikvm \bin\IKVM.Runtime.dll }

17 Tool-Specific Differences Can use base projects to hide tool differences – just inherit and not worry about it, e.g., Visual Studio vs. gcc to enable OpenMP support: In openmp.mpb : project { specific(vc8,vc9,vc10,vc11) { openmp = true } specific(make) { genflags += -fopenmp }

18 Base Project Location Many are bundled with MPC in %MPC_ROOT%\config that are automatically referenced Found if in the same directory as the MWC file For organization, can put custom ones in a subdirectory of the workspace, say config, and reference it in the MWC file (or set it on the command line) workspace { cmdline += -include config

19 Features Enable behavior by user choice –e.g., only include a project if a dependent library is installed; use requires to specify needed features –Can put in a base project so projects that inherit from it have that feature applied (don’t compile anything that needs Qt if Qt isn’t installed, say – see %MPC_ROOT%\config ) Use command-line options or features file to identify which features are enabled Features are enabled by default, so need to explicitly disable them

20 Features In HelloCPP.mpc : project { requires += hellofeature } C:\src\Hello>%MPC_ROOT%\mwc.pl -type vc10 -features hellofeature=0 Hello.mwc Generating 'vc10' output using Hello.mwc Skipping HelloCPP (HelloCPP.mpc), it requires hellofeature. Generation Time: 0s

21 Exclude Use exclude to skip projects based on the tool used workspace { CompileAlwaysProject exclude(!prop:windows) { WindowsOnlyProject }

22 Multi-language MPC supports multiple languages, too –e.g., for C#, if vc8 to vc11 is selected, the MS C# compiler is configured, but if the type is make, gmcs from Mono is used In MyWorkspace.mwc : workspace { CPPProject mycsharpprojects { cmdline += -language csharp CSharpProject1 CSharpProject2 }

23 MPC Output Currently ( -type ): –automake, bcb2007, bcb2009, bds4, bmake, cc, cdt6, cdt7, em3, ghs, gnuace, html, make, nmake, rpmspec, sle, vc6, vc7, vc71, vc8, vc9, vc10, vc11, wb26, wb30, wix Most types are for build files, but special ones, too, such as: –wix – generate XML for WiX installer toolset

24 So, Why Use MPC? Straightforward, simple syntax –Project files can even often be nearly empty Generate project files across architectures and compilers from a single description –Still need to write multi-platform code, e.g., Boost or ACE libraries for C++ C# or Java languages Centralize build settings across hundreds of projects –Flowlink is Windows-only, but this has helped greatly

25 References To get MPC – –svn://svn.dre.vanderbilt.edu/DOC/MPC/trunk To see MPC examples: –My Middleware News Briefs (C++, C#, Java) –ACE/TAO/OpenDDS (C++), QuickFAST (C++, C#)