1 / 24

T UTORIAL L ESSON Tools

Institute of Parallel and Distributed System (iPads) Shanghai Jiao Tong University Rong Chen rongchen @ sjtu.edu.cn. T UTORIAL L ESSON Tools. OUTLINE. Pre-requisite SVN Toolchain. Pre-requisite SVN Toolchain. VERSION CONTROL. APT ( A dvanced P ackage T ools)

conor
Télécharger la présentation

T UTORIAL L ESSON Tools

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Institute of Parallel and Distributed System (iPads) Shanghai Jiao Tong University Rong Chen rongchen@sjtu.edu.cn TUTORIAL LESSONTools

  2. OUTLINE Pre-requisite SVN Toolchain Parallel Processing Institute, Fudan University

  3. Pre-requisite SVN Toolchain Parallel Processing Institute, Fudan University

  4. VERSION CONTROL • APT(Advanced Package Tools) • A management system for software packages • Package resource list for APT: • /etc/apt/sources.list $ cat /etc/apt/source.list ... deb http://ftp.sjtu.edu.cn/debian/ squeeze main dbe-src http://ftp.sjtu.edu.cn/debian/ squeeze main type URI of source dist comp URI type: http, ftp, cdrom, file, ssh ... Institute of Parallel and Distributed System (iPads), SJTU

  5. VERSION CONTROL • APT(Advanced Package Tools) • apt-get: command-line tool • update e.g. >apt-get update • install e.g. >apt-get install htop • remove e.g. >apt-get remove htop • upgrade e.g. >apt-get upgrade htop • apt-cache: cache manipulator • search e.g. >apt-cache search htop • showpkge.g. >apt-cache showpkghtop Institute of Parallel and Distributed System (iPads), SJTU

  6. VERSION CONTROL • APT(Advanced Package Tools) • example: install vim • >su root user • >apt-get update update apt list • >apt-cache search vim search in cache • >apt-get install vim install vim • >man vim manual of vim $ apt-cache search vim ... vim – Vi IMproved – enhanced vi editor vim-doc - Vi IMproved – HTML documentation ... Institute of Parallel and Distributed System (iPads), SJTU

  7. Pre-requisite SVN Toolchain Parallel Processing Institute, Fudan University

  8. VERSION CONTROL • SVN(SubVersioN) • Maintain current and historical versions of files SVN SVN SVN 1 1 2 2 1 1 1 1 1 2 2 2 2 2 2 Parallel Processing Institute, Fudan University

  9. VERSION CONTROL • SVN(SubVersioN) • Install on Debian • Update e.g. >apt-get update • Search e.g. >apt-cache search svn • Install e.g. >apt-get install subversion • Uninstall e.g. >apt-get remove subversion Parallel Processing Institute, Fudan University

  10. VERSION CONTROL • SVN(SubVersioN) • Client Command • checkoute.g. >svn co svn://10.132.143.1/truck truck --username=rong • update e.g. >svn update • commit e.g. >svn ci a.c –message=“..” • add file e.g. >svn add b.c >svn ci b.c –message=“..” • del file e.g. >svn del b.c >svn ci b.c –message=“..” Parallel Processing Institute, Fudan University

  11. VERSION CONTROL • SVN(SubVersioN) • Client Command • show status e.g. >svn status –q • diff file e.g. >svn diff b.txt • resolve conflict e.g. >vi a.c //manually remove conflict >svn resolved a.c *svn resource link: http://subversion.tigris.org/ Parallel Processing Institute, Fudan University

  12. Pre-requisite SVN Toolchain • C Language Compiling, Gcc Make

  13. To C or Not to C • Why we choose C ? “ The limits of my language are the limits of my world ”Tranctatus Logico-Philosophicus5.6 1918 • Our Requirements • Realize Computer • More Control Program • Implement not Large but Practical Software • Good Support in Multi-fields Best Choice Java Script Lisp Assembler C Shell Parallel Processing Institute, Fudan University

  14. HISTORY • Birth of C Language • Thompson & Ritchie, 1969 ~ 1971 • Based on B language (BCPL, Basic Common Programming language) • Rewrite Unix in C, 1973 • ANSI (American National Standards Institute) • C89 and C99 • BOOK: The C Programming Language http://www.china-pub.com/computers/common/info.asp?id=14975 Parallel Processing Institute, Fudan University

  15. Pre-requisite SVN Toolchain C Language • Compiling, Gcc Make

  16. GNU • What is GNU ? • GNU is Not Unix, 1983 • Richard M. Stallman (culture legend) • Goal: absolutely FREE operating system • The GNU Manifesto, 1985 • Free Software Foundation (FSF) • Emacs, GCC, tar, … • GPL, General Public License • Virus infectivity Parallel Processing Institute, Fudan University

  17. COMPILER • GNU Compiler Collection • Preprocessor, Assembler, Linker, Loader, … • Support : C, C++, Java, Fortran, Ada, … • Install on Debian e.g. >apt-get remove build-essential Parallel Processing Institute, Fudan University

  18. COMPILING Source Codes[*.c] C Program Preprocessor C ProgramCompiler Source Codes[*.c, *.h] E S Assembly Codes[*.s] GNU Compiler Collection Binary Codes[*.out] c o Binary Codes[*.o] Linker/Loader Assembler Parallel Processing Institute, Fudan University

  19. COMPILING • C Files Compilation Example • C Files: test.h test.c • e.g. >gcc -E test.c > test-pp.c(test-pp.c) >gcc -S test.c(test.s) >gcc -c test.c(test.o) >gcc-o test test.c(test) Parallel Processing Institute, Fudan University

  20. Pre-requisite SVN Toolchain C Language Compiling, Gcc • Make

  21. MAKE • Make • Automatically building executable programs and libraries from source codeaccording to files called “Makefile” • GNU make • BOOK: ”Managing Projects with GNU Make” http://www.china-pub.com/computers/common/info.asp?id=25525 Parallel Processing Institute, Fudan University

  22. Tips: disadvantage of make • tab and whitespace are different MAKEFILE • “Makefile” • Specify how to derive the target program from each of its dependencies • Context • The relationship among source files • The command used to compile source files • Tools for auto building Makefile • makedepend, Imake, autoconf, automake Parallel Processing Institute, Fudan University

  23. CC := gcc OPT := -O3 CFLAGS := -Wall -I. $(OPT) BINS := gen_log gen_sort all: $(BINS) %.o: %.c $(CC) -c -o $@ $^ $(CFLAGS) clean: rm $(BINS) Makefile EXAMPLE >ls gen_log.c gen_sort.c >make gcc –Wall -I. -O3 gen_log.c -o gen_log gcc –Wall -I. -O3 gen_sort.c -o gen_sort >make clean rm gen_log gen_sort >make gen_sort • gcc –Wall -I. -O3 gen_sort.c -o gen_sort Parallel Processing Institute, Fudan University

  24. Thanks Parallel Processing Institute, Fudan University

More Related