Using the EE 109 Tools. Allan Weber Mark Redekopp
|
|
- Thomas Winfred Lee
- 5 years ago
- Views:
Transcription
1 1 Using the EE 109 Tools Allan Weber Mark Redekopp
2 2 Note and Disclaimer Please follow the instructions at to setup new labs/projects for your Arduino Some of this material is just background info that is just for reference the stuff we'll use a lot will be repeated as we do it more and more.
3 3 Building a Program The programming/debugging loop: Edit [emacs, TextWrangler, Notepad++] Compile/Link [make, avr-gcc] Download and execute [make flash, avrdude] Observe [ you! ] Repeat [ you! ] Programs can be edited in any plain text editor Available on the VHE 205 Macs: Emacs (command line program) Vi/Vim (command line program) TextWrangler (Mac GUI app) Don t use a word processor (Microsoft Word or Apple TextEdit etc.) How to start a fight: Tell another programmer that your favorite text editor is better than theirs.
4 4 Editing the Program [Mac/Linux] To run command line editors on the Mac, start the Terminal application from the dock at bottom of the screen Emacs and Vi require some knowledge of a few Unix-type commands in order to be useful (cd, ls, rm, more, etc.) Run the editors by just typing the editor name and the name of the file. emacs myfile.c vi myprog.c
5 5 Emacs Quick Reference [Mac/Linux] Emacs uses the keyboard for all editing commands. Easiest way to learn is via the built-in tutorial. Type the command emacs and then once in the editor, enter the command ESC X helpwith-tutorial Read along and follow the instructions
6 6 Emacs Quick Reference [Mac/Linux] Open (Ctrl-x, Ctrl-f) Then type in the name of the file to open or create if it doesn't exist Save (Ctrl-x, Ctrl-s) Exit (Ctrl-x, Ctrl-c) Cancel Command (Ctrl-g) Cut a whole line of text (Ctrl-k) Cut a segment: (Ctrl-space) at start, (Ctrl-w) at end Paste (Ctrl-y) Search (Ctrl-s) then type the word and hit enter Hitting Ctrl-s again will go to the next occurrence
7 7 Editing the Program [Mac] The TextWrangler text editor can be started by dragging and dropping the program file onto the icon in the dock.
8 8 Editing the Program [Windows] The Notepad++ text editor can be started by First selecting the file (left-click) in Explorer Then right-click the selected file and choose 'Edit with Notepad++'
9 COMPILATION UNITS 9
10 10 Compilation Units Often rather than putting all our code/functions in one file it is easier to maintain and re-use code if we break them into multiple files We want functions defined in one file to be able to be called in another But the compiler only compiles one file at a time how does it know if the functions exist elsewhere? #include <avr/io.h> void flash(int delay) { PORTB = (1 << PB5); _delay_ms(delay); PORTB &= ~(1 << PB5); _delay_ms(delay); } int main() { flash(500); // do something else flash(1000); return 0; } flash.c flash1_test.c
11 11 Compilation Units We must prototype any function we want to use that is in another file Rather than make us type in the prototypes for each new program we write that needs that function, put prototypes in a header file that can be reused (included) for any new program void flash(int delay); int main() { flash(500); // do something else flash(1000); return 0; } flash1_test.c void flash(int delay); flash.h #include <avr/io.h> void flash(int delay) { PORTB = (1 << PB5); _delay_ms(delay); PORTB &= ~(1 << PB5); _delay_ms(delay); } flash.c #include "flash.h int main() { flash(500); // do something else flash(1000); return 0; } flash1_test.c #include "flash.h int main() { int i=1000; while(i >= 200){ flash(i); } return 0; } flash2_test.c
12 12 Compiling to Object Code Two issues: We may not want to distribute our source code files With a large program, we don t want to re-compile all the files if the code only changed in one Solution Compiling to object code, creates the machine code/assembly code for just a single file BUT DOESN T try to link any function calls to other files nor does it try to create an executable Use: gcc c filename.c void flash(int delay) { PORTB = (1 << PB5); _delay_ms(delay); PORTB &= ~(1 << PB5); _delay_ms(delay); } gcc c flash.c flash.c flash.o
13 13 Linking After we compile to object code we eventually need to link all the files together and their function calls Without the c, gcc will always try to link You can give gcc source files (.c files) or object (.o files) flash.c (Plain source) gcc -g Wall c flash.c flash.o (Machine / object code) gcc -g Wall o flash1_test flash.o flash1_test (Executable) flash1_test.c (Plain source) gcc -g Wall c flash1_test.c flash1_test.o (Machine / object code) flash1_test.o Note: gcc -g Wall o flash1_test flash.c flash1_test.c Would also work and be fine and thus not require you to compile to object code in a separate step
14 14 gcc/g++ Options Most basic usage gcc c_filenames Creates an executable a.out Options -o => Specifies output executable name (other than default a.out) -g => Include info needed by debuggers like gdb, kdbg, etc. -Wall => show all warnings -c => compile but don't link (i.e. create an object file) -Ipath => add path into #include search directory -Lpath => add path into library search directory -Dmacro => #define macro -llibname => link in the code in library, libname -On => n=[0..6] => Optimization level 0-6
15 COMPILING THE PROGRAM 15
16 XKCD # Courtesy of Randall
17 17 'make' and Makefiles We really use the 'avr-gcc' compiler (just like you use g++ for CS 103) But to compile for the Arduino requires many complex settings/options Also, a single program can be made of many source files and library code files 'make' is a utility program on most Linux/Unix machines which processes commands in a provided Makefile Helps automate compilation process Essentially can use Makefiles as scripts of commands to be run Let make fill in all the complex compilation options Helps provide 'smart' compilation Compiles only files or those that depend on files that have changed since last compilation Reduces wait time for compilation process especially for large programs
18 18 Analogy: Evaluating Expressions Take the equation: x = 5*y + (8*z + 3) Evaluate for y=9, z=7 We evaluate term by term & add What if only y changed and we needed to find the new value of x? What would you reevaluate What if only z changed, what operations would be needed to find the new value of x
19 19 Smart Compilation Only compile code that has changed and any files that DEPEND on that code flash.c (Plain source) [ CHANGED ] gcc -g Wall c flash.c flash.o (Machine / object code) flash1_test.c (Plain source) flash.h gcc -g Wall c flash1_test.c flash1_test.o (Machine / object code) gcc -g Wall o flash flash.o flash1_test.c flash1_test (Executable)
20 20 Compiling the Program A 'Makefile' tells 'make' what files the program is composed of how they depend on each other how to compile each file (convert.c to.o or.o to an executable) 'make' looks at the modification dates on files to determine what needs to be compiled, and only compiles what it has to. Program main.o input.o output.o library1.a main.c input.c output.c sub1.o sub2.o sub3.o proj_defs.h sub1.c sub2.c sub3.c
21 21 Compiling the Program The make program uses the text file Makefile for information on the dependencies (i.e. The contents of 'Makefile' is the script that tells 'make' what to do) Sample Makefile
22 22 The "Makefile" for the Lab 2 program. Most of it is boilerplate and can be ignored. Only requires minor changes to stuff at the top Compiling the Program Change the objects line to contain all the file prefixes your project requires with a.o extension Ex: OBJECTS=flash.o flast1_test.o
23 23 Compiling the Program Edit the program lab2.c file is now newer than the lab2.o file Run make Compiles lab2.c Links to create main.elf Everything up-to-date Make doesn t do anything
24 24 Downloading the Program The make program is also used to download the binary data to the Arduino. Connect the USB cable to the Arduino. make flash to start the download.
25 25 Helpful reference but not needed STOP HERE OTHER NOTES
26 CONDITIONAL COMPILATION 26
27 27 Multiple Inclusion Often separate files may #include's of the same header file This may cause compiling errors when a duplicate declaration is encountered See example Would like a way to include only once and if another attempt to include is encountered, ignore it class string{... }; #include "string.h" class Widget{ public: string s; }; #include "string.h" #include "widget.h" int main() { } string.h widget.h main.cpp class string { // inc. from string.h }; class string{ // inc. from widget.h }; class Widget{... } int main() { } main.cpp after preprocessing
28 28 Conditional Compiler Directives Compiler directives start with '#' #define XXX Sets a flag named XXX in the compiler #ifdef, #ifndef XXX #endif Continue compiling code below until #endif, if XXX is (is not) defined Encapsulate header declarations inside a #ifndef XX #define XX #endif #ifndef STRING_H #define STRING_H class string{... }; #endif #include "string.h" class Widget{ public: string s; }; #include "string.h" #include "string.h" String.h Character.h main.cpp class string{ // inc. from string.h }; class Widget{ // inc. from widget.h... main.cpp after preprocessing
29 29 Conditional Compilation Often used to compile additional DEBUG code Place code that is only needed for debugging and that you would not want to execute in a release version Place code in a #ifdef XX...#endif bracket Compiler will only compile if a #define XX is found Can specify #define in: source code At compiler command line with (-Dxx) flag g++ -o stuff DDEGUG stuff.cpp int main() { int x, sum=0, data[10];... for(int i=0; i < 10; i++){ sum += data[i]; #ifdef DEBUG cout << "Current sum is "; cout << sum << endl; #endif } cout << "Total sum is "; cout << sum << endl; stuff.cpp $ g++ -o stuff DDEBUG stuff.cpp
30 MAKEFILES 30
31 31 make utility Looks for commands in a file called Makefile or whatever is given as the f option on the command line Makefile is a text file with rules (a.k.a targets), dependencies and actions along with macros if desired rule: dependencies [TAB] action1 [TAB] action2 Rules => outputs; Dependencies => Inputs; Actions => commands to build the output from inputs To run the Makefile, we use the make command from the command prompt: make [-f filename] [specific_rule] If no target specified at command line, 'all' target is made:
32 32 Environment variables From the Linux shell (terminal) we can set "variables" that contain values that can be accessed by other programs that provide system and other info PATH LD_LIBRARY_PATH Set with export command export VARIABLE=VALUE Access value with $VARIABLE in shell Access value with $(VARIABLE) in Makefile We defined CXXFLAGS in most of your.profile or.bashrc (startup script) CXXFLAGS = -g -Wall
33 33 Defining macros/variables Makefile MACRO_NAME = MACRO_DEF SRCS = test.cpp prog1.cpp FLAGS = $(CXXFLAGS) # if CXXFLAGS defined by shell Using macros $(MACRO_NAME) $(SRCS) Built-in Macros $< = dependency name / name of the related file that caused the action $@ name of the file to be made / target name Macro Modification OBJS = ${SRCS:.cpp=.o} Substitute.o for.cpp wherever it occurs in the expansion of SRCS
34 34 Example Example wget tar xvf makeex.tar cd makeex test1: foo.cpp bar.cpp test1.cpp test2: bar.cpp list.cpp Two Makefile Makefile.basic Just hard code dependencies I might suggest you go this route for your assignments easier for now Makefile.inter Intermediate: uses some substitutions to be more general proj common src include build src foo.cpp bar.cpp test1.cpp test2.cpp foo.h list.h bar.h Put your.o & exec here list.cpp
Unit 10. Linux Operating System
1 Unit 10 Linux Operating System 2 Linux Based on the Unix operating system Developed as an open-source ("free") alternative by Linux Torvalds and several others starting in 1991 Originally only for Intel
More informationUnit 13. Linux Operating System Debugging Programs
1 Unit 13 Linux Operating System Debugging Programs COMPILATION 2 3 Editors "Real" developers use editors designed for writing code No word processors!! You need a text editor to write your code Eclipse,
More informationUsing the Command Line
1 Unit 15 Debugging COMPILATION 2 3 Using the Command Line While it has a GUI interface like your Mac or Windows PC much of its power lies in its rich set of utilities that are most easily run at the command
More informationCMPT 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 informationCS2141 Software Development using C/C++ Compiling a C++ Program
CS2141 Software Development using C/C++ Compiling a C++ Program g++ g++ is the GNU C++ compiler. A program in a file called hello.cpp: #include using namespace std; int main( ) { cout
More informationLab: Supplying Inputs to Programs
Steven Zeil May 25, 2013 Contents 1 Running the Program 2 2 Supplying Standard Input 4 3 Command Line Parameters 4 1 In this lab, we will look at some of the different ways that basic I/O information can
More informationEE 355 Unit 10. C++ STL - Vectors and Deques. Mark Redekopp
1 EE 355 Unit 10 C++ STL - Vectors and Deques Mark Redekopp 2 Templates We ve built a list to store integers But what if we want a list of double s or char s or other objects We would have to define the
More informationCommand Line Navigation and Compiling
Command Line Navigation and Compiling You should become familiar with how to compile and work from the command line. Below is a quick reference and instructions on how to use the gcc c++ compiler (g++)
More informationThe Linux Programming Environment. Computer Science Department Texas State University
The Linux Programming Environment Computer Science Department Texas State University TUTORIAL REQUIREMENTS... 1 INTRODUCTION... 1 COMPILATION... 1 COMMAND LINE COMPILATION... 1 Basic Compilation... 2 The
More informationReviewing 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 informationIf you are on a Mac/Linux box, some commands will differ, but many will be the same.
Overview You should become familiar with how to compile and work from the command line. Below is a quick reference and instructions on how to use the gcc c++ compiler (g++) from the Windows command line.
More informationCompiling with Multiple Files The Importance of Debugging CS 16: Solving Problems with Computers I Lecture #7
Compiling with Multiple Files The Importance of Debugging CS 16: Solving Problems with Computers I Lecture #7 Ziad Matni Dept. of Computer Science, UCSB Programming in Multiple Files The Magic of Makefiles!
More informationCS354 gdb Tutorial Written by Chris Feilbach
CS354 gdb Tutorial Written by Chris Feilbach Purpose This tutorial aims to show you the basics of using gdb to debug C programs. gdb is the GNU debugger, and is provided on systems that
More informationCS101 Linux Shell Handout
CS101 Linux Shell Handout Introduction This handout is meant to be used as a quick reference to get a beginner level hands on experience to using Linux based systems. We prepared this handout assuming
More informationSeparate Compilation of Multi-File Programs
1 About Compiling What most people mean by the phrase "compiling a program" is actually two separate steps in the creation of that program. The rst step is proper compilation. Compilation is the translation
More informationUNIX Makefile. C Project Library Distribution and Installation.
UNIX Makefile C Project Library Distribution and Installation. Tarballs Most non-package software is distributed in source code format. The most common format being C project libraries in compressed TAR
More informationIntermediate Programming, Spring Misha Kazhdan
600.120 Intermediate Programming, Spring 2017 Misha Kazhdan Outline Unix/Linux command line Basics of the Emacs editor Compiling and running a simple C program Cloning a repository Connecting to ugrad
More informationExercise 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 informationINTERMEDIATE SOFTWARE DESIGN SPRING 2011 ACCESS SPECIFIER: SOURCE FILE
HEADER FILE A header (.h,.hpp,...) file contains Class definitions ( class X {... }; ) Inline function definitions ( inline int get_x() {... } ) Function declarations ( void help(); ) Object declarations
More informationSoftware Engineering /48
Software Engineering 1 /48 Topics 1. The Compilation Process and You 2. Polymorphism and Composition 3. Small Functions 4. Comments 2 /48 The Compilation Process and You 3 / 48 1. Intro - How do you turn
More informationA Fast Review of C Essentials Part II
A Fast Review of C Essentials Part II Structural Programming by Z. Cihan TAYSI Outline Macro processing Macro substitution Removing a macro definition Macros vs. functions Built-in macros Conditional compilation
More informationCSE 374 Programming Concepts & Tools
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2017 Lecture 14 Makefiles and Compilation Management 1 Where we are Onto tools... Basics of make, particular the concepts Some fancier make features
More informationC: Program Structure. Department of Computer Science College of Engineering Boise State University. September 11, /13
Department of Computer Science College of Engineering Boise State University September 11, 2017 1/13 Scope Variables and functions are visible from the point they are defined until the end of the source
More informationCSci 4061 Introduction to Operating Systems. Programs in C/Unix
CSci 4061 Introduction to Operating Systems Programs in C/Unix Today Basic C programming Follow on to recitation Structure of a C program A C program consists of a collection of C functions, structs, arrays,
More informationLab 1 Introduction to UNIX and C
Name: Lab 1 Introduction to UNIX and C This first lab is meant to be an introduction to computer environments we will be using this term. You must have a Pitt username to complete this lab. NOTE: Text
More informationMakefile 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 informationCS 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 informationCS240: Programming in C
CS240: Programming in C Lecture 2: Hello World! Cristina Nita-Rotaru Lecture 2/ Fall 2013 1 Introducing C High-level programming language Developed between 1969 and 1973 by Dennis Ritchie at the Bell Labs
More informationGDB and Makefile. Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island
GDB and Makefile Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island GDB Debugging: An Example #include void main() { int i; int result
More informationSoftware Development With Emacs: The Edit-Compile-Debug Cycle
Software Development With Emacs: The Edit-Compile-Debug Cycle Luis Fernandes Department of Electrical and Computer Engineering Ryerson Polytechnic University August 8, 2017 The Emacs editor permits the
More informationUsing the Zoo Workstations
Using the Zoo Workstations Version 1.86: January 16, 2014 If you ve used Linux before, you can probably skip many of these instructions, but skim just in case. Please direct corrections and suggestions
More informationUsing the Unix system. UNIX Introduction
Using the Unix system Navigating the Unix file system Editing with emacs Compiling with gcc UNIX Introduction The UNIX operating system is made up of three parts: the kernel, the shell and the programs
More informationLaboratory 1 Semester 1 11/12
CS2106 National University of Singapore School of Computing Laboratory 1 Semester 1 11/12 MATRICULATION NUMBER: In this lab exercise, you will get familiarize with some basic UNIX commands, editing and
More informationPRINCIPLES OF OPERATING SYSTEMS
PRINCIPLES OF OPERATING SYSTEMS Tutorial-1&2: C Review CPSC 457, Spring 2015 May 20-21, 2015 Department of Computer Science, University of Calgary Connecting to your VM Open a terminal (in your linux machine)
More informationChris' Makefile Tutorial
Chris' Makefile Tutorial Chris Serson University of Victoria June 26, 2007 Contents: Chapter Page Introduction 2 1 The most basic of Makefiles 3 2 Syntax so far 5 3 Making Makefiles Modular 7 4 Multi-file
More informationHOW TO USE CODE::BLOCKS IDE FOR COMPUTER PROGRAMMING LABORATORY SESSIONS
HOW TO USE CODE::BLOCKS IDE FOR COMPUTER PROGRAMMING LABORATORY SESSIONS INTRODUCTION A program written in a computer language, such as C/C++, is turned into executable using special translator software.
More informationOBJECT ORIENTED PROGRAMMING USING C++
OBJECT ORIENTED PROGRAMMING USING C++ Chapter 17 - The Preprocessor Outline 17.1 Introduction 17.2 The #include Preprocessor Directive 17.3 The #define Preprocessor Directive: Symbolic Constants 17.4 The
More informationProjects 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 informationLecture 1. A. Sahu and S. V. Rao. Indian Institute of Technology Guwahati
Lecture 1 Introduction to Computing A. Sahu and S. V. Rao Dept of Comp. Sc. & Engg. Indian Institute of Technology Guwahati 1 Outline Computer System Problem Solving and Flow Chart Linux Command ls, mkdir,
More informationContinue: 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 informationProgramming Requirements
Programming Requirements Ming-Hwa Wang, Ph.D. Department of Computer Engineering Santa Clara University General Requirements Programs should be coded in the language required by the class. Run on school
More informationCS 247: Software Engineering Principles. Modules
CS 247: Software Engineering Principles Modules Readings: Eckel, Vol. 1 Ch. 2 Making and Using Objects: The Process of Language Translation Ch. 3 The C in C++: Make: Managing separate compilation Ch. 10
More information2 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 informationCode::Blocks Student Manual
Code::Blocks Student Manual Lawrence Goetz, Network Administrator Yedidyah Langsam, Professor and Theodore Raphan, Distinguished Professor Dept. of Computer and Information Science Brooklyn College of
More informationStarting to Program in C++ (Basics & I/O)
Copyright by Bruce A. Draper. 2017, All Rights Reserved. Starting to Program in C++ (Basics & I/O) On Tuesday of this week, we started learning C++ by example. We gave you both the Complex class code and
More informationPractical C Issues:! Preprocessor Directives, Multi-file Development, Makefiles. CS449 Fall 2017
Practical C Issues:! Preprocessor Directives, Multi-file Development, Makefiles CS449 Fall 2017 Multi-file Development Multi-file Development Why break code into multiple source files? Parallel development
More informationSU2017. LAB 1 (May 4/9) Introduction to C, Function Declaration vs. Definition, Basic I/O (scanf/printf, getchar/putchar)
SU2017. LAB 1 (May 4/9) Introduction to C, Function Declaration vs. Definition, Basic I/O (scanf/printf, getchar/putchar) 1 Problem A 1.1 Specification Write an ANSI-C program that reads input from the
More information11.1 Modular Organization and makefiles.
Chapter 11: Modules and Makefiles 11.1 Modular Organization and makefiles. From the Fanny Farmer cookbook: Before beginning to mix, be sure that all ingredients and utensils are on hand. You can t bake
More informationCpSc 1111 Lab 1 Introduction to Unix Systems, Editors, and C
CpSc 1111 Lab 1 Introduction to Unix Systems, Editors, and C Welcome! Welcome to your CpSc 111 lab! For each lab this semester, you will be provided a document like this to guide you. This material, as
More informationANSI C. Data Analysis in Geophysics Demián D. Gómez November 2013
ANSI C Data Analysis in Geophysics Demián D. Gómez November 2013 ANSI C Standards published by the American National Standards Institute (1983-1989). Initially developed by Dennis Ritchie between 1969
More informationBeyond this course. Machine code. Readings: CP:AMA 2.1, 15.4
Beyond this course Readings: CP:AMA 2.1, 15.4 CS 136 Spring 2018 13: Beyond 1 Machine code In Section 04 we briefly discussed compiling: converting source code into machine code so it can be run or executed.
More informationCMPSC 311- Introduction to Systems Programming Module: Build Processing
CMPSC 311- Introduction to Systems Programming Module: Build Processing Professor Patrick McDaniel Fall 2014 UNIX Pipes Pipes are ways of redirecting the output of one command to the input of another Make
More informationPROGRAMMAZIONE I A.A. 2017/2018
PROGRAMMAZIONE I A.A. 2017/2018 STEPS OF GCC STEPS file.c Preprocessor Compiler file1.o file2.o Assembler Linker executable file PREPROCESSOR PREPROCESSOR The C preprocessor is a macro processor that is
More informationCMPSC 311- Introduction to Systems Programming Module: Build Processing
CMPSC 311- Introduction to Systems Programming Module: Build Processing Professor Patrick McDaniel Fall 2016 UNIX Pipes Pipes are ways of redirecting the output of one command to the input of another Make
More informationCode::Blocks Student Manual
Code::Blocks Student Manual Lawrence Goetz, Network Administrator Yedidyah Langsam, Professor and Theodore Raphan, Distinguished Professor Dept. of Computer and Information Science Brooklyn College of
More informationTemple University Computer Science Programming Under the Linux Operating System January 2017
Temple University Computer Science Programming Under the Linux Operating System January 2017 Here are the Linux commands you need to know to get started with Lab 1, and all subsequent labs as well. These
More informationWhen talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used:
Linux Tutorial How to read the examples When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used: $ application file.txt
More informationMultiple 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 informationCPSC 427: Object-Oriented Programming
CPSC 427: Object-Oriented Programming Michael J. Fischer Lecture 3 September 7, 2016 CPSC 427, Lecture 3 1/27 Insertion Sort Example Program specification Monolithic solution Modular solution in C Modular
More informationOregon 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 informationindependent compilation and Make
independent compilation and Make Geoffrey Brown David S. Wise Chris Haynes Bryce Himebaugh Computer Structures Fall 2013 Independent Compilation As a matter of style, source code files should rarely be
More informationCS 2400 Laboratory Assignment #1: Exercises in Compilation and the UNIX Programming Environment (100 pts.)
1 Introduction 1 CS 2400 Laboratory Assignment #1: Exercises in Compilation and the UNIX Programming Environment (100 pts.) This laboratory is intended to give you some brief experience using the editing/compiling/file
More informationCS 326 Operating Systems C Programming. Greg Benson Department of Computer Science University of San Francisco
CS 326 Operating Systems C Programming Greg Benson Department of Computer Science University of San Francisco Why C? Fast (good optimizing compilers) Not too high-level (Java, Python, Lisp) Not too low-level
More informationMakefile Practice: Part 1 Making a Single Program without Templated.h Files: Get the MakeBasics folder from the CS260 repository.
Makefile Practice: Part 1 Making a Single Program without Templated.h Files: Get the MakeBasics folder from the CS260 repository. You need to make a new file called MyMake with no extension in the MakeBasics
More information15-122: Principles of Imperative Computation
15-122: Principles of Imperative Computation Lab 0 Navigating your account in Linux Tom Cortina, Rob Simmons Unlike typical graphical interfaces for operating systems, here you are entering commands directly
More informationCS 220: Introduction to Parallel Computing. Beginning C. Lecture 2
CS 220: Introduction to Parallel Computing Beginning C Lecture 2 Today s Schedule More C Background Differences: C vs Java/Python The C Compiler HW0 8/25/17 CS 220: Parallel Computing 2 Today s Schedule
More informationLab 1 Introduction to UNIX and C
Name: Lab 1 Introduction to UNIX and C This first lab is meant to be an introduction to computer environments we will be using this term. You must have a Pitt username to complete this lab. The doc is
More informationCSE 374 Programming Concepts & Tools
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2017 Lecture 13 C: The Rest of the Preprocessor 1 Administrivia Midterm exam Wednesday, here Topics: everything up to hw4 (including gdb concepts,
More informationIntroduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines
Introduction to UNIX Logging in Basic system architecture Getting help Intro to shell (tcsh) Basic UNIX File Maintenance Intro to emacs I/O Redirection Shell scripts Logging in most systems have graphical
More informationLab 2 Building on Linux
Lab 2 Building on Linux Assignment Details Assigned: January 28 th, 2013. Due: January 30 th, 2013 at midnight. Background This assignment should introduce the basic development tools on Linux. This assumes
More informationIntro to C and Binary Numbers 8/27/2007
Intro to C and Binary Numbers 8/27/2007 1 Opening Discussion Let's look at three answers to the interclass question. What are the steps in building a C program? Do you have any questions about the class
More informationLinux Tutorial #1. Introduction. Login to a remote Linux machine. Using vim to create and edit C++ programs
Linux Tutorial #1 Introduction The Linux operating system is now over 20 years old, and is widely used in industry and universities because it is fast, flexible and free. Because Linux is open source,
More information#include <stdio.h> int main() { printf ("hello class\n"); return 0; }
C #include int main() printf ("hello class\n"); return 0; Working environment Linux, gcc We ll work with c9.io website, which works with ubuntu I recommend to install ubuntu too Also in tirgul
More informationBerner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 2
Compiling a C program CS Basics 15) Compiling a C prog. Emmanuel Benoist Fall Term 2016-17 Example of a small program Makefile Define Variables Compilation options Conclusion Berner Fachhochschule Haute
More informationCS Basics 15) Compiling a C prog.
CS Basics 15) Compiling a C prog. Emmanuel Benoist Fall Term 2016-17 Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 1 Compiling a C program Example of a small
More informationThe make utility. Alark Joshi COMPSCI 253
The make utility Alark Joshi COMPSCI 253 What is make? Make is a utility that is included with Linux/Unix operating systems It is a command generator It is designed to help you compile large projects It
More informationLab #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 informationCSE 333 Interlude - make and build tools
CSE 333 Interlude - make and build tools Hal Perkins Paul G. Allen School of Computer Science & Engineering University of Washington make make is a classic program for controlling what gets (re)compiled
More informationLanguage Translation. Compilation vs. interpretation. Compilation diagram. Step 1: compile. Step 2: run. compiler. Compiled program. program.
Language Translation Compilation vs. interpretation Compilation diagram Step 1: compile program compiler Compiled program Step 2: run input Compiled program output Language Translation compilation is translation
More informationIntroduction to Linux
Introduction to Linux The command-line interface A command-line interface (CLI) is a type of interface, that is, a way to interact with a computer. Window systems, punched cards or a bunch of dials, buttons
More informationCMPUT 201: Practical Programming Methodology. Guohui Lin Department of Computing Science University of Alberta September 2018
CMPUT 201: Practical Programming Methodology Guohui Lin guohui@ualberta.ca Department of Computing Science University of Alberta September 2018 Lecture 1: Course Outline Agenda: Course calendar description
More informationCS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 3: SEP. 13TH INSTRUCTOR: JIAYIN WANG
CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 3: SEP. 13TH INSTRUCTOR: JIAYIN WANG 1 Notice Reading Assignment Chapter 1: Introduction to Java Programming Homework 1 It is due this coming Sunday
More informationCarnegie Mellon. Linux Boot Camp. Jack, Matthew, Nishad, Stanley 6 Sep 2016
Linux Boot Camp Jack, Matthew, Nishad, Stanley 6 Sep 2016 1 Connecting SSH Windows users: MobaXterm, PuTTY, SSH Tectia Mac & Linux users: Terminal (Just type ssh) andrewid@shark.ics.cs.cmu.edu 2 Let s
More informationThe CS-220 Development Environment
The Development Environment (No relevant sections in text) Picking the right tool for the job 2 Integrated Development Environment 3 Command Line Mentality Old fashioned but surprisingly efficient (except
More informationProblem Set 1: Unix Commands 1
Problem Set 1: Unix Commands 1 WARNING: IF YOU DO NOT FIND THIS PROBLEM SET TRIVIAL, I WOULD NOT RECOMMEND YOU TAKE THIS OFFERING OF 300 AS YOU DO NOT POSSESS THE REQUISITE BACKGROUND TO PASS THE COURSE.
More informationDynamic Arrays Makefiles and Mul3ple File Compiles
Dynamic Arrays Makefiles and Mul3ple File Compiles CS 16: Solving Problems with Computers I Lecture #14 Ziad Matni Dept. of Computer Science, UCSB WHAT THE NEXT 3 WEEKS LOOK LIKE MONDAY TUESDAY WEDNESDAY
More informationHow 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 informationKYC - Know your compiler. Introduction to GCC
KYC - Know your compiler Introduction to GCC The Operating System User User 1 General Purpose or Application Specific Software Operating System Kernel Computer Hardware User 2 What is GCC? GCC is the GNU
More informationChapter 1 An Introduction to C++, Unix, SSH and Komodo Edit
Chapter 1 An Introduction to C++, Unix, SSH and Komodo Edit Contents 1 An Introduction to C++, Unix, SSH and Komodo Edit 1.1 Introduction 1.2 The C++ Language 1.2.1 A Brief Introduction 1.2.1.1 Recommended
More informationIntroduction to the basics of UNIX
Introduction to the basics of UNIX Joachim Hein Centre for Mathematical Sciences Lund University Outline 1 Operating system UNIX 2 Interacting with UNIX Manipulating files and directories Editing files:
More informationEclipse Environment Setup
Eclipse Environment Setup Adapted from a document from Jeffrey Miller and the CS201 team by Shiyuan Sheng. Introduction This lab document will go over the steps to install and set up Eclipse, which is
More informationGetting Started with Python and the PyCharm IDE
New York University School of Continuing and Professional Studies Division of Programs in Information Technology Getting Started with Python and the PyCharm IDE Please note that if you already know how
More informationThe C Preprocessor Compiling and Linking Using MAKE
All slides c Brandon Runnels, 2014 This presentation is not for general distribution; please do not duplicate without the author s permission. Under no circumstances should these slides be sold or used
More informationCS11 Advanced C++ Fall Lecture 4
CS11 Advanced C++ Fall 2006-2007 Lecture 4 Today s Topics Using make to automate build tasks Using doxygen to generate API docs Build-Automation Standard development cycle: Write more code Compile Test
More informationCSE 333 Midterm Exam 5/9/14 Sample Solution
Question 1. (20 points) C programming. Implement the C library function strncpy. The specification of srncpy is as follows: Copy characters (bytes) from src to dst until either a '\0' character is found
More informationReliable C++ development - session 1: From C to C++ (and some C++ features)
Reliable C++ development - session 1: From C to C++ (and some C++ features) Thibault CHOLEZ - thibault.cholez@loria.fr TELECOM Nancy - Université de Lorraine LORIA - INRIA Nancy Grand-Est From Nicolas
More informationA Tutorial on using Code::Blocks with Catalina 3.0.3
A Tutorial on using Code::Blocks with Catalina 3.0.3 BASIC CONCEPTS...2 PREREQUISITES...2 INSTALLING AND CONFIGURING CODE::BLOCKS...3 STEP 1 EXTRACT THE COMPONENTS...3 STEP 2 INSTALL CODE::BLOCKS...3 Windows
More informationMake: a build automation tool
Make: a build automation tool What is the problem? The lab examples repository for the CS 253 course has 228 files in 54 folders. To build them all would requires us to navigate to 54 folders and compile
More informationIntroduction to Algorithms and Programming I Lab. Exercises #1 Solution
60-140 Introduction to Algorithms and Programming I Lab. Exercises #1 Solution Objectives are to: 1. Learn basic Unix commands for preparing a source C program file, compiling a C program and executing
More information1) Log on to the computer using your PU net ID and password.
CS 150 Lab Logging on: 1) Log on to the computer using your PU net ID and password. Connecting to Winter: Winter is the computer science server where all your work will be stored. Remember, after you log
More information