TNM093 Practical Data Visualization and Virtual Reality Laboratory Platform

Similar documents
History. Terminology. Opening a Terminal. Introduction to the Unix command line GNOME

Laboratory Assignment #3 Eclipse CDT

Using the Unix system. UNIX Introduction

CS 261 Recitation 1 Compiling C on UNIX

CS Fundamentals of Programming II Fall Very Basic UNIX

Intermediate Programming, Spring Misha Kazhdan

Perl and R Scripting for Biologists

Introduction to Linux Environment. Yun-Wen Chen

Working with Basic Linux. Daniel Balagué

Lecture 01 - Working with Linux Servers and Git

CENG 334 Computer Networks. Laboratory I Linux Tutorial

Exercise 1: Basic Tools

Using the Zoo Workstations

COMS 6100 Class Notes 3

Introduction to Supercomputing

CSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80

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

Contents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version...

ENCM 339 Fall 2017: Editing and Running Programs in the Lab

Laboratory 1 Semester 1 11/12

Unix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University

Introduction to Linux Workshop 1

Unix and C Program Development SEEM

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

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

CENG393 Computer Networks Labwork 1

Introduction. File System. Note. Achtung!

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

Linux Command Line Primer. By: Scott Marshall

CS480. Compilers Eclipse, SVN, Makefile examples

Introduction to Linux. Fundamentals of Computer Science

Introduction to Linux

Carnegie Mellon. Linux Boot Camp. Jack, Matthew, Nishad, Stanley 6 Sep 2016

Chapter-3. Introduction to Unix: Fundamental Commands

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

Unix Tutorial Haverford Astronomy 2014/2015

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

A Brief Introduction to the Linux Shell for Data Science

CS370 Operating Systems

CSE 391 Lecture 1. introduction to Linux/Unix environment

CSE 391 Lecture 1. introduction to Linux/Unix environment

Linux Tutorial. Ken-ichi Nomura. 3 rd Magics Materials Software Workshop. Gaithersburg Marriott Washingtonian Center November 11-13, 2018

Lecture 4: Build Systems, Tar, Character Strings

Text Editors for Programmers. Dr. Prasad Kulkarni Michael Jantz Jamie Robinson

Editors in Unix come in two general flavours:

Using UNIX. -rwxr--r-- 1 root sys Sep 5 14:15 good_program

Network Monitoring & Management. A few Linux basics

CSC209. Software Tools and Systems Programming.

Intro to Linux & Command Line

Operating System Interaction via bash

Module 3: Working with C/C++

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

213/513/613 Linux/Git Bootcamp. Cyrus, Eugene, Minji, Niko

Princeton University COS 217: Introduction to Programming Systems Emacs Reference and Tutorial

Introduction to Linux

LAB #7 Linux Tutorial

Introduction to Linux

Eugene, Niko, Matt, and Oliver

Virtual Machine. Linux flavor : Debian. Everything (except slides) preinstalled for you.

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

CS 246 Winter Tutorial 1

Introduction to Linux

Linux File System and Basic Commands

CSE Linux VM. For Microsoft Windows. Based on opensuse Leap 42.2

Overview LEARN. History of Linux Linux Architecture Linux File System Linux Access Linux Commands File Permission Editors Conclusion and Questions

Applied Informatics POCO PRO C++ Frameworks

Systems Programming and Computer Architecture ( ) Exercise Session 01 Data Lab

15-122: Principles of Imperative Computation

CS CS Tutorial 2 2 Winter 2018

Emacs manual:

Getting Started with UNIX

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

Introduction to the Linux Command Line

Unit 10. Linux Operating System

Projects and Environment Introduction

Development Environment & Linux Guide

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

User Guide Version 2.0

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering

Reviewing gcc, make, gdb, and Linux Editors 1

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

1 Installation (briefly)

Unit 13. Linux Operating System Debugging Programs

UNLV Computer Science Department CS 135 Lab Manual

Intro to Linux. this will open up a new terminal window for you is super convenient on the computers in the lab

UNIT 9 Introduction to Linux and Ubuntu

Bioinformatics? Reads, assembly, annotation, comparative genomics and a bit of phylogeny.

Exercise sheet 1 To be corrected in tutorials in the week from 23/10/2017 to 27/10/2017

emacs Know your tools emacs keys Minimal number of key commands for emacs GNU Emacs is an extensible, customisable text editor-and more

Lab 1 1 Due Wed., 2 Sept. 2015

Using LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12)

Unix File System. Learning command-line navigation of the file system is essential for efficient system usage

Table Of Contents. 1. Zoo Information a. Logging in b. Transferring files 2. Unix Basics 3. Homework Commands

COP4530 Data Structures, Algorithms and Generic Programming Recitation 3 Date: January 20 & 22, 2009

Part I. Introduction to Linux

Phil Sung. Special thanks to Piaw Na and Arthur Gleckler

Introduction to Unix: Fundamental Commands

Using Ruby and irb in CSE 341 Winter 2015

Linux Systems Administration Getting Started with Linux

CSCE 212H, Spring 2008, Matthews Lab Assignment 1: Representation of Integers Assigned: January 17 Due: January 22

Transcription:

November 8, 2016 1 Introduction The laboratory exercises in this course are to be conducted in an environment that might not be familiar to many of you. It is based on open source software. We use an open source development environment of many reasons. For example, the tools are free for the students that which to use them from home, as well as for the university. Also, these tools are used by advanced programmers and developing teams all over the world, making them typically well documented and filled with advanced features, and there are blogs and tutorials freely available on the web. 1.1 Purpose The purpose of this exercise is to allow you to familiarize with the environment in which the other exercises are conduced. You will test some features that are useful for the exercises and other that may speed up the development work in the project. [Note: There is no examination of this exercise.] 2 Debian/Ubuntu The computers in the linux laboratory run a version of Ubuntu Linux called Kubuntu which belongs to the family of Debian distributions. Software on Debian-based systems are installed though deb packages. These packages contain binary executables, libraries and resources for the software, and a control file specifying dependencies. The packages typically reside on a repository so that the software installation system, called Advanced Packaging Tools or APT, can automatically install dependencies when necessary, as well as update software when a new version is available. 1

3 Bash Bash is the most common command-line environment for Linux systems, and a powerful environment for file browsing, searching, conversion and filtering, compilation, etc. It is not by itself a program with a user interface, but is the shell used in a terminal program, such as Konsole in KDE. To begin using Bash with Konsole, start Konsole in K / Programs / System / Konsole. Bash provides you with a prompt where you can execute commands. A list of common commands is provided below. Try out some of the commands, for example ls and pwd. Most commands take flags that allow you to control or modify the executed behaviour. Try, for example, ls -l and ls -F --color. 3.1 Manuals To find out what a program or command does or what flags you can use, you can either try it and try to dechiffer the result, or you can use the manual. Most command-line programs and commands come with a manual, called a man page, which is opened by using the command man with a program name or command as argument. Try for example man man or man ls. When reading a manual, your arrow keys navigate up and down. Use slash (/) so initialize a search, n to search for the next occurance and use q to quit. Since Bash is an advanced environment, reading its manual can be daunting. Take a look at man bash anyway, just to get a glimps of what you can do in the environment. 3.2 Paths and Files Changing directory is done using the cd command. If you want to change directory to a subfolder, do cd <subfolder>. Try it and do ls to see what contents that folder has. The current directory has the dot as shortcut, that is cd. will go to the current directory. This is not as useless as it may seem. The parent folder has shortcut dot-dot, that is cd.. will change directory to the parent. Of course, you do not have to go to a directory to list its contents, simply try ls <subfolder> instead. The Linux and UNIX operating systems have one directory tree, as opposed to some systems that expose one tree for each file system or drive. The root begins at / so if you want to change directory to the root of the directory tree you will write cd /. Other file systems or drives will be mounted into directories on the main directory tree, thereby creating subtrees. These subtrees will not look or behave any different from the main tree. For example, your home folder, which is on a network file system, will reside at the path /home/<liuid>, so to go there you may write cd /home/<liuid>. The home directory is not always located under /home/ so for convenience all user s home directory has a shortcut <liuid>/. When the liuid is ommited, your own is implicit, so try for example cd /. Task 1 Dechiffer long paths: (optional) Try to dechiffer the path /../../usr/local. What would it mean if your current working directory is your home? What if your current working directory is the root? 2

Command ls mv cp rm man pwd du grep find sort cut ssh scp Description List all files in a directory Rename and/or move files to a target directory Copy files to a target directory Remove files or directories Displays the manual page for a command Prints the path of the working directory Disk usage information Search for a string in files Search for files Sort input data or data in a file Pick out parts of input data Connect to another computer through a secure shell Copy file(s) from or to another computer through an encrypted connection For security reasons, not all files can be executed, only files that have the correct flags. If you write ls -l you will see the flags to the left in the list. These are written as rwxrwxrwx meaning readable/writable/executable for the user, for the user s group and for others, respectively. 4 The Build Environment The UNIX world, including Linux, has one of the most advanced, complete and free build environment for C and C++. It is mostly developed within the GNU project and consists of GNU Make, GNU C Compiler, GNU C++ Compiler, GNU Debugger, etc. 4.1 Compiling Code The GNU C/C++ compiler command is gcc, or g++ if all input files are known to be C++. For very simple examples, the compiler can be executed manually, for example using the following commandline, however it is more common to use a build system to handle the call to the compiler. g++ file.c -o file The compiler can be controlled through a long list of flags to provide different levels of optimization, warnings and debug options, among other things. You will experiment with some of these in this course. 4.2 Build Systems Make is a build system that automatically calls the compiler and linker when necessary and with the correct flags based on the current settings. These settings are read from a text file which per default is named Makefile. For example, to compile a simple program called test write make test. Make will then search for a source file which starts with test and compile it with the appropriate compiler. Make will use dependency rules to find out which files to compile, in which order or concurrently, and will use old object files if they are newer than the source from which they came. 3

For smaller projects the Makefile is typically written by hand. For more advanced projects some automatic tool is typically used for configuration, especially if the software is expected to be compiled on different platforms with different hardware and third-party libraries. There are several such automatic tools, some of which are: autoconf creates a complicated Makefile for a project. Very advanced and very complicated to set up as a developer, SCons is a build system like Make, but Python-based and extendible, CMake is an increasingly popular tool to create build settings for different platforms and compilers. 5 Editors There are many editors available and we have installed a small set of the most popular ones for development: Kate, Emacs and Eclipse. Observe that all professional grade editors for source code can be configured to follow code formatting standards, which is necessary for programmers on different platforms and systems to be able to collaborate. 5.1 Kate Kate, K Advanced Text Editor, is an advanced text editor with syntax highlighting for many programming languages and text formats. It is straightforward to use and supports the standard shortcuts. 5.2 Emacs Emacs is one of the most powerful editors in existance, with syntax highlighting and automatic indentation for the most common text-based file formats, such as C, C++, XML, SVG and LATEX. The editing features range from basic to extremely advanced, however since the user interface was designed long before the definition of todays defacto standards for copy, paste and save, most novice users experience a very steep learning curve. Learning the basics can be very rewarding since the continous learning of commands and tricks will make code writing and editing both fast and fun. Emacs automatically identifies the format based primarily on the file suffix, so to get correct highlighting and indentation, a unique and correct suffix must be used. Header files for C++ files are sometimes suffixed.h. This is an ambigous suffix, so the alternative suffixes are recommended such as.hh or.hpp. 5.2.1 Emacs Commands Here is a list of some of the most important commands used in Emacs. Other software sometimes accept the some of these commands, for example Bash. The table below uses a common notation for key combinations where C means Ctrl key and M means Meta key, which typically is the Alt key but can sometimes be the Win key or the Mac key. These are then combined with other keys so C-c C-w means first hold down Ctrl and press c then hold down Ctrl and press w. In Emacs nomenclature a file 4

is on disk and when you open it you can edit the data in a buffer, which can in turn be written back to the file. Also, what you copy or cut from your buffer are pushed to a stack called kill ring, which means that you can copy many things in succession and later paste all of those things in any order, or even mark an area to undo edits only in that area. Command C-g C-_ C-a C-e M-a M-a C-M-f C-M-b C-x C-c C-x C-f C-x C-s C-x C-w C-s C-r C-% C-<space> M-w C-w C-k C-y M-y M-z <char> M-x Description Cancel the current command or shortcut Undo last edit (in the selected region if selection is active) Go to beginning of line Go to end of line Go to beginning of sentence (or equiv. in code) Go to end of code line (or equiv. in code) Go forwards to matching parenthesis, bracket, curly bracket Go backwards to matching parenthesis, bracket, curly bracket Close Emacs Open file to buffer Save buffer to file Write to file (Save buffer as) Search forward Search backward Search and replace Set selection start Copy selection Cut selection Cut to end of line (kill) Paste last copy or cut (yank) Replace pasted data with next entry in the kill ring Cut to first occurance of <char> (zap) Open Emacs command prompt: for anything you don t have a shortcut for A longer, but still incomplete, list of commands can be found online, for example on the following address: http://home.uchicago.edu/gan/file/emacs.pdf Also, it is possible to remove, replace or add shortcuts to customize Emacs for your own purposes. It is, however, not recommended to change the default shortcuts but try instead to add functions to unused key combinations. 5.3 Eclipse Eclipse is not just an editor but an IDE, an Integrated Development Environment, available for many different platforms and supporting many different programming languages. The system has straightforward tutorials to help new users to get started and a large set of powerful development tools, such as integrated debugger and real-time static code analysis. 5

6 Other Software The laboratory computers are filled also with other free software, available for your convenience. You may, for example, need to draw images for CG textures, or figures for your reports and other documents, or write reports, etc. The first four applications in the list use standard formats that facilitates the move between platforms and software systems. The GIMP One of the most powerful photo editors available, with a large tool set and lots of plug-ins available online. Inkscape An easy to use, yet versatile vector image editor based on the SVG format. LibreOffice One of the most complete Office suites. This suite started as a fork of OpenOffice after their owner failed to fully open up the development process for the community. LaTeX An automatic typesetting system that takes simple text files with formatting tags to generate production grade documents. Kdenlive A non-linear video editing software. Scribus Layout and publishing software. 6