Editing & Compiling: UNIX vs. IDE and an Intro to Architecture.

Slides:



Advertisements
Similar presentations
Lecture 2 - Introduction Objective C is used primarily for application development on Apple's Mac OS X and iPhone. On the Apple it is used together with.
Advertisements

Systems Software.
Assembly 01. Outline Binary vs. Text Files Compiler vs. Assembler Mnemonic Assembly Process Development Process Debugging Example 1 this analogy will.
16/13/2015 3:30 AM6/13/2015 3:30 AM6/13/2015 3:30 AMIntroduction to Software Development What is a computer? A computer system contains: Central Processing.
Computer Software.
ITP © Ron Poet Lecture 1 1 IT Programming Introduction.
Lesson 4 Computer Software
Agenda What is Computer Programming? The Programming Process
CCSA 221 Programming in C CHAPTER 2 SOME FUNDAMENTALS 1 ALHANOUF ALAMR.
Chapter Introduction to Computers and Programming 1.
Introduction to Programming Dr Masitah Ghazali Programming Techniques I SCJ1013.
Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code.
Chapter 17 Programming Tools The Architecture of Computer Hardware and Systems Software: An Information Technology Approach 3rd Edition, Irv Englander.
CS110/CS119 Introduction to Computing (Java)
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
COMPUTER SOFTWARE Section 2 “System Software: Computer System Management ” CHAPTER 4 Lecture-6/ T. Nouf Almujally 1.
4 - 1 Copyright © 2006, The McGraw-Hill Companies, Inc. All rights reserved.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Introduction to Interactive Media Interactive Media Tools: Software.
CSCI 130 Chapter 1. History of C Bell Telephone Laboratories (1972) Dennis Ritchie (also created UNIX) A - B - C.
What is a Computer? An, electrical machine, that can be programmed to accept data (input), process it into useful information (output) and store it away.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
Computer Engineering 1 nd Semester Dr. Rabie A. Ramadan 2.
Introduction to C Programming CE Lecture 7 Compiler options and makefiles.
Just as there are many human languages, there are many computer programming languages that can be used to develop software. Some are named after people,
Fundamental Programming: Fundamental Programming K.Chinnasarn, Ph.D.
1 Programming in C Hello World! Soon I will control the world! Soon I will control the world!
Editors And Debugging Systems Other System Software Text Editors Interactive Debugging Systems UNIT 5 S.Sharmili Priyadarsini.
Algorithms  Problem: Write pseudocode for a program that keeps asking the user to input integers until the user enters zero, and then determines and outputs.
29-Nov-15 Getting Ready for Java. 2 What is Java? Java is a programming language: a language that you can learn to write, and the computer can be made.
Chapter Three The UNIX Editors.
Intermediate 2 Computing Unit 2 - Software Development Topic 2 - Software Development Languages and Environments.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
Application Software System Software.
CPS120: Introduction to Computer Science Compiling a C++ Program From The Command Line.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Java Programs COMP 102 #3.
Department of Electronic & Electrical Engineering Introduction to C - The Development cycle. Why C? The development cycle. Using Visual Studio ? A simple.
The Development Process Compilation. Compilation - Dr. Craig A. Struble 2 Programming Process Problem Solving Phase We will spend significant time on.
Getting ready. Why C? Design Features – Efficiency (C programs tend to be compact and to run quickly.) – Portability (C programs written on one system.
Outline Announcements: –HW I key online this afternoon –HW II due Friday –Sign up to discuss projects Debugging Testging for correctness.
© Peter Andreae Java Programs COMP 102 # T1 Peter Andreae Computer Science Victoria University of Wellington.
Chapter 1: Introduction to Computers and Programming.
L071 Introduction to C Topics Compilation Using the gcc Compiler The Anatomy of a C Program Reading Sections
Visual Programming Borland Delphi. Developing Applications Borland Delphi is an object-oriented, visual programming environment to develop 32-bit applications.
Programming 2 Intro to Java Machine code Assembly languages Fortran Basic Pascal Scheme CC++ Java LISP Smalltalk Smalltalk-80.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
1 Programming and problem solving in C, Maxima, and Excel.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Debugging using By: Samuel Ashby. What is debugging?  A bug is an error in either a program or the hardware itself.  Debugging is first locating and.
Introduction To Software Development Environment.
Software Development Languages and Environments. Computer Languages Just as there are many human languages, there are many computer programming languages.
Programming Language Basics. What is a Programming Language? “A computer, human-created language used to write instructions for a computer.” “An artificial.
Chapter 3: Mastering Editors Chapter 3 Mastering Editors (Emacs)
INTRO. To I.T Razan N. AlShihabi
Chapter 5: Preparing C Programs
BASIC PROGRAMMING C SCP1103 (02)
Development Environment
BASIC PROGRAMMING C SCP1103 (02)
Microprocessor and Assembly Language
Algorithms Problem: Write pseudocode for a program that keeps asking the user to input integers until the user enters zero, and then determines and outputs.
Guide To UNIX Using Linux Third Edition
Computer Engineering 1nd Semester
Introduction to C Topics Compilation Using the gcc Compiler
Introduction to C Topics Compilation Using the gcc Compiler
CSCI/CMPE 3334 Systems Programming
Unit# 8: Introduction to Computer Programming
Computer Science I CSC 135.
Creating your first C program
Programming Language Basics
Review of Previous Lesson
Presentation transcript:

Editing & Compiling: UNIX vs. IDE and an Intro to Architecture

Outline Announcements: –Homework I on web, due Fri., 5PM by e- mail Basic computer architecture Creating code Compiling code Integrated Development Environments

Development Process 1.Design 2.Specification 3.Build Prototype 4.Implementation: write the code 5.Build: Get it to compile and run a) Debug I: find and fix syntax errors b) Debug II: find and fix semantic errors (testing) 6.Improve performance through tuning or re- design

Build Process Write code Pass to compiler –Compiler creates an “executable”--a binary file with low- level instructions equivalent to your high-level program Run the executable prog.c for (j=0;j<5){ : } prog {ø∆˜ß√ˆœπ˚ Œ¨Ω√≈˜¡£¢∞ cc prog.c -oprog

Compiling & Linking Compiling consists of two steps: –Translating high-level language to machine code Many ways to translate same commands Some ways may have better performance –Linking bits of machine code together to form an executable Even simple programs are not self contained –You can call routines like “sin,” “printf”, or “write;” but you don’t have to include code for these functions in your program Rather, “built-in” functions have already been translated and are stored in object files somewhere on the system Compiler must get the machine code and bundle with your executable

Compiling & Linking prog.c for (j=0;j<5){ sin(x[j]); } prog {ø∆˜ß√ˆœπ˚ Œ¨Ω√≈˜¡£¢∞ cc prog.c -oprog Transnslation prog.o Œ¨Ω√≈˜¡£¢∞ Link printf.o Œ¨Ω√≈˜¡£¢∞ Œ¨Ω√≈˜¡£¢∞ sin.o

Basic Development on UNIX A note on UNIX: –UNIX is a powerful, elegant, and simple OS –For many years, UNIX systems were THE systems for scientific work –Windows is eating away, but UNIX systems are still common –I will typically discuss UNIX tools first and then examine analogous tools on Windows –The UNIX tools are typically more general and were the inspiration for the Windows analogs

Basic Development on UNIX First thing we need is a text editor –vi--terminal editor. Very basic editor that you control solely through the keyboard (no mousing) useful for fixing small bugs, editing input files I wouldn’t want to write more than a few lines, though –Emacs--classic UNIX word processor. Lots of people love emacs, but I’m not one of them –NEdit--world’s greatest text editor Mac/PC like interface, good syntax highlighting (can be easily modified and customized) Efficient searching/replace (possible to use regular expressions) column cut and paste!

Basic Development on UNIX Next, we need to compile –Compilers are specific to programming languages (sort of) Operating Systems/processors (definitely) –For a given language/system combination there are often several compilers differ by price: GNU vs. commercial differ by performance

Basic Development on UNIX Compiling on UNIX –cc -o –compiler name might change (gcc, cc, f77, f90), but the format is usually the same –typical options: -o : name the executable (otherwise, a.out) -O : perform some basic performance optimizations -O2: perform some more dramatic optimizations -c: compile to object code (don’t link) -g: enable debugging -l : link to library lib.a -w: inhibit warnings

Basic Development on UNIX Running the program –just type the name (assumes. is in path) –if that doesn’t work, type./name

Basic Development on Windows Editors –Free stuff like Notepad, Wordpad –NEdit –MSWord (but why?) Compilers –most will work from a DOS prompt in a UNIX-like fashion –key difference is that you use /

Basic Development on Windows Although you can do things from a DOS prompt, most Windows programming is done in an Integrated Development Environment (IDE) –CodeWarrior –VisualStudio –Also ProjectBuilder (Mac), KDev (Linux) What are they integrating? –combine editor, compiler, and debugger

Much easier to use, just edit and push a button to compile and run –can often click on compiler error messages and go right to the line –set compiler options through menus Main disadvantage: disconnected from compiler –often, finding compiler options is hard and usually just like the command line –documentation can be poor IDEs