CptS 360 (System Programming) Unit 3: Development Tools

Similar documents
CptS 360 (System Programming) Unit 1: Introduction to System Programming

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

Exercise 1: Basic Tools

CS11 Intro C++ Spring 2018 Lecture 4

Revision Control. An Introduction Using Git 1/15

CptS 360 (System Programming) Unit 2: Introduction to UNIX and Linux

Version Control with Git

TNM093 Practical Data Visualization and Virtual Reality Laboratory Platform

CS11 Advanced C++ Fall Lecture 4

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

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

Linux Essentials. Smith, Roderick W. Table of Contents ISBN-13: Introduction xvii. Chapter 1 Selecting an Operating System 1

Department of Computer Science College of Engineering Boise State University

Introduction to Unix The Windows User perspective. Wes Frisby Kyle Horne Todd Johansen

COSC345 Software Engineering. Make

Introduction to Linux

Reviewing gcc, make, gdb, and Linux Editors 1

EECS Software Tools. Lab 2 Tutorial: Introduction to UNIX/Linux. Tilemachos Pechlivanoglou

Introduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University

EE516: Embedded Software Project 1. Setting Up Environment for Projects

Intro to Linux & Command Line

Introduction to Linux


CS631 - Advanced Programming in the UNIX Environment. UNIX development tools

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

CS 261 Recitation 1 Compiling C on UNIX

Other useful tools. Eugeniy E. Mikhailov. Lecture 11. The College of William & Mary. Eugeniy Mikhailov (W&M) Practical Computing Lecture 11 1 / 9

Chapter 3. Revision Control

Makefile Brief Reference

Compilation I. Hwansoo Han

Make. Dependency Graphs

Linux-Kurs Themen -Help under Linux - 12 February 2004

Brief Linux Presentation. July 10th, 2006 Elan Borenstein

CSE 391 Lecture 1. introduction to Linux/Unix environment

Linux Fundamentals (L-120)

Introduction to Supercomputing

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

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

1Z Oracle Linux Fundamentals (Oracle Partner Network) Exam Summary Syllabus Questions

CSE 391 Lecture 1. introduction to Linux/Unix environment

Home Page. Title Page. Contents. Page 1 of 17. Version Control. Go Back. Ken Bloom. Full Screen. Linux User Group of Davis March 1, Close.

Introduction to Linux

Lab #2 Physics 91SI Spring 2013

CSE 374 Programming Concepts & Tools. Hal Perkins Winter 2012 Lecture 16 Version control and svn

CS 3410 Intro to Unix, shell commands, etc... (slides from Hussam Abu-Libdeh and David Slater)

Introduction to Linux

Python Scripting for Computational Science

Linux at the Command Line Don Johnson of BU IS&T

CS Fundamentals of Programming II Fall Very Basic UNIX

Modern C++ for Computer Vision and Image Processing. Igor Bogoslavskyi and Cyrill Stachniss

Python Scripting for Computational Science

CISC 220 fall 2011, set 1: Linux basics

Version Control. Contents. Steven J Zeil. February 19, Version Control 3

Lecture 01 - Working with Linux Servers and Git

Laboratory Assignment #3 Eclipse CDT

Practical Session 0 Introduction to Linux

Build. System building

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

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

The Online Unix Manual

Introduction to Version Control

Introduction to Linux (Part I) BUPT/QMUL 2018/03/14

CSE 303: Concepts and Tools for Software Development

Language Translation. Compilation vs. interpretation. Compilation diagram. Step 1: compile. Step 2: run. compiler. Compiled program. program.

Introduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p.

LINUX FUNDAMENTALS (5 Day)

Perl and R Scripting for Biologists

Lecture 2 Operating System Structures (chapter 2)

COSC345 Software Engineering. Version Control

CS480. Compilers Eclipse, SVN, Makefile examples

CSE 390a Lecture 1. introduction to Linux/Unix environment

Contents Coding standard Debugging tool Text editor Version control system

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

2/9/2013 LAB OUTLINE INTRODUCTION TO VCS WHY VERSION CONTROL SYSTEM(VCS)? II SENG 371 SOFTWARE EVOLUTION VERSION CONTROL SYSTEMS

Introduction. File System. Note. Achtung!

Introduction to remote command line Linux. Research Computing Team University of Birmingham

Linux Command Line Interface. December 27, 2017

CSE 374 Programming Concepts & Tools

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

Version Control Systems (Part 1)

Grep and Shell Programming

Lab01: Part I. Introduction to Linux. Professional Training Academy Linux Series

Your departmental website

Unix Philosophy, Text Editors, IDEs

A Practical Introduction to Version Control Systems

Version control with Git.

Version Control Systems: Overview

Know your tools. Programming Proverbs. emacs customisation ($HOME/.emacs) for ioquake. emacs

*nix Crash Course. Presented by: Virginia Tech Linux / Unix Users Group VTLUUG

Version control with RCS and CVS An introduction. Markus Bjartveit Krüger

GNU/Linux Course Lesson 1. Puria Nafisi

Introduction to Linux

AMath 483/583 Lecture 2

Introduction To Python

CMPSC 311- Introduction to Systems Programming Module: Build Processing

AMath 483/583 Lecture 2. Notes: Notes: Homework #1. Class Virtual Machine. Notes: Outline:

ag.el Documentation Release 0.45 Wilfred Hughes

1 Installation (briefly)

Systems Programming Advanced Software Development

Version Control for Fun and Profit

Transcription:

CptS 360 (System Programming) Unit 3: Development Tools Bob Lewis School of Engineering and Applied Sciences Washington State University Spring, 2018

Motivation Using UNIX-style development tools lets you port your code to more platforms. Most of these tools are console based: GUIs aren t very useful when editing over ssh(1) (say). It is not couth to write system programs with an IDE.

Reference Stevens & Rago, Ch. 3 aside: You can find find all code from the book in /cslab/lib/courses/cpts360/stevens_rago_apue

Getting Help Several approached to getting help: man pages info(1) grep(1) /usr/share/doc /usr/include google.com (of course)

man(1) pages Traditional UNIX manual page sections are: section contains 1 commands 2 system calls (most POSIX API pages) 3 general-purpose libraries (e.g. math, stdio, dbm) 4 devices 5 file formats 6 games 7 conventions and miscellany 8 system administration To get help on these classifications, use $ man n intro.

man Command Invocations $ man n entry gets information on entry, optionally restricting the search to section n $ whatis entry gets a one-line description of entry $ apropos keyword (or $ man -k keyword ) gets one-line description of one or more pages whose description includes keyword man:entry or man:entry (section ) in browser (Firefox, at least)

info emacs-like hypertext help browser. part of GNU Run $ info by itself to start at the top level with a list of (all) commands. Run $ info command for information on command. especially useful for compilers and make

Installing Documentation On Linux systems, if you want documentation on foo, look for the package foo-doc.

grep I m not kidding, grep(1) is a very useful tool, if you know what to grep for... Use $ grep pat /usr/include/*.h $ grep pat /usr/include/*/*.h to find a #define or function prototype. Use $ zgrep -l pat /usr/share/man/mann /*.gz to find some remembered phrase or keyword in a man page you may have seen before. Other help source: /usr/share/doc/*

make(1) We ll touch on the basics. Good for more than just compiling. It helps to draw a dependency diagram.

Makefile Syntax Comments Begin with # to end-of-line. Targets May be real files or nonexistent goals (e.g. clean). Rules Need to use Tab. Each line is distinct shell command, unless you use ;\. Suffix rules: may be built-in or user-defined

make Macros syntax: name =value environment variables imported by default various macro tricks: old-style substitution: OBJS=$(SRCS:.c=.o) nested macros: CFLAGS=$(CFLAGS_$(ARCH)) remember: D-R-Y

Commonly-used Macros Most systems have these automatically defined: CC the C compiler CFLAGS C compiler options CPP the C++ compiler CPPFLAGS C++ compiler options LD the loader (usually = $(CC)) LDFLAGS loader options MAKE make itself, with arguments These can be overridden on the command line.

make Command Line Options -k -n keep going as long as possible echo the required operations -f filename use an alternate to makefile or Makefile. -j [# of jobs] (try this on a multiprocessor system!)

Commonly-Used Targets default (first target) install clean immaculate

makedepend(1) analyzes source files to create dependencies of its own. handles nested includes appends dependencies to the makefile (e.g. Makefile) transitive closure on #include

tar(1) syntax $ tar [options ] file... where options are -c create new archive (a.k.a. tarball ) -v be verbose -f filename use filename for new or old tarball name -x extract output -z compress/uncompress tarball with gzip(1)/gunzip(1) -t list the contents of a tarball

Older Revisioning Systems SCCS (Source Code Control System) (obs.) CVS (Concurrent Version System) for multiple developers was superseded by... RCS (Revision Control System) now mostly superseded by...

Contemporary Revisioning Systems SVN (Subversion) manages whole directory trees of files uses database for central repository allows easy renaming of files and directories Git devised by Linus Torvalds for the Linux kernel (he formerly used BitKeeper) project repository repositories often hosted on GitHub (https://www.github.com) each user gets their own copy of the whole repository see https://xkcd.com/1296 and https://xkcd.com/1597 Mercurial (see man pages) don t know much about this one

And Then There s... The C Preprocessor: #if 1 // experimental code #else // code that you re replacing, but want to keep around #endif The new Script (q.v.)

Document Processing System programmers produce documentation. Popular choices: nroff(1), groff(1), and troff(1) easy to figure out outdated for regular documents, but... still used for man pages Microsoft Word if you absolutely must OpenOffice WYSIWYG, mostly OpenDoc format (.od[bgmpst]) easy to analyze (zipped XML archive) and generate LaTeX a pain to learn, but... worth the effort, esp. for professional publications best book (IMHO): Kopka & Daley s Guide to LaTeX ReST (ReStructured Text) intuitive uses readable ASCII files generates HTML, LaTeX, XML, slides from the same input can insert LaTeX if needed

Text Editors System programmers should know at least one of these UNIX editors: emacs(1) East Coast (MIT) origin also a development environment programmable in Lisp windowed or console ( emacs -nw ) mode vim(1) West Coast (UCB) origin (as vi) most widely-used by system programmers programmable in Python console mode only Or maybe jed(1) or jove(1) low-overhead versions of emacs(1) console mode only gedit(1) Linux (Gnome) only GUI mode only

IDEs: Integrated Development Environments If you really need one: Eclipse runs just about everywhere Visual Studio Windows only kdevelop(1) Linux (KDE) only kate(1) Linux only XCode MacOS only Qt Creator C++ only runs just about everywhere uses Qt4 GUI framework (with Qt Designer) Code::Blocks runs just about everywhere uses wxwidgets GUI framework Most of these support multiple languages/file formats. Any others you d like to plug?