Giter VIP home page Giter VIP logo

wg21_p2300_std_execution's Introduction

std::execution, the proposed C++ framework for asynchronous and parallel programming.

You can see a rendered copy of the current draft here.

Reference implementation

CI

Building

The following tools are needed:

Perform the following actions:

# Go to the build directory
mkdir -p build
pushd build

# Install dependencies
conan install .. --build=missing -s build_type=Release -s compiler.cppstd=20

# Do the actual build
cmake -G<gen> -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=20 ..
cmake --build .

popd build

Here, <gen> can be Ninja, make, XCode, "Visual Studio 15 Win64", etc.

Specifying the compiler

If you want to build with a specific compiler, you first need to teach conan about the compiler. You can do that with a conan "profile". Do the following:

# Create a conan profile for your compiler. In this case, the profile named
# "clang-14" is created that refers to /usr/bin/clang++-14
CC=/usr/bin/clang-14 \
  CXX=/usr/bin/clang++-14 \
  conan profile new --detect clang-14

Then edit the resulting file ~/.conan/profiles/clang-14 and add the following to the [env] section:

CC=/usr/bin/clang-14
CXX=/usr/bin/clang++-14

Then when you are installing the conan dependencies (see above), you would add --profile clang-14 to the command line; e.g.,

# Install dependencies
conan install .. --build=missing  --profile clang-14 \
    -s build_type=Release -s compiler.cppstd=20

Finally, when configuring CMake, you would specify the same compiler via the CMAKE_CXX_COMPILER define on the command line; e.g.,

# Do the actual build
cmake -G<gen> -DCMAKE_BUILD_TYPE=Release \
              -DCMAKE_CXX_STANDARD=20 \
              -DCMAKE_CXX_COMPILER=/usr/bin/clang++-14 \
              ..
cmake --build .

Specifying the stdlib

If you want to use libc++ with clang instead of libstdc++, then you first need to tell conan. You have two options: add "-s compiler.libcxx=libc++" to the conan install command, or update the profile directly. Continuing the previous example, to update the clang-14 profile you would do:

# Set the compiler.libcxx property to libc++
conan profile update 'compiler.libcxx=libc++' clang-14

All future uses of the clang-14 profile will now automatically use libc++ instead of libstdc++.

Finally, when configuring CMake, you need to additionally specify the standard library as follows:

# Do the actual build
cmake -G<gen> -DCMAKE_BUILD_TYPE=Release \
              -DCMAKE_CXX_STANDARD=20 \
              -DCMAKE_CXX_COMPILER=/usr/bin/clang++-14 \
              -DCMAKE_CXX_FLAGS=-stdlib=libc++ \
              ..
cmake --build .

wg21_p2300_std_execution's People

Contributors

ericniebler avatar brycelelbach avatar griwes avatar lucteo avatar lewissbaker avatar msimberg avatar gevtushenko avatar leehowes avatar dietmarkuehl avatar gonzalobg avatar kirkshoop avatar huixie90 avatar paulbendixen avatar miscco avatar danra avatar cjdb avatar meastp avatar rarutyun avatar villevoutilainen avatar gonidelis avatar kshitij12345 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.