HPC User Environment

Similar documents
Makefiles SE 2XA3. Term I, 2018/19

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

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

CS Basics 15) Compiling a C prog.

Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 2

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

GDB and Makefile. Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

CS11 Advanced C++ Fall Lecture 4

Introduction to System Programming : makefile

Kurt Schmidt. May 23, 2018

2 Compiling a C program

Tutorial: Compiling, Makefile, Parallel jobs

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

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

The make utility. Alark Joshi COMPSCI 253

AN 834: Developing for the Intel HLS Compiler with an IDE

Software Building (Sestavování aplikací)

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

Using Eclipse for C, MPI, and Suzaku

We d like to hear your suggestions for improving our indexes. Send to

Reviewing gcc, make, gdb, and Linux Editors 1

Workshop Agenda Feb 25 th 2015

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

Intermediate Programming, Spring 2017*

CS240: Programming in C. Lecture 2: Overview

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

Basic Compilation Control with Make

Make! CSC230: C and Software Tools. N.C. State Department of Computer Science. Some examples adapted from

Make: a build automation tool

CS480. Compilers Eclipse, SVN, Makefile examples

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

Make. Dependency Graphs

Systems Programming. laboratory. Compilation automation. make ceedling

Using GNU make C HAPTER 4

GNU Make. A Program for Directing Recompilation GNU make Version 3.79 April Richard M. Stallman and Roland McGrath

The Make Utility. Independent compilation. Large programs are difficult to maintain. Problem solved by breaking the program into separate files

CS240: Programming in C

Multiple file project management & Makefile

COSC345 Software Engineering. Make

The Make Utility. Independent compilation. Large programs are difficult to maintain. Problem solved by breaking the program into separate files

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

Software Development With Emacs: The Edit-Compile-Debug Cycle

CMake support in FreeFem++

CSE 351. Introduction & Course Tools

Working with IITJ HPC Environment

Make: a build automation tool 1/23

The C Preprocessor Compiling and Linking Using MAKE

Makefile Brief Reference

The CS-220 Development Environment

Laboratory Assignment #3 Eclipse CDT

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

Program Development Tools

CS11 Intro C++ Spring 2018 Lecture 4

Exercise 1: Basic Tools

PRINCIPLES OF OPERATING SYSTEMS

CS Lab 1 Linux/Shell Basic commands Introduction. Teaching Assistant Henrique Potter

Chapter 2: An Introduction to Makeles 5 2 An Introduction to Makeles You need a le called a makele to tell make what to do. Most often, the makele tel

C / C++ Coding Rules


@shorttitlepage GNU Make Copyright (C) 1988, '89, '90, '91, '92, '93 Free Software Foundation, Inc.

Itron Riva Kernel Module Building

Eclipse CDT Tutorial. Eclipse CDT Homepage: Tutorial written by: James D Aniello

Projects and Make Files

Section 1: Tools. Kaifei Chen, Luca Zuccarini. January 23, Make Motivation How... 2

HPC Tools on Windows. Christian Terboven Center for Computing and Communication RWTH Aachen University.

Overview of today s lecture. Quick recap of previous C lectures. Introduction to C programming, lecture 2. Abstract data type - Stack example

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division. P. N. Hilfinger

Working with Shell Scripting. Daniel Balagué

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

The Linux Programming Environment. Computer Science Department Texas State University

HPC on Windows. Visual Studio 2010 and ISV Software

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

{C} Tools of the Trade

Reliable C++ development - session 1: From C to C++ (and some C++ features)

Compilation & linkage. Compilation & linkage. Make. Compilation & linkage. Explicit rules. What makefile contains

CS 261 Recitation 1 Compiling C on UNIX

Parallel Programming

CSC 2500: Unix Lab Fall 2016

Debugging with TotalView

Maemo Diablo GNU Make and makefiles Training Material

CMake, an overview. D. Arrivault 1. 24th November, 2014 / Talep presentation. Aix Marseille Université. CMake, an overview.

CSE 333 Interlude - make and build tools

Here s another makefile snippet that works some of the time:

Terminal Windows, Emacs, Subversion and Make

Software project Gnome Graphics

CS2141 Software Development using C/C++ Compiling a C++ Program

GNU Make. A Program for Directing Recompilation GNU make Version 3.82 July Richard M. Stallman, Roland McGrath, Paul D.

Programming in C week 1 meeting Tiina Niklander

Chris' Makefile Tutorial

Faculty of Science Final Examination. Computer Science B Introduction to Software Systems

CSCi 4061: Intro to Operating Systems Spring 2017 Instructor: Jon Weissman Assignment 1: Simple Make Due: Feb. 15, 11:55 pm

Introduction to HPC Programming 4. C and FORTRAN compilers; make, configure, cmake. Valentin Pavlov

Debugging Serial and Parallel Programs with Visual Studio

CSE 303, Winter 2007, Final Examination 15 March Please do not turn the page until everyone is ready.

PetaLinux SDK User Guide. Application Development Guide

Programming in C First meeting

Performance Tools for Technical Computing

GNU Make. A Program for Directing Recompilation. Edition 0.51, for make Version 3.75 Beta. May Richard M. Stallman and Roland McGrath

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines

CptS 360 (System Programming) Unit 3: Development Tools

Transcription:

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 (highlighting) Text editors kate gedit nedit gvim make Debuggers TotalView idb 2

smart utility to manage compilation of programs and much more automatically detects which parts need to be rebuild general rules for compilation of many files dependencies between files can be handled Usage: make <target> or gmake <target> looks for default makefiles: GNUmakefile makefile Makefile 3

Rules: target... : prerequisites... < tab > command < tab >... target: output file (or only a name) prerequisites: input files (e.g. source code files) command: action to be performed Example: jacobi.exe: jacobi.c main.c < tab > gcc jacobi.c main.c -o jacobi.exe 4

Setting Variables: 1. environment Variables 2. setting variables in the Makefile CC = gcc CFLAGS = -m64 -O3 3. as argument to make $ make jacobi.exe CC=icc Using Variables: <tab> $(CC) $(CFLAGS) helloworld.c -o helloworld.exe 5

Recursive Expanded: a = $(b) world! b = Hello print: <tab> echo $(a) echo Hello world! Hello world! expand: SRC = jacobi.c SRC += main.c Simply Expanded: a := $(b) world! b := Hello print: <tab> echo $(a) echo world! world! # same as SRC = jacobi.c main.c if unset: CC?= gcc 6

implicit Variables: $@ file name of target $< name of the first prerequisite $^ list of all prerequisites Example: CFLAGS = -g $(FLAGS_FAST) SRC = jacobi.c SRC += main.c jacobi.exe: $(SRC) < tab > $(CC) $(CFLAGS) $^ -lm -o $@ 7

Implicit rules: %.o : %.c < tab > $(CC) -c $(CFLAGS) $< -o $@ Example: CFLAGS = -g $(FLAGS_FAST) OBJS = jacobi.o main.o jacobi.exe: $(OBJS) < tab > $(CC) $(CFLAGS) $^ -lm -o $@ %.o: %.c < tab > $(CC) -c $(CFLAGS) $< -o $@ 8

Phony Targets: name for an commando without associated file.phony: clean build build: jacobi.exe clean: < tab > rm jacobi.exe < tab > rm jacobi.o main.o 9

Errors stop further execution per default. Ignore returned errors with - clean: < tab > -rm jacobi.exe < tab > -rm jacobi.o main.o Suppress printing the command with @ print: <tab> echo Hello World! $ make print echo Hello World! Hello World! print: <tab> @echo Hello World! $ make print Hello World! 10

The first target in the makefile is the default target. Example: CFLAGS = -g $(FLAGS_FAST) OBJS = jacobi.o main.o help: < tab > @echo Use make build to build jacobi.exe. < tab > @echo Use make clean to delete jacobi.exe and all object files. build: jacobi.exe jacobi.exe: $(OBJS) < tab > $(CC) $(CFLAGS) $^ -lm -o $@ %.o: %.c < tab > $(CC) -c $(CFLAGS) $< -o $@ 11

$ make Use make build to build jacobi.exe. Use make clean to delete jacobi.exe and all object files. 12

Include other files: include <filenames> e.g.: Used to handle sets of variables specified in other files. Different files for different compilers or platforms. 13

Conditions: ifeq (var1,var2) text-if-true else text-if-false endif Example: ifeq ($(CC),gcc) OPENMP = -fopenmp else OPENMP = -openmp endif Use $FLAGS_OPENMP on our cluster, set from the module system. 14

Useful command line options: make target1 target2 : build target1 and target2 make -n : prints commands which would be executed, but does not execute them make -j <njobs> : start <njobs> builds in parallel if possible make -C <dir> : change to <dir> before reading the makefile make -f <file> : use <file> as makefile 15

HPC Program development tips What are the goals and characteristics of a particular HPC project? Typical HPC project features: (very) long-life time portability and maintainability and efficiency (on available hardware) needed 16

HPC Program development tips At the very beginning think about: Will the code be parallelized and to which extent? What are and will be the target platforms? Choose well-established parallelization paradigm (MPI/OpenMP). Choose adequate and well-established language (C/C++/F). Use Tools from the very beginning on Debugger/ Correctness Checker/ Performance Tools. If you need advice: servicedesk@rz.rwth-aachen.de 17

Virtual Machine Virtual Machine is copied on the Laptops provides a cluster like environment Differences: modules not useful installed Oracle Compiler is default Oracle MPI is default Feature: shared folder between VM and Windows /mnt/hgfs/sharedfolder is C:\SharedFolder 18

Virtual Machine start VMware Workstation click power on this Virtual Machine user: hpclab pw: will be on the board 19

The end Thank you for your attention! Questions? 20