libraries and tools for c++

64
FI MUNI 26.11. 2012 Juraj Michálek blog: http://georgik.sinusgear.com twitter: http://twitter.com/sinusgear Libraries and tools for C++

Upload: juraj-michalek

Post on 19-May-2015

1.515 views

Category:

Documents


3 download

DESCRIPTION

Slides from talk at FI MUNI 2012 - course C++ development. Libraries and continouous integration with Jenkins

TRANSCRIPT

Page 1: Libraries and tools for C++

FI MUNI 26.11. 2012

Juraj Michálekblog: http://georgik.sinusgear.comtwitter: http://twitter.com/sinusgear

Libraries and tools for C++

Page 2: Libraries and tools for C++

Something about me ;-)

Page 3: Libraries and tools for C++

Content

Node.js

V8, Node bindings

Gui

QT, FLTK, FLUID, wxWidgets

Special HW

Android NDK, Arduino

Patterns ACE

Tools

Page 4: Libraries and tools for C++

Clone examples

Available at GitHub:https://github.com/georgik/fimuni-c-cpp-examples

git clone git://github.com/georgik/fimuni-c-cpp-examples.git

Page 5: Libraries and tools for C++

http://nodejs.org/

Page 6: Libraries and tools for C++

Architecture of Node.js

Page 7: Libraries and tools for C++

V8

4x4 Ford V8 engine

Page 8: Libraries and tools for C++

V8

Google's open source JavaScript enginehttp://code.google.com/p/v8/

Page 9: Libraries and tools for C++

V8 in context of Chrome

Page 10: Libraries and tools for C++

GYP

http://code.google.com/p/gyp/

Page 11: Libraries and tools for C++

GYP example

Page 12: Libraries and tools for C++

libuv – event loop

Call callbacks Sleep

Page 13: Libraries and tools for C++

Sample server in JS

Page 14: Libraries and tools for C++

Node.js wraps

Page 15: Libraries and tools for C++

Knižnica

ClanLib game Simple Development Kit

http://www.clanlib.org

Page 16: Libraries and tools for C++

Knižnica

Mesa

http://mesa3d.sourceforge.net

Page 17: Libraries and tools for C++

Dino

Page 18: Libraries and tools for C++

GUI

Graphic User Interface

Page 19: Libraries and tools for C++

Vhodné knižnice

QT

FLTK

wxWidgets

Page 20: Libraries and tools for C++

QT

Nokia:http://qt.nokia.com

Page 21: Libraries and tools for C++

QT

produkt firmy Trolltech, neskôr Nokia

licencie: open source aj komrčné

knižnica vznikla v roku 1996

podporuje C++ a Javu

Page 22: Libraries and tools for C++

Platformy

MS/Windows

Unix/X11 - Linux, Sun Solaris, HP-UX, Compaq Tru64 UNIX, IBM AIX, IRIX, Mac OS X

Embedded - Linux platforms with framebuffer support.

Page 23: Libraries and tools for C++

QT Creator IDE

nástroj na tvorbu GUI

rozvrhnutú plochu ukladá do XML súboru

z XML definície sa generuje kód programu

Page 24: Libraries and tools for C++

Kompilácia

uloženie projektu

vytvorenie Makefile z projektu

qmake -o Makefile test.pro

kompilácia

make

Page 25: Libraries and tools for C++

Linguist

nástroj na preklad aplikácii

umožňuje oddeliť kód od textov

prekladateľ a programátor pracujú samostatne

Page 26: Libraries and tools for C++

Amélia

Page 27: Libraries and tools for C++

KDE

Page 28: Libraries and tools for C++

FLTK

http://www.fltk.org

Page 29: Libraries and tools for C++

Knižnica FLTK

The Fast Light Tool Kit

Autor: Bill Spitzak

venoval sa vývoju rozhraní pre Sun Microsystems

veľa myšlienok zjednodušil a vložil do kitu

nízko-úrovňová kompatibilita - 10% odlišnosti

Page 30: Libraries and tools for C++

Platformy

Unix, Linux

Microsoft Windows

MacOS

s podporou OpenGL a GLUT

Page 31: Libraries and tools for C++

FLUID

Fast Light User-Interface Designer

jednoduchý designer na tvorbu GUI

Page 32: Libraries and tools for C++

wxWidget

http://www.wxwidgets.org/

Page 33: Libraries and tools for C++

wxGlade

Page 34: Libraries and tools for C++

Android – Native Development Kit

http://developer.android.com/sdk/ndk/

Pozor!

App nemusí byť optimálnejšia než napísaná v Jave

Page 35: Libraries and tools for C++

NDK

stiahnuť SDK a NDK

export PATH=$PATH:/cesta/sdk/tools:/ceta/ndk

cd /cesta/ndk/samples/hello-jni

android update project -p . -s

ndk-build

ant debug

Page 36: Libraries and tools for C++

Adobe Alchemy

zaujímavý experiment

C/C++ kód skompilovaný pre FlashPlayer

AVM2

prenositeľnosť

príklad: Doom

http://labs.adobe.com

Page 37: Libraries and tools for C++

Arduino

http://www.arduino.cc/playground/Interfacing/CPPWindows

Page 38: Libraries and tools for C++

ACE

The ADAPTIVE Communication Environment

http://www.cs.wustl.edu/~schmidt/ACE.html

Open source C++ framework

reactor, proactor

acceptor, connector

Page 39: Libraries and tools for C++

Java Native Interface - JNI

public class HelloWorld { private native void sayHello(); public static void main(String[] args) { System.loadLibrary("library"); new HelloWorld().sayHello(); }}

Page 40: Libraries and tools for C++

http://www.boost.org

“...one of the most highly regarded and expertly designed C++ library projects in the world.”

Herb Sutter and Andrei Alexandrescu

Page 41: Libraries and tools for C++

Boost

Page 42: Libraries and tools for C++

Boost Test Library

Test everything that could possibly break

jednoduchá tvorba tescasov

TestSuite – TestCase

test je spustiteľný program

bjam integruje spúšťanie testov

Page 43: Libraries and tools for C++

TestCase

using namespace boost::unit_test_framework;

/** * Test basic marshaller functionality */void testServerQuery(){ ServerQuery query = ServerQuery();

query.session = "112"; query.userId = "janko";

BOOST_CHECK_EQUAL( query.sessionAsChar(), "112" ); BOOST_CHECK_EQUAL( query.userIdAsChar(), "janko" );}

Page 44: Libraries and tools for C++

Jam

náhrada Makefile

rozšíriteľné fukncie

automatická detekcia header files

prenositeľné: Unix, Windows, VMS, Mac

malý CPU overhead

build obrovských projektov

škálovateľné

Page 45: Libraries and tools for C++

jam + TestCase

Jamfile (Jamroot)

import testing ;

run tests/testServerQuery.cpp server ;

Shell

$ bjam

...patience...

...found 2 targets...

...updating 2 targets...

*** test passed ***

Page 46: Libraries and tools for C++

Valgrind

debugging a profiling

memcheck

helgrind - race condition, thread profiling

Page 47: Libraries and tools for C++

Modes debugger

Local application

Attach to local process

Attach to remote process

Post-mortem

Page 48: Libraries and tools for C++

Application crashed

Post-mortem analysis

Image from memory: coredump

Page 49: Libraries and tools for C++

Quick analysis of coredump

Page 50: Libraries and tools for C++

Strace

Page 51: Libraries and tools for C++

Mutextrace

mutextrace ./mutex-tester-app param1 param2

lock #1, free -> thread 1

init #2

lock #2, free -> thread 1

unlock #1

lock #1, free -> thread 1

init #3

lock #3, free -> thread 1

unlock #1

Page 52: Libraries and tools for C++

Maven pre C++

web: http://maven.apache.org

mvn [parametre|ciele]

súbor s definíciou projekt

pom.xml

plugin pre C++

native-maven-plugin

Page 53: Libraries and tools for C++

Kontinuálna integrácia

rýchla kontrola po commite

Jenkins CI – príklad:

http://ci.sinusgear.com

Page 54: Libraries and tools for C++

GIT

oproti SVN možnosť lokálných commitov

Social Coding

http://www.github.com

Page 55: Libraries and tools for C++

Source Control & Project Management

http://trac.edgewall.org

http://trac-hacks.org/

Page 56: Libraries and tools for C++

GNU a Windows

Minimalist GNU For Windows

http://www.mingw.org

Cygwin

http://www.cygwin.com

http://cygwinports.dotsrc.org/

Page 57: Libraries and tools for C++

Python

silný objektovo orientovaný jazyk

platformovo nezávislý

integrovateľný s C a C++

http://www.python.org

http://www.py.cz

Page 58: Libraries and tools for C++

Twisted

udalosťami riadený sieťový framework

podpora TCP, UDP, SSL/TLS, multicast

Unix sockets

veľké množstvo protokolov

HTTP, NNTP, IMAP, SSH, IRC, FTP...

http://twistedmatrix.com/trac/

Page 59: Libraries and tools for C++

Project

GitHub

http://www.github.com

Google Code

http://code.google.com/opensource

SourceForge

http://sourceforge.net

FreeCode

http://freecode.com

CodePlex – MS Platforma

http://codeplex.com

Page 60: Libraries and tools for C++

Atomic Tanks as open source

Open source it.Somebody can continue in your work

http://atanks.sf.net

Page 61: Libraries and tools for C++

Ohloh

Compare open source projectshttp://www.ohloh.net

Page 62: Libraries and tools for C++

se-radio.net

http://www.se-radio.net

Page 63: Libraries and tools for C++

A je tu záver

Otázky?

Page 64: Libraries and tools for C++

FI MUNI, Brno 2012Juraj Michálek

blog: http://georgik.sinusgear.comtwitter: http://twitter.com/sinusgear

EOF