COMP 2710 Software Construction Prepare Your Development Environment Dr. Xiao Qin Auburn University

Slides:



Advertisements
Similar presentations
Introduction to the Omega Server CSE Overview Intro to Omega Basic Unix Command Files Directories Printing C and C++ compilers GNU Debugger.
Advertisements

A Guide to Unix Using Linux Fourth Edition
Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
Cosc 4750 Getting Started in UNIX Don’t be afraid of the prompt, in linux it can be your best friend. In some cases, the only way to do certain things.
CSCI 1411 FUNDAMENTALS OF COMPUTING LAB Lab Introduction 1 Shane Transue MSCS.
Program Development Tools IDE vs point tools Two tool flavors exist for developing embedded software: -IDEs: (Integrated Development Environments) i.e.,
CIS 240 Introduction to UNIX Instructor: Sue Sampson.
Working Environment - - Linux - -.
1 ENERGY 211 / CME 211 Lecture 2 September 24, 2008.
CS 202 Computer Science II Lab Fall 2009 September 3.
Guide To UNIX Using Linux Third Edition
Introduction to Unix (CA263) Introduction to Shell Script Programming By Tariq Ibn Aziz.
Editing Java programs with the BlueJ IDE. Working environments to develop (= write) programs There are 2 ways to develop (write) computer programs: 1.Using.
The Unix Environment and Compiling. Getting Set Up Your programs will be compiled and tested on the Departmental server ‘linprog’ The linprog servers.
Using Linux Text Editors. Use Non-Graphical Linux Text Editors Graphical Text Editor.
Introduction to UNIX/Linux Exercises Dan Stanzione.
The Network Management Lab pc pc pc pc pc Virtual Servers Your Laptop.
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
Introduction to Shell Script Programming
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 2 - HelloWorld Application: Introduction to.
Chapter 3 Mastering Editors
CENT 305 Information Systems Security Linux Introduction.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
HTML Hyper Text Markup Language A simple introduction.
1 Editing a C Program 01/16/15. 2 Objective Use Linux to edit, compile and execute a C program.
TAMU CSCE 313 (the basics). Basic Unix/Linux programming Accessing CS systems  PuTTY (putty.exe) – a Telnet and SSH client  Common hosts: unix.cs.tamu.edu.
AE6382 Secure Shell Usually referred to as ssh, the name refers to both a program and a protocol. The program ssh is one of the most useful networking.
Intro. To Unix commands For those who’ve never used Unix before Quick tutorial to let you move around your Unix Accounts No discussion of inner workings.
Natawut NupairojAssembly Language1 Unix Survival Guide.
1 Lab 2 “Hello world” in Unix/Linux #include "std_lib_facilities_4.h" int main(){ cout
Editing, vi and Configuration Files Introduction to Linux June 16, 2009 Papeete, French Polynesia Hervey Allen.
9/2/ CS171 -Math & Computer Science Department at Emory University.
Setting up Cygwin Computer Organization I 1 May 2010 ©2010 McQuain Cygwin: getting the setup tool Free, almost complete UNIX environment emulation.
Getting Started with Linux Linux System Administration Editors.
Chapter Three The UNIX Editors.
CSE 351 GDB Introduction. Lab 1 Status? How is Lab 1 going? I’ll be available at the end of class to answer questions There are office hours later today.
Unix Machine In Computer Science for Teaching Cliff Zou Spring 2015.
CPS120: Introduction to Computer Science Compiling a C++ Program From The Command Line.
Object Oriented Programming COP3330 / CGS5409.  Assignment Submission Overview  Compiling with g++  Using Makefiles  Misc. Review.
Unix Servers Used in This Class  Two Unix servers set up in CS department will be used for some programming projects  Machine name: eustis.eecs.ucf.edu.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
Intro. To Unix commands For those who’ve never used Unix before Quick tutorial to let you move around your Unix Accounts No discussion of inner workings.
Introduction to UNIX and Linux.  Written by Dennis Ritchie and Ken Thomsom at Bell Labs in 1969  Initially written in assembly language and a high-level.
Object Oriented Programming COP3330 / CGS5409.  Compiling with g++  Using Makefiles  Debugging.
CS 120 Extra: The CS1 Server Tarik Booker CS 120.
Learning Unix/Linux Based on slides from: Eric Bishop.
Object Oriented Programming COP3330 / CGS5409.  Assignment Submission Overview  Compiling with g++  Using Makefiles  Misc. Review.
ITX2000 Remote hosts and web servers Prof. Xiaohong (Sharon) Gao Room: T125 Ext: Week 14 – UNIX vi text editor.
 CSC 215 : Procedural Programming with C C Compilers.
1 COMP 3500 Introduction to Operating Systems Project 2 – An Introduction to OS/161 Overview Dr. Xiao Qin Auburn University
By Jonathan Rinfret UNIX/LINUX By Jonathan Rinfret
Cygwin: getting the setup tool
CSC 215 : Procedural Programming with C
Class Projects and Environment
CS1010: Intro Workshop.
Development Environment Basics
Web Programming Essentials:
California State University Fresno
UNIX The Basics Source:
Auburn University COMP 2710 Software Construction xCode Development Environment for C++ Programming in Mac OS Dr. Xiao.
COMP Introduction to Operating Systems Project 1 – Installing CentOS
Guide To UNIX Using Linux Third Edition
Web Programming Essentials:
Class Projects and Environment
Video Notes.
Cygwin: getting the setup tool
CSCI The UNIX System Editing files
Introduction to Linux and Code Editing
Presentation transcript:

COMP 2710 Software Construction Prepare Your Development Environment Dr. Xiao Qin Auburn University

Homework 1 1 hour: UNIX 1 hour: putty (terminal) and winscp (transfer files) 1 hour: vi (editor) 1 hour: g++ (compiler) and helloworld.cpp 2 hour: homework 1 Assumption: You are using the Linux development environment

How to Learn Programming Languages - Fast! Learn C++ Fast Grasp both C++ Syntax and Semantics Learn the programming environment A good reference:

Three steps to grasp both C++ Syntax and Semantics - Fast! Implement: trial projects Actively speed read: tutorials and source code repositories Review: what you've accomplished

1-5 Introduction to C++ C++ Origins –Low-level languages Machine, assembly –High-level languages C, C++, ADA, COBOL, FORTRAN –Object-Oriented-Programming in C++ Copyright © 2008 Pearson Addison-Wesley. All rights reserved.

1-6 Introduction to C++ C++ Terminology –Programs and functions –Basic Input/Output (I/O) with cin and cout Copyright © 2008 Pearson Addison-Wesley. All rights reserved.

1-7 Display 1.1 A Sample C++ Program (1 of 2) Copyright © 2008 Pearson Addison-Wesley. All rights reserved.

Display 1.1 A Sample C++ Program (2 of 2) 1-8 Copyright © 2008 Pearson Addison-Wesley. All rights reserved.

Prepare Your Development Environment: Three Candidate Environments Windows Environment: Eclips IDE, MinGW or Cygwin Linux Environment: No IDE: vi, g++, gdb Mac OS Environment: xCode IDE, Clang C++ compiler

Computers Computer Labs: Windows PC and Mac Your Laptop: Windows, Linux, and Mac OS

Using the CSSE Computer Labs Shelby Building 2119 Shelby Building 2122 For the Windows and Linux Environments

Using the CSSE Computer Labs Shelby Building 2125 For the Mac OS Programming Environment

What you need on a Windows PC or Laptop for Linux Programming Option 1: Linux on remote Tux machines –Putty or secureCRT: Linux terminal on your windows PC –Text Editor on Linux: vi, Pico, or Emacs –winSCP: Transfer files between your windows PC and a remote Linux server Option 2: Local Linux OS on your Laptop –Install Sun VirtualBox on your laptop –In VirbutalBox, install Ubuntu (for Linux beginners), or –In VirbutalBox, install CentOS (for Linux developers).

Secure Shell and FTP Clients PuTTY is a free implementation of Telnet and SSH for Win32 and Unix platforms WinSCP is a very flexible SFTP and SCP client for Windows

What is putty? Local Laptop or PCRemote Linux Server

putty gate.eng.auburn.edu

What is winSCP in Windows? Local Laptop or PCRemote Linux Server Transfer Files

WinSCP for your PC and Laptop

WinSCP (cont.) Files at your Local PC Files at the remote Linux server

How about Mac OS for file transfer? Local Mac LaptopRemote Linux Server Transfer Files Install Filezilla2

Text Editors Choose a text editor. Some determining factors: –What text editor is your professor using? –Are you a computer science major or not? –How much functionality do you want? –After the initial learning curve, how fast do you want to be able to edit?

Pico Pico is the easiest text editor to learn. A non-graphical version of notepad. The downside: –Not every Unix/Linux machine has Pico installed. –You can edit faster in other text editors after you’ve learned them well enough. –Computer science majors who use Pico tend to be made fun of. (Just kidding)

Pico Basics Open a file using “ pico the_file ”. Move around just like you are in notepad. Edit and delete using the normal keys. Save using CTRL + O Exit using CTRL + X Go to a specific line number using CTRL + W, CTRL + T, and the number

Pico Basic (cont.)

Vi Vi is a feature rich editor located on almost all Unix/Linux machines around. Once learned, editing files is extremely fast. The downside: –It’s more complicated than Pico. –It takes time to learn how to use vi. –It’s easy to mess up your documents when you are first learning vi.

Vi and Bike Photo Courtesy of David and Kelly GodzwaDavid and Kelly GodzwaPhoto Courtesy of

Once you learned it, you don't want to walk anymore … Photo Courtesy of Daniel Moyer PhotographyDaniel Moyer Photography

Vi Basics (1) There are three modes to vi: –Command mode (you start in this mode) It is used for entering commands The escape key always gets you back to command –Insert/Append mode It is used for inserting or appending text From command mode, “a” will get you append mode, and “i” will get you insert mode. –Line mode The “:” from command will get you to line mode. It is used for controls like saving and exiting.

Vi Basics (2) Open a file using “ vi the_file ”. Save using “w” (write) from line mode. Quit using “q” (quit) from line mode. Combine the two to save and quit “wq”. Go to line using “#a_number” from line mode. Delete a character using “x” from control mode. Delete a line using “dd” from control mode.

Vi Image

Emacs Emacs is an extendable, customizable, versatile editor capable of doing much more than a regular editor. It is able to be integrated with GDB, the debugger used for C++. The downside: –It is more complicated than Pico –It’s going to take time to learn how to get around.

Emacs Basics(1) Open a file using “ emacs the_file ”. –Note: once emacs opens, you will need to use ctrl-l to move to the file you are editing. Save a file using ctrl-x, ctrl-s Exit using ctrl-x, ctrl-c Go to line using alt+g, g Stop emacs by using ctrl-g

Compiling a C++ Program To compile a c++ program, use the g++ command. “ g++ helloworld.cpp ” –Provided there are no errors, this will create an executable file called a.out. –If you want to name your executable file, use the -o flag to specify a name. “g++ helloworld.cpp -o helloworld.out”

Running a C++ Program Running a c++ program is easy, just type in the name of the executable file! –“a.out” There could be a minor issue however. If for some reason, that doesn’t work, try preceding the name with a./ –“./a.out”

Break! Let’s say you run your program, and realize it never stops! You are stuck in an infinite loop. You need a way to stop (or break) your program. Use ctrl-c to stop a program running in an infinite loop

Core Files If for some reason, you have a very bad error happen when you run your program, you may end up with a core dump. What happens is that Unix saves all information about what happened to a file named “core”. Make sure if this happens to you, that you remove the core file, because they are big, and can take up a lot of your space!

Wildcard There exists a wildcard character. It is the asterix(*). Wherever you put an asterix, Unix/Linux will try to put any character or word. So something like “*.cpp” will select every single.cpp file in your directory. Careful! It can be handy, but dangerous! Using “rm *” would remove everything!

1-38 Summary Characteristics of C++ C++ vs. Java How to use putty and WinSCP? How to use vi? Compiling and running a C++ Program

COMP 2710 Software Construction Using the Eclips IDE Dr. Xiao Qin Auburn University

Step 1 - Launch Eclips

Step 2 - Select a workspace

Step 3 - Create a C++ project

Step 4 - Choose project name, type, tool chain

Step 5 - Basic Settings

Step 6 - Select Configurations

Step 7 - Cross GCC Command

Step 8 - Source Code Generated

Step 9 - Build your project

Step 10 - Run, Binary not found

Step 11 - Show and configure your project

Step 12 - Run Configurations, locate executable file

Step 13 - Locate and run the executable file

COMP 2710 Software Construction Install Cygwin on Windows PC Dr. Xiao Qin Auburn University Reference:

Go to:

Save and run the setup program

Select “Install from Internet”

Accept the default “install root directory” as C:\cygwin

Move the mouse on the “Devel” entry and click until the selector reads Install

After a long time …

Configure “environment variables”: System properties -> Advanced

Configure environment variables

Scroll through the “System Variables” and find a variable named “Path”. Click on Edit.