c++ for marine streamer positioning and navigation - accu 2011
DESCRIPTION
The slides from my ACCU 2011 conference presentation.TRANSCRIPT
![Page 1: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/1.jpg)
C++ for Marine Streamer Positioning & Navigation
Mike LongSchlumberger Western Geco
![Page 2: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/2.jpg)
Western Geco
Well Testing
Well Services
Integrated Project Management
Schlumberger Information Solutions
Data & Consulting Services
Our Technologies and Services
Reservoir Characterization
Reservoir Production
Reservoir Management
Drilling & Measurements
Completions
Wireline
Artificial Lift
![Page 3: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/3.jpg)
Western Geco : Seismic acquistion
You Tube - marine seismic acquisition
![Page 4: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/4.jpg)
Deployment Configuration
![Page 5: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/5.jpg)
Streamer Navigation & Positioning
![Page 6: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/6.jpg)
Western Geco : Technical Challenges
Data VolumeTens of thousands of sensors acquiring real time data (+ranging and status)
PowerPhysically long streamers
CostProprietary hardware systemsCustom chip development
![Page 7: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/7.jpg)
C++ On a ShoestringBuilding a gcc cross compile toolchain for the Stellaris LM3S8962 Cortex-M3
![Page 8: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/8.jpg)
Topics
What is a toolchain and how to choose one?Building your own gcc cross compile toolchain.Stacks & Heaps: Linker ScriptsProgramming and On-chip debuggingThe time before "int main()"C++ on a dietTestable Embedded C++
![Page 9: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/9.jpg)
What makes up a toolchain?
![Page 10: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/10.jpg)
What makes up a toolchain
![Page 11: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/11.jpg)
What makes up a toolchain
![Page 12: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/12.jpg)
How to choose a toolchain
Step 0, surveying the options:Are there any options?Paid or Free?Are you paying for the compiler or for support?Does the compiler require a license?
Step 1: what is the lifetime of the product/target?Projects with a limited shelf life don't need to be too concerned about source availabilityExtended life products will benefit from source availability
![Page 13: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/13.jpg)
How to choose a toolchain
Given that we make long-lived products, source availability is desirable. So: are there any companies providing toolchains?
![Page 14: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/14.jpg)
How to choose a toolchain
Given that we make long-lived products, source availability is desirable. So: are there any companies providing toolchains?
![Page 15: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/15.jpg)
How to choose a toolchain
Given that we make long-lived products, source availability is desirable. So: are there any companies providing toolchains?
+ Up and running quickly+ Tested and supported- Proprietary startup code and libraries- Licence management
![Page 16: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/16.jpg)
How to choose a toolchain
Build from source:Some companies provide a "lite" gcc toolchain for free with full source.Some popular targets already have a gcc cross compiler out of the box.If you are really lucky it might even be part of your distribution:
#sudo apt-get install gcc-arm-linux-gnueabi qemu-kvm-extrasIf you are particularly masochistic you can build each component from the sources and independently verify each component and the dependencies (not for the faint of heart).Or you can use a toolchain builder (like crosstool-NG)
![Page 17: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/17.jpg)
How to choose a toolchain
![Page 18: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/18.jpg)
Crosstool-NG
crosstool-NG is a tool to build cross-toolchains
Kernel-like menuconfig interfaceLarge number of supported architecturesuClibc-, glibc- or eglibc-based toolchain supportedCan create toolchains that target linux and bare-metalSupports both soft- and hard- float toolchainsDebug facilities (native and cross gdb, gdbserver)
Watch out though, the default configuration for cortex-m3 doesn't enable gdb. Remember to adjust the config!
![Page 19: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/19.jpg)
Crosstool-NG#install crosstool-ngbzip2 -d crosstool-ng-1.8.1.tar.bz2tar -xf crosstool-ng-1.8.1.tarcd crosstool-ng-1.8.1/sudo apt-get install awksudo apt-get install gawksudo apt-get install bisonsudo apt-get install flexsudo apt-get install automakesudo apt-get install libtoolsudo apt-get install libncurses-devsudo apt-get install zlib1g-dev./configuremakesudo make installmkdir /home/user1/arm-eabi/cd /home/user1/arm-eabi/#copy sample file for baremetal build to new directorycp /home/user1/downloads/crosstool-ng-1.8.1/samples/arm-bare_newlib_cortex_m3_nommu-eabi/crosstool.config .config#build the entire toolchainct-ng build
![Page 20: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/20.jpg)
Crosstool-NG
Kernel-like menuconfig interfaceLarge number of supported architecturesuClibc-, glibc- or eglibc-based toolchain supportedCan create toolchains that target linux and bare-metalSupports both soft- and hard- float toolchainsDebug facilities (native and cross gdb, gdbserver)
Watch out though, the default configuration for cortex-m3 doesn't enable gdb. Remember to adjust the config!
![Page 21: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/21.jpg)
Stacks & Heaps: Linker Scripts
![Page 22: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/22.jpg)
Stacks & Heaps: Linker Scripts
Gcc uses a linker script to decide what goes where, and when:
![Page 23: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/23.jpg)
Stacks & Heaps: Linker Scripts
![Page 24: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/24.jpg)
Stacks & Heaps: Linker Scripts
![Page 25: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/25.jpg)
Stacks & Heaps: Linker Scripts
![Page 26: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/26.jpg)
Stacks & Heaps: Linker Scripts
![Page 27: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/27.jpg)
From link-time to run-time:Programming and On-chip debugging
![Page 28: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/28.jpg)
The time before "int main()"
![Page 29: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/29.jpg)
The time before "int main()"
![Page 30: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/30.jpg)
The time before "int main()"
![Page 31: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/31.jpg)
C++ on a diet
![Page 32: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/32.jpg)
C++ on a diet
The standard C and C++ runtime has many code and data greedy features.
How to shave off some of the bloat?Minimize standard library use?Disable exceptions?Restrict dynamic memory allocation?Custom heap allocator?Disable runtime type identification?
![Page 33: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/33.jpg)
C++ on a diet
-fno-rtti
-fno-exceptions
-nostdlib
-nostartfiles
-Xlinker --no-gc-sections
![Page 34: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/34.jpg)
C++ on a diet
![Page 35: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/35.jpg)
C++ on a diet
![Page 36: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/36.jpg)
C++ on a diet
![Page 37: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/37.jpg)
Testable Embedded C++
![Page 38: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/38.jpg)
Testable Embedded C++: HIL
![Page 39: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/39.jpg)
Conclusions
Why would anyone do this?Time consumingDifficult to estimateHard
![Page 40: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/40.jpg)
Conclusions
Why would anyone do this?Time consumingDifficult to estimateHard
Why would anyone do this?Vendor IndependenceFull sourceNo "magic"Fully configurableGreat learning experience
![Page 41: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/41.jpg)
http://www.westerngeco.com/http://meekrosoft.wordpress.com/@meekrosoft
![Page 42: C++ for Marine Streamer Positioning and Navigation - ACCU 2011](https://reader033.vdocument.in/reader033/viewer/2022052323/558a3cb8d8b42a1e788b4584/html5/thumbnails/42.jpg)
CreditsOpenOCDhttps://sites.google.com/a/stf12.net/developer-sw-fw/eclipse-demo
Choose You:http://www.flickr.com/photos/buzzbishop/3270420690/
Fish Stack: http://www.flickr.com/photos/14903992@N08/4053566319/in/photostream/
Fish Heap http://www.flickr.com/photos/bansal98/2389487868/
Burgerhttp://www.flickr.com/photos/derusha/561781801/
Saladhttp://www.flickr.com/photos/freddy/39340695/
Go the right way:http://www.flickr.com/photos/elenahneshcuetphotography/4438510791/