Make was originally a Unix tool from 1976, but it has been re-implemented several times, notably as GNU Make.

Size: px
Start display at page:

Download "Make was originally a Unix tool from 1976, but it has been re-implemented several times, notably as GNU Make."

Transcription

1 make Make was originally a Unix tool from 1976, but it has been re-implemented several times, notably as GNU Make. Make accepts a Makefile, which is a strictly formatted file detailing a series of desired outputs, their dependencies, and how these should be composed together to yield the requested output. Makefiles contain five kinds of things: explicit rules, implicit rules, variable definitions, directives, and comments. An explicit rule says when and how to remake one or more files, called the rule's targets. It lists the other files that the targets depend on, called the prerequisites of the target, and may also give a recipe to use to create or update the targets. An implicit rule says when and how to remake a class of files based on their names. It describes how a target may depend on a file with a name similar to the target and gives a recipe to create or update such a target. A variable definition is a line that specifies a text string value for a variable that can be substituted into the text later. A directive is an instruction for make to do something special while reading the makefile such as reading another makefile. # in a line of a makefile starts a comment. It and the rest of the line are ignored. compatibility with bash/sh/etc. note that variable defns have spaces around equals, for instance variables: CC,FC, CFLAGS,CXX, etc. The Makefile rules for building and installation can also use compilers and related programs, but should do so via make variables so that the user can substitute alternatives. Here are some of the programs we mean: ar bison cc flex install ld ldconfig lex make makeinfo ranlib texi2dvi yacc Use the following make variables to run those programs: $(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LDCONFIG) $(LEX) $(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC) Also: $(FC) $(CXX) An example Makefile: SHELL = /bin/sh OBJS = hello_world_openmp.o # On a Mac, g++ is an alias for clang which doesn't have great OpenMP support. ARCH := $(firstword $(shell uname -s)) ifeq ($(ARCH),Darwin) CC = gcc-4.8 else CC = gcc endif.suffixes:.suffixes:.c.o

2 DEBUG = -g CFLAGS = -Wall -c $(DEBUG) -fopenmp -std=c99 LFLAGS = -Wall -lm $(DEBUG) -fopenmp hello_world_openmp : $(OBJS) $(CC) $(LFLAGS) $(OBJS) -o hello_world_openmp hello_world_openmp.o : hello_world_openmp.c $(CC) $(CFLAGS) hello_world_openmp.c clean: rm *.o hello_world_openmp tar: tar cfv hello_world_openmp.tar hello_world_openmp.c test: echo "Executing with 1 thread:" OMP_NUM_THREADS=1 echo "Executing with 2 threads:" OMP_NUM_THREADS=2 echo "Executing with 4 threads:" OMP_NUM_THREADS=4 echo "Executing with 8 threads:" OMP_NUM_THREADS=8 requires file: #include <stdio.h> #include <omp.h> int main(int argc, char *argv[]) { int rank_id; double start_time, wall_time; printf("c OpenMP minimal working example\n"); int num_ranks = omp_get_num_procs(); printf("number of available processors = %d.\n", num_ranks); int num_threads = omp_get_max_threads(); printf("number of available threads = %d.\n", num_threads); start_time = omp_get_wtime(); #pragma omp parallel private (rank_id) {

3 } rank_id = omp_get_thread_num(); printf("\tprocess number %d branching off.\n", rank_id); wall_time = omp_get_wtime() - start_time; } printf("elapsed wallclock time = %8.6fs.\n", wall_time); return 0; There are magic variables that are important to know about. A file could be written as: CC = gcc Warnings = -Wall test: test.o anothertest.o $(CC) $(Warnings) $^ -o $@ test.o: test.c $(CC) -c $(Warnings) $< anothertest.o: anothertest.c $(CC) -c $(Warning) $< clean: rm -rf *.o test Here $@ becomes the target, $< is the first prerequesite, and $^ is all the prerequisites. This has made the file less readable, but doesn t offer any benefit in this simiple example. And naturally, make install may be a bit more complicated than you might have thought. It can range from a simple attempt to copy things over to /usr/bin (see man install ) to a sophisticated system-independent wrapper: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: $(AM_MAKEFLAGS) install-exec-am install-data-am./configure Why Autoconf? [Make's] lack of support for automatic dependency tracking, recursive builds in subdirectories, reliable timestamps (e.g., for network file systems)

4 The configuration scripts that Autoconf produces are by convention called configure. When run, configure creates several files, replacing configuration parameters in them with appropriate values. The files that configure creates are: one or more Makefile files, usually one in each subdirectory of the package (see Makefile Substitutions); optionally, a C header file, the name of which is configurable, containing #define` directives (see Configuration Headers); a shell script called config.status that, when run, recreates the files listed above (see config.status Invocation); an optional shell script normally called config.cache (created when using configure --config-cache ) that saves the results of running many of the tests (see Cache Files); a file called config.log containing any messages produced by compilers, to help debugging if configure makes a mistake. The Autoconf approach to portability is to test for features, not for versions. A Full Example $ ls src/ $ ls src/ hello_world_openmp.c $ autoscan $ mv configure.scan configure.ac AC_INIT([hello_world_opemp], [1.0], [davis68@illinois.edu]) AC_CONFIG_SRCDIR([src/hello_world_openmp.c]) #AC_CONFIG_HEADERS([config.h]) $ vi Makefile.am AUTOMAKE_OPTIONS = foreign SUBDIRS = src $ vi src/makefile.am AM_CFLAGS = -Wall -fopenmp -std=c99 bin_programs=hello_world_openmp hello_world_openmp_sources=hello_world_openmp.c AC_INIT([hello_world_opemp], [1.0], [davis68@illinois.edu]) AC_CONFIG_SRCDIR([hello_world_openmp.c]) #AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE(hello_world_openmp, 1.0.0) $ aclocal $ AC_CONFIG_FILES([ Makefile src/makefile ])

5 AC_OUTPUT --add-missing $./configure $ make /htmlchapter/automake3.html Others CMake SCons wmake

Beyond Makefiles: Autotools and the GNU Build System

Beyond Makefiles: Autotools and the GNU Build System SEA : Autotools and the GNU Build System Patrick Nichols Software Engineer CISL Consulting Group UCAR SEA December 10, 2015 Why do we need more tools? Diversity! 1. Compilers, programming languages and

More information

Workshop Agenda Feb 25 th 2015

Workshop Agenda Feb 25 th 2015 Workshop Agenda Feb 25 th 2015 Time Presenter Title 09:30 T. König Talk bwhpc Concept & bwhpc-c5 - Federated User Support Activities 09:45 R. Walter Talk bwhpc architecture (bwunicluster, bwforcluster

More information

July 8, 2007 Jim Huang (jserv)

July 8, 2007 Jim Huang (jserv) Introduction to Autotools July 8, 2007 Jim Huang (jserv) Overview Autoconf, Automake, and libtool working together Address portability, configuration needs Support GNU Coding Standards

More information

Autotools Tutorial. Mengke HU. ASPITRG Group Meeting. ECE Department Drexel University

Autotools Tutorial. Mengke HU. ASPITRG Group Meeting. ECE Department Drexel University Autotools Tutorial Mengke HU ECE Department Drexel University ASPITRG Group Meeting Outline 1 Introduction 2 GNU Coding standards 3 Autoconf 4 Automake 5 Libtools 6 Demonstration The Basics of Autotools

More information

The Makefile utility. (Extract from the slides by Terrance E. Boult

The Makefile utility. (Extract from the slides by Terrance E. Boult The Makefile utility (Extract from the slides by Terrance E. Boult http://vast.uccs.edu/~tboult/) Motivation Small programs single file Not so small programs : Many lines of code Multiple components More

More information

CMPT 300. Operating Systems. Brief Intro to UNIX and C

CMPT 300. Operating Systems. Brief Intro to UNIX and C CMPT 300 Operating Systems Brief Intro to UNIX and C Outline Welcome Review Questions UNIX basics and Vi editor Using SSH to remote access Lab2(4214) Compiling a C Program Makefile Basic C/C++ programming

More information

CS 470 Spring Mike Lam, Professor. OpenMP

CS 470 Spring Mike Lam, Professor. OpenMP CS 470 Spring 2017 Mike Lam, Professor OpenMP OpenMP Programming language extension Compiler support required "Open Multi-Processing" (open standard; latest version is 4.5) Automatic thread-level parallelism

More information

CS 470 Spring Mike Lam, Professor. OpenMP

CS 470 Spring Mike Lam, Professor. OpenMP CS 470 Spring 2018 Mike Lam, Professor OpenMP OpenMP Programming language extension Compiler support required "Open Multi-Processing" (open standard; latest version is 4.5) Automatic thread-level parallelism

More information

Autotools and GNU Build system

Autotools and GNU Build system Autotools and GNU Build system YAKA 2008 EPITA 12/12/2006 YAKA 2008 (EPITA) Autotools and GNU Build system Page 1 / 13 Licence Copying is allowed Copyright c 2006 Benoit Sigoure Copyright c 2006 Alexandre

More information

Software Building (Sestavování aplikací)

Software Building (Sestavování aplikací) Software Building (Sestavování aplikací) http://d3s.mff.cuni.cz Pavel Parízek parizek@d3s.mff.cuni.cz CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics Outline Maven NuGet Gradle GNU build

More information

Makefiles SE 2XA3. Term I, 2018/19

Makefiles SE 2XA3. Term I, 2018/19 Makefiles SE 2XA3 Term I, 2018/19 Outline Example Calling make Syntax How it works Macros Suffix rules Command line options Example Assume we have files main.c, test.c, and lo.asm Consider the makefile

More information

COMP 2400 UNIX Tools

COMP 2400 UNIX Tools COMP 2400 UNIX Tools Christian Grothoff christian@grothoff.org http://grothoff.org/christian/ 1 Makefile Basics make reads instructions from a file Makefile. A Makefile is essentially a list of rules.

More information

EPL372 Lab Exercise 5: Introduction to OpenMP

EPL372 Lab Exercise 5: Introduction to OpenMP EPL372 Lab Exercise 5: Introduction to OpenMP References: https://computing.llnl.gov/tutorials/openmp/ http://openmp.org/wp/openmp-specifications/ http://openmp.org/mp-documents/openmp-4.0-c.pdf http://openmp.org/mp-documents/openmp4.0.0.examples.pdf

More information

CS354R: Game Technology

CS354R: Game Technology CS354R: Game Technology DevOps and Quality Assurance Fall 2018 What is DevOps? Development Operations Backend facilitation of development Handles local and remote hardware Maintains build infrastructure

More information

Tutorial: Compiling, Makefile, Parallel jobs

Tutorial: Compiling, Makefile, Parallel jobs Tutorial: Compiling, Makefile, Parallel jobs Hartmut Häfner Steinbuch Centre for Computing (SCC) Funding: www.bwhpc-c5.de Outline Compiler + Numerical Libraries commands Linking Makefile Intro, Syntax

More information

Introduction to Supercomputing

Introduction to Supercomputing Introduction to Supercomputing TMA4280 Introduction to UNIX environment and tools 0.1 Getting started with the environment and the bash shell interpreter Desktop computers are usually operated from a graphical

More information

Lecture 4: OpenMP Open Multi-Processing

Lecture 4: OpenMP Open Multi-Processing CS 4230: Parallel Programming Lecture 4: OpenMP Open Multi-Processing January 23, 2017 01/23/2017 CS4230 1 Outline OpenMP another approach for thread parallel programming Fork-Join execution model OpenMP

More information

Software Building (Sestavování aplikací)

Software Building (Sestavování aplikací) Software Building (Sestavování aplikací) http://d3s.mff.cuni.cz Pavel Parízek parizek@d3s.mff.cuni.cz CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics Make Nástroje pro vývoj software Software

More information

Study of tools used in build process

Study of tools used in build process Study of tools used in build process Sameera Deshpande November 16, 2005 Contents 1 Introduction 2 1.1 Introduction to configure and build process................. 2 1.2 Configure and Build Process.........................

More information

Why Use the Autotools?...xviii Acknowledgments... xx I Wish You the Very Best... xx

Why Use the Autotools?...xviii Acknowledgments... xx I Wish You the Very Best... xx CONTENTS IN DETAIL FOREWORD by Ralf Wildenhues xv PREFACE xvii Why Use the?...xviii Acknowledgments... xx I Wish You the Very Best... xx INTRODUCTION xxi Who Should Read This Book... xxii How This Book

More information

The make utility automatically determines which pieces of a large program need to be recompiled, and issues commands to recompile them.

The make utility automatically determines which pieces of a large program need to be recompiled, and issues commands to recompile them. What is make? 1 make is a system utility for managing the build process (compilation/linking/etc). There are various versions of make; these notes discuss the GNU make utility included on Linux systems.

More information

How To Create a GNU Autoconf / Automake Based Configure Script for Your Application Under Construction

How To Create a GNU Autoconf / Automake Based Configure Script for Your Application Under Construction How To Create a GNU Autoconf / Automake Based Configure Script for Your Application Under Construction by Prof.Dr. University of Applied Science Suedwestfalen, Germany 1 Table of Contents 1 Typography...

More information

HPC User Environment

HPC User Environment HPC User Environment Dirk Schmidl schmidl@rz.rwth-aachen.de Center for Computing and Communication RWTH Aachen University 22.03.2010 1 Program development tools on Linux IDEs eclipse sunstudio kdevelop

More information

OpenMP 2. CSCI 4850/5850 High-Performance Computing Spring 2018

OpenMP 2. CSCI 4850/5850 High-Performance Computing Spring 2018 OpenMP 2 CSCI 4850/5850 High-Performance Computing Spring 2018 Tae-Hyuk (Ted) Ahn Department of Computer Science Program of Bioinformatics and Computational Biology Saint Louis University Learning Objectives

More information

COSC345 Software Engineering. Make

COSC345 Software Engineering. Make COSC345 Software Engineering Make The build process Make When to use make How to use make Suffix rules makedepend Outline Warning: Make is different everywhere you go! Build Process The build process can

More information

Autoconf Tutorial. Mark Galassi

Autoconf Tutorial. Mark Galassi Autoconf Tutorial Mark Galassi Copyright c 1996 Mark Galassi Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved

More information

OpenMP. António Abreu. Instituto Politécnico de Setúbal. 1 de Março de 2013

OpenMP. António Abreu. Instituto Politécnico de Setúbal. 1 de Março de 2013 OpenMP António Abreu Instituto Politécnico de Setúbal 1 de Março de 2013 António Abreu (Instituto Politécnico de Setúbal) OpenMP 1 de Março de 2013 1 / 37 openmp what? It s an Application Program Interface

More information

The GNU configure and build system

The GNU configure and build system !"$#% &(') *+ The GNU configure and build system Ian Lance Taylor Copyright c 1998 Cygnus Solutions Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice

More information

GNU make... Martin Ohlerich, Parallel Programming of High Performance Systems

GNU make... Martin Ohlerich, Parallel Programming of High Performance Systems ... Martin Ohlerich, Martin.Ohlerich@lrz.de Parallel Programming of High Performance Systems Outline 1 2 3 Leibniz Rechenzentrum 2 / 42 Outline 1 2 3 Leibniz Rechenzentrum 3 / 42 Common Situation Larger

More information

CS420: Operating Systems

CS420: Operating Systems Threads James Moscola Department of Physical Sciences York College of Pennsylvania Based on Operating System Concepts, 9th Edition by Silberschatz, Galvin, Gagne Threads A thread is a basic unit of processing

More information

[Software Development] Makefiles. Davide Balzarotti. Eurecom Sophia Antipolis, France

[Software Development] Makefiles. Davide Balzarotti. Eurecom Sophia Antipolis, France [Software Development] Makefiles Davide Balzarotti Eurecom Sophia Antipolis, France 1 Software Development Tools 1. Configuring and Building the program GCC Makefiles Autotools 2. Writing and managing

More information

Parallel and Distributed Programming. OpenMP

Parallel and Distributed Programming. OpenMP Parallel and Distributed Programming OpenMP OpenMP Portability of software SPMD model Detailed versions (bindings) for different programming languages Components: directives for compiler library functions

More information

Parallel Processing/Programming

Parallel Processing/Programming Parallel Processing/Programming with the applications to image processing Lectures: 1. Parallel Processing & Programming from high performance mono cores to multi- and many-cores 2. Programming Interfaces

More information

Shared memory parallel computing

Shared memory parallel computing Shared memory parallel computing OpenMP Sean Stijven Przemyslaw Klosiewicz Shared-mem. programming API for SMP machines Introduced in 1997 by the OpenMP Architecture Review Board! More high-level than

More information

Special Course on Computer Architecture

Special Course on Computer Architecture Special Course on Computer Architecture #9 Simulation of Multi-Processors Hiroki Matsutani and Hideharu Amano Outline: Simulation of Multi-Processors Background [10min] Recent multi-core and many-core

More information

CAAM 420 Daily Note. Scriber: Qijia Jiang. Date: Oct.16. Project 3 Due Wed 23.Oct. Two parts: debug code and library exercise.

CAAM 420 Daily Note. Scriber: Qijia Jiang. Date: Oct.16. Project 3 Due Wed 23.Oct. Two parts: debug code and library exercise. CAAM 420 Daily Note Scriber: Qijia Jiang Date: Oct.16 1 Announcement Project 3 Due Wed 23.Oct. Two parts: debug code and library exercise. 2 Make Convention Make syntax for library directories and library

More information

OpenMPand the PGAS Model. CMSC714 Sept 15, 2015 Guest Lecturer: Ray Chen

OpenMPand the PGAS Model. CMSC714 Sept 15, 2015 Guest Lecturer: Ray Chen OpenMPand the PGAS Model CMSC714 Sept 15, 2015 Guest Lecturer: Ray Chen LastTime: Message Passing Natural model for distributed-memory systems Remote ( far ) memory must be retrieved before use Programmer

More information

Maemo Diablo GNU Make and makefiles Training Material

Maemo Diablo GNU Make and makefiles Training Material Maemo Diablo GNU Make and makefiles Training Material February 9, 2009 Contents 1 GNU Make and makefiles 2 1.1 What is GNU Make?......................... 2 1.2 How does make work?........................

More information

Multiple file project management & Makefile

Multiple file project management & Makefile Multiple file project management & Makefile Compilation & linkage read.c read.h main.c Compilation: gcc -c read.c main.c list.c list.h list.c read.o main.o list.o Linkage: gcc... read.o main.o list.o -o

More information

OpenMP Fundamentals Fork-join model and data environment

OpenMP Fundamentals Fork-join model and data environment www.bsc.es OpenMP Fundamentals Fork-join model and data environment Xavier Teruel and Xavier Martorell Agenda: OpenMP Fundamentals OpenMP brief introduction The fork-join model Data environment OpenMP

More information

These steps may include:

These steps may include: Build Tools 1 Build Tools Building a program for a large project is usually managed by a build tool that controls the various steps involved. These steps may include: 1. Compiling source code to binaries

More information

OpenMP 4. CSCI 4850/5850 High-Performance Computing Spring 2018

OpenMP 4. CSCI 4850/5850 High-Performance Computing Spring 2018 OpenMP 4 CSCI 4850/5850 High-Performance Computing Spring 2018 Tae-Hyuk (Ted) Ahn Department of Computer Science Program of Bioinformatics and Computational Biology Saint Louis University Learning Objectives

More information

Using GNU make C HAPTER 4

Using GNU make C HAPTER 4 CH04.fm Page 101 Monday, October 7, 2002 8:54 PM C HAPTER 4 Using GNU make A ll serious software projects are built in pieces by many developers. These pieces consist of source code and header files, libraries

More information

Projects and Make Files

Projects and Make Files Projects and Make Files Creating an executable file requires compiling the source code into an object* file (file.o) and then linking that file with (other files and) libraries to create the executable

More information

How to learn C? CSCI [4 6]730: A C Refresher or Introduction. Diving In: A Simple C Program 1-hello-word.c

How to learn C? CSCI [4 6]730: A C Refresher or Introduction. Diving In: A Simple C Program 1-hello-word.c How to learn C? CSCI [4 6]730: A C Refresher or Introduction Hello Word! ~/ctutorial/ In addition to syntax you need to learn: the Tools. the Libraries. And the Documentation (how to access) Practice on

More information

Makefile Tutorial. Eric S. Missimer. December 6, 2013

Makefile Tutorial. Eric S. Missimer. December 6, 2013 Makefile Tutorial Eric S. Missimer December 6, 2013 1 Basic Elements of a Makefile 1.1 Explicit Rules A the major part of a Makefile are the explicit rules (a.k.a. recipes) that make certain files. Below

More information

ESTABLISHED Paul Kunz SLAC. Overview. Examples. Expose the downsides. Benefits. Risks and Costs. Building with Automake 1 Paul F.

ESTABLISHED Paul Kunz SLAC. Overview. Examples. Expose the downsides. Benefits. Risks and Costs. Building with Automake 1 Paul F. Building with Automake Paul Kunz SLAC Overview Examples Expose the downsides Benefits Risks and Costs Building with Automake 1 Paul F. Kunz Overview Primary targets build in developer s working directory

More information

GNU make. Michal Koutný. Software development and monitoring tools (NSWI126)

GNU make. Michal Koutný. Software development and monitoring tools (NSWI126) GNU make Michal Koutný Software development and monitoring tools (NSWI126) Make basics Dependency tree (target and prerequisites) Check prerequisites, build target with recipe Configured via Makefile (a

More information

2 Compiling a C program

2 Compiling a C program 2 Compiling a C program This chapter describes how to compile C programs using gcc. Programs can be compiled from a single source file or from multiple source files, and may use system libraries and header

More information

Introduction to OpenMP

Introduction to OpenMP Introduction to OpenMP Ricardo Fonseca https://sites.google.com/view/rafonseca2017/ Outline Shared Memory Programming OpenMP Fork-Join Model Compiler Directives / Run time library routines Compiling and

More information

Our new HPC-Cluster An overview

Our new HPC-Cluster An overview Our new HPC-Cluster An overview Christian Hagen Universität Regensburg Regensburg, 15.05.2009 Outline 1 Layout 2 Hardware 3 Software 4 Getting an account 5 Compiling 6 Queueing system 7 Parallelization

More information

Maemo Diablo Reference Manual for maemo 4.1. GNU Build System

Maemo Diablo Reference Manual for maemo 4.1. GNU Build System Maemo Diablo Reference Manual for maemo 4.1 GNU Build System December 22, 2008 Contents 1 GNU Build System 2 1.1 Introduction.............................. 2 1.2 GNU Make and Makefiles......................

More information

Parallel Numerical Algorithms

Parallel Numerical Algorithms Parallel Numerical Algorithms http://sudalab.is.s.u-tokyo.ac.jp/~reiji/pna16/ [ 8 ] OpenMP Parallel Numerical Algorithms / IST / UTokyo 1 PNA16 Lecture Plan General Topics 1. Architecture and Performance

More information

Review of Scientific Programming in C and Fortran. Michael McLennan Software Architect HUBzero Platform for Scientific Collaboration

Review of Scientific Programming in C and Fortran. Michael McLennan Software Architect HUBzero Platform for Scientific Collaboration Review of Scientific Programming in C and Fortran Michael McLennan Software Architect HUBzero Platform for Scientific Collaboration Monte Carlo Simulator Simulate by randomly generating thousands of tracks?

More information

GLOSSARY. OpenMP. OpenMP brings the power of multiprocessing to your C, C++, and. Fortran programs. BY WOLFGANG DAUTERMANN

GLOSSARY. OpenMP. OpenMP brings the power of multiprocessing to your C, C++, and. Fortran programs. BY WOLFGANG DAUTERMANN OpenMP OpenMP brings the power of multiprocessing to your C, C++, and Fortran programs. BY WOLFGANG DAUTERMANN f you bought a new computer recently, or if you are wading through advertising material because

More information

Continue: How do I learn C? C Primer Continued (Makefiles, debugging, and more ) Last Time: A Simple(st) C Program 1-hello-world.c!

Continue: How do I learn C? C Primer Continued (Makefiles, debugging, and more ) Last Time: A Simple(st) C Program 1-hello-world.c! Continue: How do I learn C? C Primer Continued (Makefiles, debugging, and more ) Hello Word! ~/ctest/ In addition to syntax you need to learn: the Tools the Libraries. And the Documentation. Maria Hybinette,

More information

ITCS 4/5145 Parallel Computing Test 1 5:00 pm - 6:15 pm, Wednesday February 17, 2016 Solutions Name:...

ITCS 4/5145 Parallel Computing Test 1 5:00 pm - 6:15 pm, Wednesday February 17, 2016 Solutions Name:... ITCS 4/5145 Parallel Computing Test 1 5:00 pm - 6:15 pm, Wednesday February 17, 016 Solutions Name:... Answer questions in space provided below questions. Use additional paper if necessary but make sure

More information

For those with laptops

For those with laptops For those with laptops Log into SciNet GPC devel node (ssh -X or ssh -Y) cd cp -r /scinet/course/ppp. cd ppp source setup cd omp-intro make./mandel An introduction to OpenMP OpenMP For Shared Memory systems

More information

DPHPC: Introduction to OpenMP Recitation session

DPHPC: Introduction to OpenMP Recitation session SALVATORE DI GIROLAMO DPHPC: Introduction to OpenMP Recitation session Based on http://openmp.org/mp-documents/intro_to_openmp_mattson.pdf OpenMP An Introduction What is it? A set of compiler directives

More information

Reviewing gcc, make, gdb, and Linux Editors 1

Reviewing gcc, make, gdb, and Linux Editors 1 Reviewing gcc, make, gdb, and Linux Editors 1 Colin Gordon csgordon@cs.washington.edu University of Washington CSE333 Section 1, 3/31/11 1 Lots of material borrowed from 351/303 slides Colin Gordon (University

More information

Parallel Programming

Parallel Programming Parallel Programming Lecture delivered by: Venkatanatha Sarma Y Assistant Professor MSRSAS-Bangalore 1 Session Objectives To understand the parallelization in terms of computational solutions. To understand

More information

FOLLOW ALONG WITH THE EXAMPLES

FOLLOW ALONG WITH THE EXAMPLES FOLLOW ALONG WITH THE EXAMPLES $ git clone https://gitlab.com/jtfrey/unix-software-dev.git ( or "git pull" if you cloned at last session ) $ git checkout tags/session2 $ ls -l total 8 -rw-r--r-- 1 frey

More information

CS691/SC791: Parallel & Distributed Computing

CS691/SC791: Parallel & Distributed Computing CS691/SC791: Parallel & Distributed Computing Introduction to OpenMP 1 Contents Introduction OpenMP Programming Model and Examples OpenMP programming examples Task parallelism. Explicit thread synchronization.

More information

The makeutility automatically determines which pieces of a large program need to be recompiled, and issues commands to recompile them.

The makeutility automatically determines which pieces of a large program need to be recompiled, and issues commands to recompile them. What is make? 1 make is a system utility for managing the build process (compilation/linking/etc). There are various versions of make; these notes discuss the GNU makeutility included on Linux systems.

More information

GNU Automake. For version , 1 February David MacKenzie Tom Tromey Alexandre Duret-Lutz

GNU Automake. For version , 1 February David MacKenzie Tom Tromey Alexandre Duret-Lutz GNU Automake For version 1.11.3, 1 February 2012 David MacKenzie Tom Tromey Alexandre Duret-Lutz This manual is for GNU Automake (version 1.11.3, 1 February 2012), a program that creates GNU standards-compliant

More information

GNU Make 1. 1 material adapted from GNU Make by Richard Stallman

GNU Make 1. 1 material adapted from GNU Make by Richard Stallman 1 The make utility automatically determines which pieces of a large program need to be recompiled, and issues commands to recompile them. Make can be used with any programming language whose compiler can

More information

cp r /global/scratch/workshop/openmp-wg-oct2017 cd openmp-wg-oct2017 && ls Current directory

cp r /global/scratch/workshop/openmp-wg-oct2017 cd openmp-wg-oct2017 && ls Current directory $ ssh username@grex.westgrid.ca username@tatanka ~ username@bison ~ cp r /global/scratch/workshop/openmp-wg-oct2017 cd openmp-wg-oct2017 && ls Current directory sh get_node_workshop.sh [ username@n139

More information

CS 61C: Great Ideas in Computer Architecture. OpenMP, Transistors

CS 61C: Great Ideas in Computer Architecture. OpenMP, Transistors CS 61C: Great Ideas in Computer Architecture OpenMP, Transistors Instructor: Justin Hsia 7/17/2012 Summer 2012 Lecture #17 1 Review of Last Lecture Amdahl s Law limits benefits of parallelization Multiprocessor

More information

Introduction to Supercomputing

Introduction to Supercomputing Introduction to Supercomputing TMA4280 Introduction to development tools 0.1 Development tools During this course, only the make tool, compilers, and the GIT tool will be used for the sake of simplicity:

More information

High Performance Computing: Tools and Applications

High Performance Computing: Tools and Applications High Performance Computing: Tools and Applications Edmond Chow School of Computational Science and Engineering Georgia Institute of Technology Lecture 2 OpenMP Shared address space programming High-level

More information

Shared memory programming model OpenMP TMA4280 Introduction to Supercomputing

Shared memory programming model OpenMP TMA4280 Introduction to Supercomputing Shared memory programming model OpenMP TMA4280 Introduction to Supercomputing NTNU, IMF February 16. 2018 1 Recap: Distributed memory programming model Parallelism with MPI. An MPI execution is started

More information

Lecture 2: Introduction to OpenMP with application to a simple PDE solver

Lecture 2: Introduction to OpenMP with application to a simple PDE solver Lecture 2: Introduction to OpenMP with application to a simple PDE solver Mike Giles Mathematical Institute Mike Giles Lecture 2: Introduction to OpenMP 1 / 24 Hardware and software Hardware: a processor

More information

COMP4510 Introduction to Parallel Computation. Shared Memory and OpenMP. Outline (cont d) Shared Memory and OpenMP

COMP4510 Introduction to Parallel Computation. Shared Memory and OpenMP. Outline (cont d) Shared Memory and OpenMP COMP4510 Introduction to Parallel Computation Shared Memory and OpenMP Thanks to Jon Aronsson (UofM HPC consultant) for some of the material in these notes. Outline (cont d) Shared Memory and OpenMP Including

More information

Shared Memory programming paradigm: openmp

Shared Memory programming paradigm: openmp IPM School of Physics Workshop on High Performance Computing - HPC08 Shared Memory programming paradigm: openmp Luca Heltai Stefano Cozzini SISSA - Democritos/INFM

More information

Build automation. CSE260, Computer Science B: Honors Stony Brook University

Build automation. CSE260, Computer Science B: Honors Stony Brook University Build automation CSE260, Computer Science B: Honors Stony Brook University http://www.cs.stonybrook.edu/~cse260 2 Build Automation Build automation is the act of scripting or automating a wide variety

More information

The WAF build system

The WAF build system Sebastian Jeltsch Electronic Vision(s) Kirchhoff Institute for Physics Ruprecht-Karls-Universität Heidelberg 31. August 2010 Sebastian Jeltsch 31. August 2010 1 / 19 Introduction WorkBuildflow Sebastian

More information

C Compilation Model. Comp-206 : Introduction to Software Systems Lecture 9. Alexandre Denault Computer Science McGill University Fall 2006

C Compilation Model. Comp-206 : Introduction to Software Systems Lecture 9. Alexandre Denault Computer Science McGill University Fall 2006 C Compilation Model Comp-206 : Introduction to Software Systems Lecture 9 Alexandre Denault Computer Science McGill University Fall 2006 Midterm Date: Thursday, October 19th, 2006 Time: from 16h00 to 17h30

More information

Exercise 1: Basic Tools

Exercise 1: Basic Tools Exercise 1: Basic Tools This exercise is created so everybody can learn the basic tools we will use during this course. It is really more like a tutorial than an exercise and, you are not required to submit

More information

Hands-on Clone instructions: bit.ly/ompt-handson. How to get most of OMPT (OpenMP Tools Interface)

Hands-on Clone instructions: bit.ly/ompt-handson. How to get most of OMPT (OpenMP Tools Interface) How to get most of OMPT (OpenMP Tools Interface) Hands-on Clone instructions: bit.ly/ompt-handson (protze@itc.rwth-aachen.de), Tim Cramer, Jonas Hahnfeld, Simon Convent, Matthias S. Müller What is OMPT?

More information

Embedded Systems Programming

Embedded Systems Programming Embedded Systems Programming OS Linux - Toolchain Iwona Kochańska Gdansk University of Technology Embedded software Toolchain compiler and tools for hardwaredependent software developement Bootloader initializes

More information

Advanced C Programming Winter Term 2008/09. Guest Lecture by Markus Thiele

Advanced C Programming Winter Term 2008/09. Guest Lecture by Markus Thiele Advanced C Programming Winter Term 2008/09 Guest Lecture by Markus Thiele Lecture 14: Parallel Programming with OpenMP Motivation: Why parallelize? The free lunch is over. Herb

More information

Hello, World! in C. Johann Myrkraverk Oskarsson October 23, The Quintessential Example Program 1. I Printing Text 2. II The Main Function 3

Hello, World! in C. Johann Myrkraverk Oskarsson October 23, The Quintessential Example Program 1. I Printing Text 2. II The Main Function 3 Hello, World! in C Johann Myrkraverk Oskarsson October 23, 2018 Contents 1 The Quintessential Example Program 1 I Printing Text 2 II The Main Function 3 III The Header Files 4 IV Compiling and Running

More information

A brief introduction to OpenMP

A brief introduction to OpenMP A brief introduction to OpenMP Alejandro Duran Barcelona Supercomputing Center Outline 1 Introduction 2 Writing OpenMP programs 3 Data-sharing attributes 4 Synchronization 5 Worksharings 6 Task parallelism

More information

Instructions for setting up to compile and run OSGPS code under Linux

Instructions for setting up to compile and run OSGPS code under Linux Instructions for setting up to compile and run OSGPS code under Linux A. The latest and greatest OSGPS software is available on SorceForge. If you are not already monitoring this, you need to be. To set

More information

OpenMP threading: parallel regions. Paolo Burgio

OpenMP threading: parallel regions. Paolo Burgio OpenMP threading: parallel regions Paolo Burgio paolo.burgio@unimore.it Outline Expressing parallelism Understanding parallel threads Memory Data management Data clauses Synchronization Barriers, locks,

More information

The following program computes a Calculus value, the "trapezoidal approximation of

The following program computes a Calculus value, the trapezoidal approximation of Multicore machines and shared memory Multicore CPUs have more than one core processor that can execute instructions at the same time. The cores share main memory. In the next few activities, we will learn

More information

Deep C. Multifile projects Getting it running Data types Typecasting Memory management Pointers. CS-343 Operating Systems

Deep C. Multifile projects Getting it running Data types Typecasting Memory management Pointers. CS-343 Operating Systems Deep C Multifile projects Getting it running Data types Typecasting Memory management Pointers Fabián E. Bustamante, Fall 2004 Multifile Projects Give your project a structure Modularized design Reuse

More information

GNU Autotools Tutorial

GNU Autotools Tutorial GNU Autotools Tutorial Copyright c 2010 Nils Turner Chapter 1: Introduction 1 1 Introduction Those of us that have installed software from source code at some time in our career have no doubt become familiar

More information

Cluster Clonetroop: HowTo 2014

Cluster Clonetroop: HowTo 2014 2014/02/25 16:53 1/13 Cluster Clonetroop: HowTo 2014 Cluster Clonetroop: HowTo 2014 This section contains information about how to access, compile and execute jobs on Clonetroop, Laboratori de Càlcul Numeric's

More information

CS 261 Recitation 1 Compiling C on UNIX

CS 261 Recitation 1 Compiling C on UNIX Oregon State University School of Electrical Engineering and Computer Science CS 261 Recitation 1 Compiling C on UNIX Winter 2017 Outline Secure Shell Basic UNIX commands Editing text The GNU Compiler

More information

CSCI-243 Exam 2 Review February 22, 2015 Presented by the RIT Computer Science Community

CSCI-243 Exam 2 Review February 22, 2015 Presented by the RIT Computer Science Community CSCI-43 Exam Review February, 01 Presented by the RIT Computer Science Community http://csc.cs.rit.edu C Preprocessor 1. Consider the following program: 1 # include 3 # ifdef WINDOWS 4 # include

More information

Lab #1 Installing a System Due Friday, September 6, 2002

Lab #1 Installing a System Due Friday, September 6, 2002 Lab #1 Installing a System Due Friday, September 6, 2002 Name: Lab Time: Grade: /10 The Steps of Installing a System Today you will install a software package. Implementing a software system is only part

More information

Tool for Analysing and Checking MPI Applications

Tool for Analysing and Checking MPI Applications Tool for Analysing and Checking MPI Applications April 30, 2010 1 CONTENTS CONTENTS Contents 1 Introduction 3 1.1 What is Marmot?........................... 3 1.2 Design of Marmot..........................

More information

15213 Recitation Section C

15213 Recitation Section C 15213 Recitation Section C Outline Sept. 9, 2002 Introduction Unix and C Playing with Bits Practice Problems Introducing Myself Try to pronounce my name: My office hour: Wed 2-3pm, WeH 8019 Contact: Email:

More information

OpenMP Overview. in 30 Minutes. Christian Terboven / Aachen, Germany Stand: Version 2.

OpenMP Overview. in 30 Minutes. Christian Terboven / Aachen, Germany Stand: Version 2. OpenMP Overview in 30 Minutes Christian Terboven 06.12.2010 / Aachen, Germany Stand: 03.12.2010 Version 2.3 Rechen- und Kommunikationszentrum (RZ) Agenda OpenMP: Parallel Regions,

More information

Linux system programming - About this course

Linux system programming - About this course Getting Started Linux system programming - About this course Objectives and contents 1. Programming in Linux environment by using C (assume that you already have some C experience). 2. Linux(Unix) system

More information

OpenACC. Part I. Ned Nedialkov. McMaster University Canada. October 2016

OpenACC. Part I. Ned Nedialkov. McMaster University Canada. October 2016 OpenACC. Part I Ned Nedialkov McMaster University Canada October 2016 Outline Introduction Execution model Memory model Compiling pgaccelinfo Example Speedups Profiling c 2016 Ned Nedialkov 2/23 Why accelerators

More information

Tcl Extension Architecture Developer s Guide DRAFT

Tcl Extension Architecture Developer s Guide DRAFT Tcl Extension Architecture Developer s Guide DRAFT Scriptics Corporation August 25, 1999 COPYRIGHT Copyright 1999 Scriptics Corporation. All rights reserved. Information in this document is subject to

More information

Oregon State University School of Electrical Engineering and Computer Science. CS 261 Recitation 1. Spring 2011

Oregon State University School of Electrical Engineering and Computer Science. CS 261 Recitation 1. Spring 2011 Oregon State University School of Electrical Engineering and Computer Science CS 261 Recitation 1 Spring 2011 Outline Using Secure Shell Clients GCC Some Examples Intro to C * * Windows File transfer client:

More information

OpenMP, Part 2. EAS 520 High Performance Scientific Computing. University of Massachusetts Dartmouth. Spring 2015

OpenMP, Part 2. EAS 520 High Performance Scientific Computing. University of Massachusetts Dartmouth. Spring 2015 OpenMP, Part 2 EAS 520 High Performance Scientific Computing University of Massachusetts Dartmouth Spring 2015 References This presentation is almost an exact copy of Dartmouth College's openmp tutorial.

More information