Presentation is loading. Please wait.

Presentation is loading. Please wait.

C++ Programming Leveraging the BOOST Libraries

Similar presentations


Presentation on theme: "C++ Programming Leveraging the BOOST Libraries"— Presentation transcript:

1 C++ Programming Leveraging the BOOST Libraries
Lecture Class 8 C++ Programming Leveraging the BOOST Libraries

2 What is BOOST? BOOST is a collection of libraries (with source code in headers) The founders of the boost.org project and libraries were all members of the C++ Standards Committee Motivations: Java popularity and Beman Dawes

3 Boost Design The Boost libraries were designed to be group-developed
10 Boost libraries have already been accepted into the C++ Standard Free for any use licensing policy, although authors retain copyright Strong peer review

4 BOOST Library Categories
BOOST offers libraries in areas such as: Algorithms Memory Management Concurrent Programming Parsing Containers Patterns and Idioms Data Structures State Machines Generic Programming String and Text Processing Image Processing System Input/Output (think streams) Template Metaprogramming Iterators Threads Math and Numerics

5 BOOST Libraries BOOST offers libraries in the Input/Output (Boost.Iostreams) category such as: array null_sink back_insert_device regex_filter basic_array stream_buffer basic_bzip2.compressor stream basic_regex_filter tee_device composite warray filtering_stream wsink gzip_compressor zlib_compressor mapped_file_sink zlib_decompressor

6 Boost Containers Classes in the Containers category include: array
multi_array bimap multi_index gil pointer_container graph property map Image Processing System

7 Boost Documentation Boost categories can be found at:
(1_55_0 is available as well) For example, in the String Category, information on the regex library can be found at:

8 Boost Documentation Boost Documentation is not quite standardized, but most libraries include sections such as: Overview (Motivation, Description) User's Guide (Getting Started, Tutorial, etc.) Building and Installing Instructions Reference (Headers, Classes) Appendices (Rationale, FAQs, Future Plans, etc.)

9 Test Programs Boost offers a testing framework, and all libraries leverage testing The regression test for regex is at: These regression tests can be used to learn how the various interfaces work

10 Example Programs Boost offers example programs for all libraries
The code snippet for regex parsing of credit card numbers is at: The code snippet for the Boost.Date_Time library is at:

11 Cluster Development Boost 1.50 and 1.55 are built and installed on the cluster under: /stage/classes/archive/2013/fall// /boost_1_50_0 A few sample programs (drawn from the boost examples) may be found at: ~mark/pub/51025/src/boost.examples ~mark/pub/51025/src/boost.55.examples I have provided makefiles with library and include macros for building boost code on the cluster in each subdirectory

12 Cluster Development To compile a file using boost 1.55:
g++ -I/stage/classes/archive/2013/fall/ /boost_1_55_0 -g -Wall -ansi -pthread -std=c++0x -c helloworld2.cpp To link a file using boost 1.55 libs: g++ -I/stage/classes/archive/2013/fall/ /boost_1_55_0 -g -Wall -ansi -pthread -std=c++0x -o helloworld2 helloworld2.o -L /stage/classes/archive/2013/fall/ /boost_1_55_0/lib/ -lrt -lboost_thread -l boost_system

13 Cluster Execution To run a program you've compiled under boost on the cluster, you need to set the shared library path: LD_LIBRARY_PATH=/stage/classes/archive/2013/fall/ /boost_1_55_0/lib An easier way is to export the above line in your .bashrc or .bash_profile file: export LD_LIBRARY_PATH=/stage/classes/archive/2013/fall/ /boost_1_55_0/lib


Download ppt "C++ Programming Leveraging the BOOST Libraries"

Similar presentations


Ads by Google