ECE 3574: Applied Software Design

Total Page:16

File Type:pdf, Size:1020Kb

ECE 3574: Applied Software Design ECE 3574: Applied Software Design Meeting 08: Building Cross-Platform Software using CMake The goal of today’s meeting it to learn about building larger software projects that have multiple modules of code, unit tests, and main programs. I Why CMake? I Running CMake: GUI and command-line I Writing a basic CMakeLists.txt configuration file I Exercise I Milestone 1 Software Configuration and Build tools You should be able to build all dependencies and the code itself, in debug and release mode, for all platforms supported in a single step. This can be done by a variety of means, including customs scripts and IDE tooling. We will be using a popular open source tool for this called cmake. Why CMake? What problem does it solve? I Once a project gets to a certain size, compilation and linking, setting compiler flags, etc becomes complicated See example: manual builds -> build scripts -> makefiles and limitations I This is especially true for cross-platform projects. It is a pain to maintain build configuration for each platform (VS .sln, XCode .xcodeproject, makefiles, . ) I CMake is a build generator, it writes the files needed for the specific IDE or build tool. We will use this, warts and all. There are many other tools for bulding C++ code, e.g. MSBuild, scons, Bazel, Buck, premake. Running CMake I Using the GUI I Using the command line See demo. Basic CMakeLists.txt Syntax cmake_minimum_required(VERSION 3.5) project(YOURPROJECTNAME CXX) add_executable(exename1 file1.h file2.cpp ... ) add_executable(exename2 file3.h file4.cpp ... ) enable_testing() add_test(test_name exename arguments) See demo More advanced CMake CMake is a very flexible tool. Some examples I perform different configurations based on platform I write source files at configure time I run external scripts and programs for memory checking, coverage analysis, documentation generation, etc. The CMakeLists.txt file in the starter code demonstrates many of these. Exercise 08 See the website. Next Actions I Read the Overview of Qt I Install Qt on your host system (see the website).
Recommended publications
  • Free Software for the Modelling and Simulation of a Mini-UAV an Analysis
    Mathematics and Computers in Science and Industry Free Software for the Modelling and Simulation of a mini-UAV An Analysis Tomáš Vogeltanz, Roman Jašek Department of Informatics and Artificial Intelligence Tomas Bata University in Zlín, Faculty of Applied Informatics nám. T.G. Masaryka 5555, 760 01 Zlín, CZECH REPUBLIC [email protected], [email protected] Abstract—This paper presents an analysis of free software Current standards for handling qualities apply to only which can be used for the modelling and simulation of a mini- piloted aircraft and there are no specific standards for UAV UAV (Unmanned Aerial Vehicle). Every UAV design, handling qualities. Relevant article discussing dynamic stability construction, implementation and test is unique and presents and handling qualities for small UAVs is [4]. [2] different challenges to engineers. Modelling and simulation software can decrease the time and costs needed to development Any UAV system depends on its mission and range, of any UAV. First part of paper is about general information of however, most UAV systems include: airframe and propulsion the UAV. The fundamentals of airplane flight mechanics are systems, control systems and sensors to fly the UAV, sensors mentioned. The following section briefly describes the modelling to collect information, launch and recovery systems, data links and simulation of the UAV and a flight dynamics model. The to get collected information from the UAV and send main section summarizes free software for the modelling and commands to it, and a ground control station. [3] [5] simulation of the UAV. There is described the following software: Digital Datcom, JSBSim, FlightGear, and OpenEaagles.
    [Show full text]
  • Soloud Audio Engine
    SoLoud Audio Engine Jari Komppa May 21, 2014 Contents 1 Introduction 2 1.1 How Easy? ..................................... 2 1.2 How Free? ..................................... 2 1.3 How Powerful? ................................... 3 1.4 There’s a Catch, Right? .............................. 3 2 Legal 4 2.1 SoLoud Proper ................................... 4 2.2 OGG Support ................................... 4 2.3 Speech Synthesizer ................................ 4 2.4 Fast Fourier Transform (FFT) ........................... 5 2.5 Sfxr ........................................ 5 2.6 Libmodplug .................................... 6 3 Quick Start 7 3.1 Download SoLoud ................................. 7 3.2 Add files to your project ............................. 7 3.3 Include files .................................... 7 3.4 Variables ..................................... 7 3.5 Initialize SoLoud .................................. 7 3.6 Set up sound sources ............................... 8 3.7 Play sounds .................................... 8 3.8 Take control of the sound ............................. 8 3.9 Cleanup ...................................... 8 3.10 Enjoy ....................................... 8 4 Premake 9 5 Concepts 10 5.1 Back end ..................................... 10 5.2 Channel ...................................... 10 5.3 Stream ...................................... 10 5.4 Clipping ...................................... 10 5.5 Sample ...................................... 11 5.6 Sample Rate ...................................
    [Show full text]
  • C++ 工程实践经验谈 陈硕 ([email protected])
    1 C++ 工程实践经验谈 陈硕 ([email protected]) 最后更新 2012-4-20 版权声明 本作品采用“Creative Commons 署名 -非商业性使用 -禁止演绎 3.0 Unported 许可 协议 (cc by-nc-nd)”进行许可。http://creativecommons.org/licenses/by-nc-nd/3.0/ 内容一览 1 慎用匿名 namespace ............................... 3 2 不要重载全局 ::operator new() ........................ 7 3 采用有利于版本管理的代码格式 ......................... 14 4 二进制兼容性 ................................... 24 5 避免使用虚函数作为库的接口 .......................... 29 6 动态库的接口的推荐做法 ............................. 37 7 以 boost::function 和 boost:bind 取代虚函数 ................. 41 8 带符号整数的除法与余数 ............................. 48 9 用异或来交换变量是错误的 ........................... 56 10 在单元测试中 mock 系统调用 .......................... 63 11 iostream 的用途与局限 .............................. 68 12 值语义与数据抽象 ................................. 97 13 再探 std::string .................................. 115 14 用 STL algorithm 秒杀几道算法面试题 ..................... 123 15 C++ 编译链接模型精要 .............................. 132 16 Zero overhead 原则 ................................ 170 C++ 工程实践经验谈 by 陈硕 www.chenshuo.com 2 说明 这是我的博客上关于 C++ 的文章的合集。最新版可从陈硕博客的置顶文章中下 载,地址见本页右下角。本系列文章适用于 Linux 操作系统,x86/amd64 硬件平台, g++ 4.x 编译器,服务端开发。 http://blog.csdn.net/Solstice/archive/2011/02/24/6206154.aspx C++ 工程实践经验谈 by 陈硕 www.chenshuo.com 1 慎用匿名 namespace 3 1 慎用匿名 namespace 匿名 namespace (anonymous namespace 或称 unnamed namespace) 是 C++ 语 言的一项非常有用的功能,其主要目的是让该 namespace 中的成员(变量或函 数)具有独一无二的全局名称,避免名字碰撞 (name collisions)。一般在编写 .cpp 文件时,如果需要写一些小的 helper 函数,我们常常会放到匿名 namespace 里。 muduo 0.1.7 中的 muduo/base/Date.cc 和 muduo/base/Thread.cc 等处就用到了匿名 namespace。 我最近在工作中遇到并重新思考了这一问题,发现匿名 namespace 并不是多多 益善。 1.1 C 语言的 static 关键字的两种用法 C 语言的 static 关键字有两种用途: 1. 用于函数内部修饰变量,即函数内的静态变量。这种变量的生存期长于该函数, 使得函数具有一定的“状态”。使用静态变量的函数一般是不可重入的,也不是 线程安全的,比如 strtok(3)。 2. 用在文件级别(函数体之外),修饰变量或函数,表示该变量或函数只在本文件 可见,其他文件看不到也访问不到该变量或函数。专业的说法叫“具有 internal linkage”(简言之:不暴露给别的 translation unit)。 C 语言的这两种用法很明确,一般也不容易混淆。 1.2 C++ 语言的 static 关键字的四种用法 由于 C++ 引入了 class,在保持与 C 语言兼容的同时,static 关键字又有了两种 新用法: 3.
    [Show full text]
  • Bullet Physics Simulation: Opencl GPU Acceleration of Rigid Body
    Bullet Physics Simulation OpenCL GPU Acceleration of rigid body dynamics and collision detection Erwin Coumans Google Inc. Bullet Physics Example Browser ExampleBrowser --enable_experimental_opencl github.com/bulletphysics/bullet3 Premake GNU Make Windows OpenCL Devices Mac OSX OpenCL Devices OpenCL, SPIR-V, Vulkan Host and Device Host Device (GPU) CPU L2 cache PCI Global Host Express BUS Memory Global Device Memory GPU in a Nutshell Private Memory (registers) Shared Local Memory Compute Unit Shared Local Memory Shared Local Memory Global Device Memory Refactor or Rewrite from Scratch Physics API suitable Sequential to for GPU? Callbacks, Parallel Algorithms Extensibility etc. Array of Structures C++ virtuals, to templates to C99 Structure of Arrays Rigid Body Simulation Loop Refactor: GPU as Co-Processor pointers to indices AABBs & Transforms Constraint Rows Overlapping Pairs Forces, Accelerations CUDA GPU Pair Constraint Detection Solver 1st Rewrite: GPU Rigid Body Pipeline (~2008) Detect Compute Setup Solve Contact contact Contact constraint pairs points constraints s C 0 1 2 3 2 3 F C E B D 5 7 D B 1 4 A 8 10 11 A A B C D 1 1 3 3 12 13 14 15 4 2 2 4 CPU batch and GPU solve Uniform grid Spherical Voxelization (Slow PCI BUS dispatch) Parallel Primitives: Radix Sort, Prefix Scan GPUs love Fine Grain Parallelism Reordering Constraints C 2 3 B D 1 4 A A B C D A B C D 1 1 Batch 0 1 1 3 3 2 2 3 3 Batch 1 4 2 2 4 4 4 CPU sequential batch creation while( nIdxSrc ) { nIdxDst = 0; int nCurrentBatch = 0; for(int i=0; i<N_FLG/32; i++) flg[i] =
    [Show full text]
  • Autotools: an Overview
    Autotools: An Overview Autotools: An Overview Danny Robson 2014-09-24 2014-09-24 Autotools: An Overview Danny Robson Overview Autotools autoconf Autotools: An Overview automake pkg-config Final Words Danny Robson 2014-09-24 Autotools: An Overview About Me Performance systems programming About Me C, C++ Linux GNU autotools Self-taught. Slowly. caveat emptor About Me Ask lots of questions 2014-09-24 Autotools: An Overview Danny Robson Overview Performance systems programming Autotools C, C++ autoconf Linux automake GNU pkg-config autotools Final Words Self-taught. Slowly. caveat emptor Ask lots of questions Autotools: An Overview About Me Performance systems programming About Me C, C++ Linux GNU autotools Self-taught. Slowly. caveat emptor About Me Ask lots of questions 2014-09-24 Autotools: An Overview Danny Robson Overview Performance systems programming Autotools C, C++ autoconf Linux automake GNU pkg-config autotools Final Words Self-taught. Slowly. caveat emptor Ask lots of questions Autotools: An Overview About Me Performance systems programming About Me C, C++ Linux GNU autotools Self-taught. Slowly. caveat emptor About Me Ask lots of questions 2014-09-24 Autotools: An Overview Danny Robson Overview Performance systems programming Autotools C, C++ autoconf Linux automake GNU pkg-config autotools Final Words Self-taught. Slowly. caveat emptor Ask lots of questions Autotools: An Overview What You're In For 1 Overview What You're In For 2 Autotools 3 autoconf What You're In For 4 automake 5 pkg-config 2014-09-24 6 Final Words Autotools:
    [Show full text]
  • Pybullet Quickstart Guide
    setPhysicsEngineParameter 31 PyBullet resetSimulation 32 Quickstart Guide startStateLogging/stopStateLogging 33 Synthetic Camera Rendering 35 Erwin Coumans, Yunfei Bai, 2017/2018 ​ ​ ​ computeViewMatrix 35 Visit the forums. ​ ​ computeProjectionMatrix 36 Introduction 2 getCameraImage 36 Hello PyBullet World 3 getVisualShapeData 38 connect, disconnect 3 changeVisualShape, loadTexture 39 setGravity 6 Collision Detection Queries 39 loadURDF, loadSDF, loadMJCF 7 getOverlappingObjects, getAABB 40 saveWorld 9 getContactPoints, getClosestPoints 41 saveState, saveBullet, restoreState 9 rayTest, rayTestBatch 42 createCollisionShape/VisualShape 10 getCollisionShapeData 43 createMultiBody 12 stepSimulation 13 Inverse Dynamics, Kinematics 44 setRealTimeSimulation 14 calculateInverseDynamics 44 getBasePositionAndOrientation 14 calculateJacobian, MassMatrix 44 resetBasePositionAndOrientation 15 calculateInverseKinematics 46 Transforms: Position and Orientation 15 Reinforcement Learning Gym Envs 47 getAPIVersion 17 Environments and Data 47 Controlling a robot 17 Train and Enjoy: DQN, PPO, ES 50 Base, Joints, Links 17 Virtual Reality 53 getNumJoints, getJointInfo 18 getVREvents,setVRCameraState 53 setJointMotorControl2/Array 19 getJointState(s), resetJointState 21 Debug GUI, Lines, Text, Parameters 55 enableJointForceTorqueSensor 22 addUserDebugLine, Text 55 getLinkState 23 addUserDebugParameter 56 getBaseVelocity, resetBaseVelocity 25 setDebugObjectColor 57 applyExternalForce/Torque 25 configureDebugVisualizer 58 getNumBodies, getBodyInfo, get/resetDebugVisualizerCamera
    [Show full text]
  • Towards Left Duff S Mdbg Holt Winters Gai Incl Tax Drupal Fapi Icici
    jimportneoneo_clienterrorentitynotfoundrelatedtonoeneo_j_sdn neo_j_traversalcyperneo_jclientpy_neo_neo_jneo_jphpgraphesrelsjshelltraverserwritebatchtransactioneventhandlerbatchinsertereverymangraphenedbgraphdatabaseserviceneo_j_communityjconfigurationjserverstartnodenotintransactionexceptionrest_graphdbneographytransactionfailureexceptionrelationshipentityneo_j_ogmsdnwrappingneoserverbootstrappergraphrepositoryneo_j_graphdbnodeentityembeddedgraphdatabaseneo_jtemplate neo_j_spatialcypher_neo_jneo_j_cyphercypher_querynoe_jcypherneo_jrestclientpy_neoallshortestpathscypher_querieslinkuriousneoclipseexecutionresultbatch_importerwebadmingraphdatabasetimetreegraphawarerelatedtoviacypherqueryrecorelationshiptypespringrestgraphdatabaseflockdbneomodelneo_j_rbshortpathpersistable withindistancegraphdbneo_jneo_j_webadminmiddle_ground_betweenanormcypher materialised handaling hinted finds_nothingbulbsbulbflowrexprorexster cayleygremlintitandborient_dbaurelius tinkerpoptitan_cassandratitan_graph_dbtitan_graphorientdbtitan rexter enough_ram arangotinkerpop_gremlinpyorientlinkset arangodb_graphfoxxodocumentarangodborientjssails_orientdborientgraphexectedbaasbox spark_javarddrddsunpersist asigned aql fetchplanoriento bsonobjectpyspark_rddrddmatrixfactorizationmodelresultiterablemlibpushdownlineage transforamtionspark_rddpairrddreducebykeymappartitionstakeorderedrowmatrixpair_rddblockmanagerlinearregressionwithsgddstreamsencouter fieldtypes spark_dataframejavarddgroupbykeyorg_apache_spark_rddlabeledpointdatabricksaggregatebykeyjavasparkcontextsaveastextfilejavapairdstreamcombinebykeysparkcontext_textfilejavadstreammappartitionswithindexupdatestatebykeyreducebykeyandwindowrepartitioning
    [Show full text]
  • Don't Starve Infinite Tools Mod Download Подпишитесь, Чтобы Загрузить Infinite Things [Rog-Sw-Ham] 5.0
    don't starve infinite tools mod download Подпишитесь, чтобы загрузить Infinite things [RoG-Sw-Ham] 5.0. Infinite Things can be used to make the game casual easy or a true nightmare as the values can be boosted, infinitized or reduced. Vanilla, RoG, SW & Hamlet compatible. Edit durability of craftable items or keep default. Options are: 25,50,75, default,200,300,400,500,750,1000% durability or INFINITE. Features Change durability of every item. Increase torch radius. Boost the gold axe and gold pickaxe damage and action(X2) Change boomerang speed. Change icebox efficiency. Hidden % on infinite items. If you have weapon at 200% and gold items at 200% then your goldsword has 400% more durability. This is an existing mod that I have customized and upgraded to my liking. Source mod: "Tweak those tools, Tweaked" by phixius83 and DMCartz Some code from "at last infinite tools is uptaded" by Turetu. Each item in the config option below has his own independant setting. Config options : Bats Spears Swords Boomerang Boomerang speed Body armors Hat armors Cloths Hats Primary tools Survival tools Umbrellas Staffs Amulets Books Sewingkit Compass Traps Heatrock Firepits Portable lights Torch Torch radius Bedrolls Shelters Icebox Gold items bonus only Obsidian items bonus only Boats Sails Boat items Boat reapirkit Blowdart uses Walls. Don't starve infinite tools mod download. This is a fork from the source code for the 'Don't Starve Mod Tools' available on Steam Workshop. It is a port from the original mod tools for Linux and Mac. In also improves on the original animation (i.e., SCML) compiler in mod tools primarily.
    [Show full text]
  • Fabien Niñoles 2016-01-06
    Fabien Niñoles 2016-01-06 Fabien Niñoles http://www.alteranode.com Montreal (Quebec), Electronics/Computers Developer phone: (514) 667-0831 Email: [email protected] Studies - Electrical Engineering (1994 - 1998), University of Sherbrooke. - DESS in Computer Engineering (2002 - ...), École Polytechnique de Montréal. - Natural Science (1992 - 1994), College Ahuntsic. Knowledges Programming Language Known: Notions: Bash, C/C++, C#, Java, Python, SQL, XML/XSL. CX, Javascript, PHP, Librairies Known: Notions: ANSI-C, Boost, curl, JSON.Net, libavcodec (FFMPEG), DirectX 11, GNOME/GTK+/Glade, Java JNI, Thrift, MainConcept Codecs SDK, MFC/ATL/COM/Win32, Windows Media Center, Windows Scripting, Windows Mxflib, NVEncode, Protobuf, STL, Windows .NET, Communication Foundation. WPF, ZeroMQ. Programming Environment Known: Notions: Amazon Web Services, Sony PS3/PS4, Unix (Debian Android SDK, Google Native Client, iOS, Mac OS/X, GNU/Linux, Ubuntu et CentOS), Windows 2000/XP/7, Windows Servers 2008/2012, Xbox 360/Xbox One. Software Known: Notions: Apache, CMake, CodeCollaborator, Docker, Emacs/ Ant/Nant, Apple XCode, Autotools, Confluence, C- Vi, GCC/GDB/make, Git, Jira, LibreOffice, Mercurial/ Sharp Develop, Dia, Glade, Gimp, Eclipse, Hudson/ mq, MS Office, MS Visual Studio, NSIS, Perforce, Jenkins, Premake, Reviewboard, TeamCity, Xen. Languages French: fluent Spanish: basic notions English: functional Russian: basic notions Japanese: basic notions Projects and Realisations - Debian GNU/Linux Project (From Autumn 1997); Volunteer Maintainer. - Alternative-Linux and Linux-Québec (1999); Conferences about Debian and Linux. - GULUS (Autumn 1998); Founder and President. - Folle Course informatique, 3rd Edition (1997); Organisation. - Folle Course informatique, 2nd Edition (1996); 1st position. - Folle Course informatique, 1st Edition (1995); 2nd position. Hobbies - Arts (reading, poetry, music, danse, role playing game and boardgames).
    [Show full text]
  • Presentation Slides
    no excuses for no automatic testing on c++ projects by Dmitry Ledentsov on 26.03.2015 presented at TU München for the MUC++ Meetup Why? • humans make mistakes • heard and made many excuses • seen benefits of the empirical approach • would like to hear more excuses • by testing I don’t mean hours of manual clicking to see if something that you waited for half an hour to compile works • tests: automated, preferably fast, useful, “just enough" for today • excuses • libraries: a run-through, a tracer bullet • code • links (clickable) • books • discussion a situation It’s Thursday. Your boss asks you to deliver a shaky feature for Monday. You accept, but discover the task not as easy as thought. There are risky dependencies that might break - it’s a big ball of mud But! There’s an easy hack! Who needs testing, I’ll be ready by Monday! excuses not to test • no time, gotta deliver • boss forbids to • no tools for c++ • too long or hard to set up testing environment • dependency hell • I know what I'm doing! • nobody tests around here name yours later! get scared Prag prog Clean coder Source: Amazon questions • how do you know it works, then? • how do you know it's the right thing? • how does it affect the rest of the system? • does it have the expected quality? • how do others know what exactly you've done? no time, gotta deliver it'll bite you back! TECHNICAL DEBT boss forbids to you'll be blamed for failure! how does he know, you’ve done your job properly? too complicated to set up or learn let's talk about that some subjective priorities when
    [Show full text]
  • Bullet Physics Manual
    Bullet 2.80 Physics SDK Manual Also check out the forums and wiki at bulletphysics.org © 2012 Erwin Coumans All Rights Reserved. http://bulletphysics.org Table of Contents BULLET 2.80 PHYSICS SDK MANUAL ....................................................................................................................... 1 1 Introduction .................................................................................................................................................................. 5 Description of the library ................................................................................................................................................................ 5 Main Features ................................................................................................................................................................................ 5 Contact and Support ...................................................................................................................................................................... 5 2 What’s New .................................................................................................................................................................. 6 New in Bullet 2.80 .......................................................................................................................................................................... 6 New in Bullet 2.79 .........................................................................................................................................................................
    [Show full text]
  • Apache-Ivy Wordgrinder Nethogs Qtfm Fcgi Enblend-Enfuse
    eric Ted fsvs kegs ht tome wmii ttcp ess stgit nut heyu lshw 0th tiger ecl r+e vcp glfw trf sage p6f aris gq dstat vice glpk kvirc scite lyx yagf cim fdm atop slock fann G8$ fmit tkcvs pev bip vym fbida fyre yate yturl ogre owfs aide sdcv ncdu srm ack .eex ddd exim .wm ibam siege eagle xlt xclip gts .pilot atool xskat faust qucs gcal nrpe gavl tintin ruff wdfs spin wink vde+ ldns xpad qxkb kile ent gocr uae rssh gpac p0v qpdf pudb mew cc e afuse igal+ naim lurc xsel fcgi qtfm sphinx vmpk libsmi aterm lxsplit cgit librcd fuseiso squi gnugo spotify verilog kasumi pattern liboop latrace quassel gaupol firehol hydra emoc fi mo brlcad bashdb nginx d en+ xvnkb snappy gemrb bigloo sqlite+ shorten tcludp stardict rss-glx astyle yespl hatari loopy amrwb wally id3tool 3proxy d.ango cvsps cbmfs ledger beaver bsddb3 pptpd comgt x.obs abook gauche lxinput povray peg-e icecat toilet curtain gtypist hping3 clam wmdl splint fribid rope ssmtp grisbi crystal logpp ggobi ccrypt snes>x snack culmus libtirpc loemu herrie iripdb dosbox 8yro0 unhide tclvfs dtach varnish knock tracker kforth gbdfed tvtime netatop 8y,wt blake+ qmmp cgoban nexui kdesvn xrestop ifstatus xforms gtklife gmrun pwgen httrack prelink trrnt ip qlipper audiere ssdeep biew waon catdoc icecast uif+iso mirage epdfview tools meld subtle parcellite fusesmb gp+fasta alsa-tools pekwm viewnior mailman memuse hylafax= pydblite sloccount cdwrite uemacs hddtemp wxGT) adom .ulius qrencode usbmon openscap irssi!otr rss-guard psftools anacron mongodb nero-aac gem+tg gambas3 rsnapshot file-roller schedtool
    [Show full text]