Skip to content

mmatrosov/ExtractRight

Repository files navigation

Intro

Source code used for Versatile C++ applied talk at CppRussia 2018.

Why "ExtractRight"? Well, it started some time ago...

Run on Ubuntu

Install Ubuntu 18.04 LTS (Bionic Beaver) Beta 2.

Set up compilers:

sudo apt install clang
sudo apt install libc++-dev
sudo apt install libc++abi-dev
sudo apt install g++-8

Install boost:

sudo apt install libboost-dev

Get sources:

git clone --recurse-submodules https://github.com/mmatrosov/ExtractRight.git
cd ExtractRight
mkdir build && cd build

Build sources with clang and libc++:

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang++-6.0 .. && make

Build sources with gcc and libstdc++:

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++-8 .. && make

Run benchmarks:

./ExtractRight --benchmark_out_format=csv --benchmark_out=benchmark.csv

Check environment

Installed packages:

mikhail@stronghold:~/dev/ExtractRight/build$ apt list --installed clang*
Listing... Done
clang/bionic,now 1:6.0-41~exp4 amd64 [installed]
clang-6.0/bionic,now 1:6.0-1ubuntu2 amd64 [installed,automatic]
mikhail@stronghold:~/dev/ExtractRight/build$ apt list --installed libc++*
Listing... Done
libc++-dev/bionic,now 6.0-2 amd64 [installed]
libc++-helpers/bionic,bionic,now 6.0-2 all [installed,automatic]
libc++1/bionic,now 6.0-2 amd64 [installed,automatic]
libc++abi-dev/bionic,now 6.0-2 amd64 [installed]
libc++abi1/bionic,now 6.0-2 amd64 [installed,automatic]
mikhail@stronghold:~/dev/ExtractRight/build$ apt list --installed g++*
Listing... Done
g++/bionic,now 4:7.3.0-3ubuntu2 amd64 [installed]
g++-7/bionic,now 7.3.0-16ubuntu2 amd64 [installed,automatic]
g++-8/bionic,now 8-20180414-1ubuntu1 amd64 [installed]
mikhail@stronghold:~/dev/ExtractRight/build$ apt list --installed libstdc++*
Listing... Done
libstdc++-7-dev/bionic,now 7.3.0-16ubuntu2 amd64 [installed,automatic]
libstdc++-8-dev/bionic,now 8-20180414-1ubuntu1 amd64 [installed]
libstdc++6/bionic,now 8-20180414-1ubuntu1 amd64 [installed]
mikhail@stronghold:~/dev/ExtractRight/build$ apt list --installed libboost*
Listing... Done
libboost-date-time1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed]
libboost-dev/bionic,now 1.65.1.0ubuntu1 amd64 [installed]
libboost-filesystem1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed]
libboost-iostreams1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed]
libboost-locale1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed]
libboost-system1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed]
libboost-thread1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed]
libboost1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]

Compiler flags:

mikhail@stronghold:~/dev/ExtractRight/build$ cat CMakeFiles/ExtractRight.dir/flags.make 
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.10

# compile CXX with /usr/bin/g++-8
CXX_FLAGS = -O3 -DNDEBUG   -std=gnu++1z

CXX_DEFINES = -DBOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE -D_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING

CXX_INCLUDES = -I/home/mikhail/dev/ExtractRight/range-v3/include -isystem /home/mikhail/dev/ExtractRight/googletest/googletest/include -I/home/mikhail/dev/ExtractRight/benchmark/src/../include 

Run on Windows

Install Microsoft Visual Studio 2017.

Get sources:

git clone --recurse-submodules https://github.com/mmatrosov/ExtractRight.git
cd ExtractRight
mkdir build && cd build

Build sources with MSVC:

cmake -G "Visual Studio 15 2017 Win64" ..
"%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
msbuild /p:Configuration=Release ExtractRight.sln

Run benchmarks:

Release\ExtractRight --benchmark_out_format=csv --benchmark_out=benchmark.csv

Compare results

Open benchmark.csv in Excel (some manual editing might be needed). Paste data to a corresponding sheet of presentation/Benchmarks.xlsx table. All charts will be updated automatically.

About

Demo repository for Daily C++ 2 talk

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published