uarchsim 2012 basics of team development

30
uArchSim 2012 Basics of team development Pavel Kryukov 13.10.2012

Upload: judith-williamson

Post on 02-Jan-2016

35 views

Category:

Documents


0 download

DESCRIPTION

uArchSim 2012 Basics of team development. Pavel Kryukov 13.10.2012. Using E-mail. E-mail address. Good e-mail address is useful. It can be easily spelled verbally or by phone. If it is written, chance of mistake become less. Unreadable e-mail address may create unnecessary preconceptions. - PowerPoint PPT Presentation

TRANSCRIPT

MDSP 2011 Intro

uArchSim 2012Basics of team developmentPavel Kryukov13.10.2012

##Moscow Institute of Physics and Technology 1Using E-mail

#Moscow Institute of Physics and Technology E-mail addressGood e-mail address is useful. It can be easily spelled verbally or by phone. If it is written, chance of mistake become less.Unreadable e-mail address may create unnecessary preconceptions.You can always understand, who is sender or receiver of e-mail without lookups to address book.Its easy to set up mail redirection from your old address.frtk.ru doesnt support Google+ yet. Probably we will use it for hangouts.

#Moscow Institute of Physics and Technology E-mail basicsMake Reply All instead of Reply if it is necessary. Previous participants of conversations will be added to CC list, so they will be in the know.Do not use Reply All if you started to discuss something private. Others usually do not want to listen your conversation. In short, always look at To: and Cc: fields of your message.Never change topic on reply! Such letters are difficult for classification by people and mail clients.Do not create silly topics to message (e. g. hello or patch). Try to explain what is in the message, respect the recipient!If your message consist only of topic, add in the end of message. Recipient wont spend time on downloading message.

#Moscow Institute of Physics and Technology Common abbreviations(J)FYI (just) for your informationASAP as soon as possibleAFAIK as far as I knowIMHO in my humble opinionIIRC if I recall correctlyBTW by the wayEOM end of message (see previous slide)

#Moscow Institute of Physics and Technology Using Google-groupsGoogle group is, firstly, a special e-mail address. When you send a message on this address, it is received by all subscribers.You can view groups through web interface: https://groups.google.com/Always check presence/absence of Google-group e-mail address in To: field!Remember, we use only English language in our conversation.

#Moscow Institute of Physics and Technology Code Style

#Moscow Institute of Physics and Technology Why code style is so necessary?Everybody has (I hope) its own style of writing code. It can be extremely practical, but what happens when you work in team?

if (a == b) { if( a!=c) { if (c > 0) { x*=*y; } else { statement2; }} else{ statement3;}

To avoid horror like this, code style should be unified. We uses code style of MIPT-VIS project (http://code.google.com/p/mipt-vis/wiki/CodingStyle) for a long time and going to support this tradition. Please study it!

#Moscow Institute of Physics and Technology Version control system

#Moscow Institute of Physics and Technology SVNHow to synchronize work with your colleague? You may send modified files , but you will face difficulties on merges.The solution is to create one server with most relevant version. This server is called repositoryMembers can download copy of repository to own computer (working copy), this is called checkout.Members of team can send their changes to repository (commit) and download from it changes of other users (update).SVN has special interface if your changes conflict with changes of other people in team (merge-conflict).For traffic economy, SVN transmits only differences of files, called patches or diffsSVN repository saves all committed changes.

#Moscow Institute of Physics and Technology SVN work cycleCheckoutWork with local copyUpdateCommit

#Moscow Institute of Physics and Technology How to installOn Windows we recommend to install TortoiseSVNhttp://tortoisesvn.net/On Linux SVN is provided by main repositories, so you just need to run command like in Ubuntu:sudo apt-get install subversion

#Moscow Institute of Physics and Technology Main commandsCheckout is operation of initial download of sources from repository. Syntax is following: svn checkout --username Update is operation of downloading changes of repository version to already checkouted local copy. svn up [-r ]Commit is operation of uploading changes of local copy to repository svn commit -m

#Moscow Institute of Physics and Technology Patches You can create patch with commandsvn diff > my.patchor just look at it withsvn diff | vim svn diff | lessTo apply a patch, run commandpatch p0 < my.patchYou may revert patch using commandpatch p0 R < my.patch

#Moscow Institute of Physics and Technology Add and delete files If you add new file to local copy, SVN wont know about this file, e.g. on commit. You need to show this fact to SVN:svn add newfileThe same thing happens with deletion. If you delete some file with rm command, after next SVN update it will be restored. To delete file from repository, run commandsvn delete oldfileand on next your commit file will be deleted.

#Moscow Institute of Physics and Technology Your hometaskIn our repository weve got file members.txt. You need to add your name to this file.https://code.google.com/p/uarch-sim/wiki/HowToMakeYourFirstSVNCommit Step by step instructionhttps://code.google.com/p/uarch-sim/wiki/SVNCheatSheet Cheat sheet on main SVN commands. It may be necessary in future.

#Moscow Institute of Physics and Technology Separate build

#Moscow Institute of Physics and Technology Object filesC++ files can be separated in two types: headers (.h) and translated files (.cpp).Headers are not compiled. It is needed just to declare classes, methods and functions common for some .cpp files..cpp files are compiled independently. If your headers are correct, you may compile main.cpp to objective file main.o, after two hours functions.cpp and so on.Special part of compiler is linker. Linker can connect objective files to one executed file or library.This scheme is useful because if you got two projects with common .cpp files, you doesnt need to compile this files two times.

#Moscow Institute of Physics and Technology Example of project buildsgcc funcsim.cpp cgcc memory.cpp cgcc decoder.cpp cgcc perfsim.cpp cgcc funcsim.o memory.o decoder.o o funcsim.outgcc perfsim.o memory.o decoder.o o perfsim.out

#Moscow Institute of Physics and Technology Advanced example of project buildsgcc funcsim.cpp c O2 Wall std=c++03 Werrorgcc memory.cpp c O2 Wall std=c++03 Werrorgcc decoder.cpp c O2 Wall std=c++03 Werrorgcc perfsim.cpp c O2 Wall std=c++03 Werrorgcc funcsim.o memory.o decoder.o o funcsim.out -larchgcc perfsim.o memory.o decoder.o o perfsim.out larchIts too complicated for typing by hands, isnt it?Do we know what files should be rebuild?

#Moscow Institute of Physics and Technology Makefiles21

#Moscow Institute of Physics and Technology MakefilesMakefile is a file with rules of build (targets).Make command decides what files are not created yet or become obsolete and creates it according to rules in Makefile.

: -TAB-program: func.o main.ogcc func.o main.o o program

If dependency is not created or is obsolete, it is rebuild according to rules

#Moscow Institute of Physics and Technology Automatic variables$@ target name.$< first dependency name.$? all dependencies more relevant than target$+ all dependencies$^ all dependencies without repeats$? only changed dependencies

program: program.o main.ogcc $+ o $@

#Moscow Institute of Physics and Technology User variablesYou may create own variables with = operator, and get with $(name) operatorSRC_DIR=sourceC_FILES= $(SRC_DIR)/func.cpp $(SRC_DIR)/main.cppVariables can be set from console:make all DEBUG=1You may use directives:ifeq ($(DEBUG), 1) C_FLAGS = -O0 g DENABLE_TRACE=1elseC_FLAGS = -O3endif

#Moscow Institute of Physics and Technology Common-used variablesCC C compilerCFLAGS C compiler flagsLDFLAGS Linker flagsCXX C++ compilerCXXFLAGS C++ compiler flags

#Moscow Institute of Physics and Technology Substitutions and implicit targetsOBJS_FILES = ${C_FILES: $(SRC_DIR)/%.c=$(OBJ_DIR)/%.o} In OBJS_FILES we will get objective files that corresponds to c files. It makes easy to create targets using % symbol:$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c$(CC) $(CFLAGS) $< -c -o $@

#Moscow Institute of Physics and Technology Using of shellYou are free to use common shell commands, e.g. rm:clean:rm -rf $(OBJ_DIR) rm -rf $(BIN_DIR)$(shell uname -m) returns architecture of current PC (i686 or x86_64 )$(shell uname -o) returns OS name (GNU/Linux, Cygwin )

#Moscow Institute of Physics and Technology Example of MakefileCC := gccCFLAGS := -Wall

ifeq ($(DEBUG), 1)CFLAGS := $(CFLAGS) -O0 -gelseCFLAGS := $(CFLAGS) -O2endif

SRC_DIR := sourceBIN_DIR := binOBJ_DIR := obj

C_FILES := $(SRC_DIR)/func.c $(SRC_DIR)/main.cOBJS_FILES := ${C_FILES:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o}

$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c$(CC) $(CFLAGS) $< -c -o $@

$(BIN_DIR)/program: $(OBJS_FILES)$(CC) $(LDFLAGS) $^ -o $@

all: build_dirs $(BIN_DIR)/program

build_dirs:mkdir p $(BIN_DIR)mkdir p $(OBJ_DIR)

clean:rm -rf $(BIN_DIR)rm -rf $(OBJ_DIR)

#Moscow Institute of Physics and Technology 28Thank You29

#Moscow Institute of Physics and Technology

#Moscow Institute of Physics and Technology