All Projects → brycelelbach → wg21_p2300_std_execution

brycelelbach / wg21_p2300_std_execution

Licence: Apache-2.0 license
`std::execution`, the proposed C++ framework for asynchronous and parallel programming.

Programming Languages

HTML
75241 projects
C++
36643 projects - #6 most used programming language
Bikeshed
17 projects
CMake
9771 projects
Cuda
1817 projects
python
139335 projects - #7 most used programming language

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 .
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].