From 84305172eb1af8ef7b7b7d0b9b17f0f3a5aa7c01 Mon Sep 17 00:00:00 2001 From: River <26424577+wusatosi@users.noreply.github.com> Date: Sat, 19 Oct 2024 14:53:02 -0400 Subject: [PATCH] update README --- README.md | 154 ++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 116 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 126b29d..fc9e37b 100644 --- a/README.md +++ b/README.md @@ -143,40 +143,121 @@ cmake --install build/gcc-release --prefix /opt/beman.exemplar Build beman.exemplar (verbose logs) ```shell -# Configure beman.exemplar. -$ cmake -B build -S . -DCMAKE_CXX_STANDARD=20 --- The CXX compiler identification is GNU 13.2.0 +# Configure beman.exemplar via gcc-debug workflow for development. +$ cmake --workflow --preset gcc-debug +Executing workflow step 1 of 3: configure preset "gcc-debug" + +Preset CMake variables: + + CMAKE_BUILD_TYPE="Debug" + CMAKE_CXX_COMPILER="g++" + CMAKE_CXX_FLAGS="-fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=leak -fsanitize=undefined" + CMAKE_CXX_STANDARD="20" + +-- The CXX compiler identification is GNU 11.4.0 +-- Detecting CXX compiler ABI info +-- Detecting CXX compiler ABI info - done +-- Check for working CXX compiler: /usr/bin/g++ - skipped +-- Detecting CXX compile features +-- Detecting CXX compile features - done +-- The C compiler identification is GNU 11.4.0 +-- Detecting C compiler ABI info +-- Detecting C compiler ABI info - done +-- Check for working C compiler: /usr/bin/cc - skipped +-- Detecting C compile features +-- Detecting C compile features - done +-- Found Python3: /usr/bin/python3.10 (found version "3.10.12") found components: Interpreter +-- Performing Test CMAKE_HAVE_LIBC_PTHREAD +-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success +-- Found Threads: TRUE +-- Configuring done +-- Generating done +-- Build files have been written to: /home/runner/work/exemplar/exemplar/build/gcc-debug + +Executing workflow step 2 of 3: build preset "gcc-debug" + +[1/14] Building CXX object src/beman/exemplar/CMakeFiles/beman.exemplar.dir/identity.cpp.o +[2/14] Linking CXX static library src/beman/exemplar/libbeman.exemplar.a +[3/14] Building CXX object examples/CMakeFiles/beman.exemplar.examples.identity_direct_usage.dir/identity_direct_usage.cpp.o +[4/14] Linking CXX executable examples/beman.exemplar.examples.identity_direct_usage +[5/14] Building CXX object _deps/googletest-build/googletest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o +[6/14] Building CXX object src/beman/exemplar/CMakeFiles/beman.exemplar.tests.dir/identity.t.cpp.o +[7/14] Building CXX object _deps/googletest-build/googlemock/CMakeFiles/gmock_main.dir/src/gmock_main.cc.o +[8/14] Building CXX object _deps/googletest-build/googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o +[9/14] Building CXX object _deps/googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o +[10/14] Linking CXX static library lib/libgtest.a +[11/14] Linking CXX static library lib/libgtest_main.a +[12/14] Linking CXX static library lib/libgmock.a +[13/14] Linking CXX static library lib/libgmock_main.a +[14/14] Linking CXX executable src/beman/exemplar/beman.exemplar.tests + +Executing workflow step 3 of 3: test preset "gcc-debug" + +Test project /home/runner/work/exemplar/exemplar/build/gcc-debug + Start 1: IdentityTest.call_identity_with_int +1/4 Test #1: IdentityTest.call_identity_with_int ........... Passed 0.13 sec + Start 2: IdentityTest.call_identity_with_custom_type +2/4 Test #2: IdentityTest.call_identity_with_custom_type ... Passed 0.01 sec + Start 3: IdentityTest.compare_std_vs_beman +3/4 Test #3: IdentityTest.compare_std_vs_beman ............. Passed 0.01 sec + Start 4: IdentityTest.check_is_transparent +4/4 Test #4: IdentityTest.check_is_transparent ............. Passed 0.01 sec + +100% tests passed, 0 tests failed out of 4 + +Total Test time (real) = 0.18 sec + +# Configure beman.exemplar via gcc-release workflow for direct usage. +$ cmake --workflow --preset gcc-release +Executing workflow step 1 of 3: configure preset "gcc-release" + +Preset CMake variables: + + CMAKE_BUILD_TYPE="RelWithDebInfo" + CMAKE_CXX_COMPILER="g++" + CMAKE_CXX_FLAGS="-O3" + CMAKE_CXX_STANDARD="20" + +-- The CXX compiler identification is GNU 11.4.0 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done --- Check for working CXX compiler: /usr/bin/c++ - skipped +-- Check for working CXX compiler: /usr/bin/g++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done --- Configuring done (0.1s) --- Generating done (0.0s) --- Build files have been written to: /path/to/repo/build - -# Build beman.exemplar. -$ cmake --build build -[ 10%] Building CXX object src/beman/exemplar/CMakeFiles/beman.exemplar.dir/identity.cpp.o -[ 20%] Linking CXX static library libbeman.exemplar.a -[ 20%] Built target beman.exemplar -[ 30%] Building CXX object _deps/googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o -[ 40%] Linking CXX static library ../../../lib/libgtest.a -[ 40%] Built target gtest -[ 50%] Building CXX object _deps/googletest-build/googletest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o -[ 60%] Linking CXX static library ../../../lib/libgtest_main.a -[ 60%] Built target gtest_main -[ 70%] Building CXX object src/beman/exemplar/tests/CMakeFiles/beman.exemplar.Test.dir/identity.t.cpp.o -[ 80%] Linking CXX executable beman.exemplar.Test -[ 80%] Built target beman.exemplar.Test -[ 90%] Building CXX object examples/CMakeFiles/identity_usage.dir/identity_usage.cpp.o -[100%] Linking CXX executable identity_usage -[100%] Built target identity_usage - -# Run beman.exemplar tests. -$ ctest --test-dir build -Internal ctest changing into directory: /path/to/your/repo/build -Test project /path/to/your/repo/build +-- The C compiler identification is GNU 11.4.0 +-- Detecting C compiler ABI info +-- Detecting C compiler ABI info - done +-- Check for working C compiler: /usr/bin/cc - skipped +-- Detecting C compile features +-- Detecting C compile features - done +-- Found Python3: /usr/bin/python3.10 (found version "3.10.12") found components: Interpreter +-- Performing Test CMAKE_HAVE_LIBC_PTHREAD +-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success +-- Found Threads: TRUE +-- Configuring done +-- Generating done +-- Build files have been written to: /home/runner/work/exemplar/exemplar/build/gcc-release + +Executing workflow step 2 of 3: build preset "gcc-release" + +[1/14] Building CXX object src/beman/exemplar/CMakeFiles/beman.exemplar.dir/identity.cpp.o +[2/14] Linking CXX static library src/beman/exemplar/libbeman.exemplar.a +[3/14] Building CXX object examples/CMakeFiles/beman.exemplar.examples.identity_direct_usage.dir/identity_direct_usage.cpp.o +[4/14] Linking CXX executable examples/beman.exemplar.examples.identity_direct_usage +[5/14] Building CXX object _deps/googletest-build/googletest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o +[6/14] Building CXX object src/beman/exemplar/CMakeFiles/beman.exemplar.tests.dir/identity.t.cpp.o +[7/14] Building CXX object _deps/googletest-build/googlemock/CMakeFiles/gmock_main.dir/src/gmock_main.cc.o +[8/14] Building CXX object _deps/googletest-build/googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o +[9/14] Building CXX object _deps/googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o +[10/14] Linking CXX static library lib/libgtest.a +[11/14] Linking CXX static library lib/libgtest_main.a +[12/14] Linking CXX static library lib/libgmock.a +[13/14] Linking CXX executable src/beman/exemplar/beman.exemplar.tests +[14/14] Linking CXX static library lib/libgmock_main.a + +Executing workflow step 3 of 3: test preset "gcc-release" + +Test project /home/runner/work/exemplar/exemplar/build/gcc-release Start 1: IdentityTest.call_identity_with_int 1/4 Test #1: IdentityTest.call_identity_with_int ........... Passed 0.00 sec Start 2: IdentityTest.call_identity_with_custom_type @@ -190,9 +271,8 @@ Test project /path/to/your/repo/build Total Test time (real) = 0.01 sec - # Run examples. -$ build/exemplar/beman.exemplar.examples.identity_direct_usage +$ build/gcc-release/examples/beman.exemplar.examples.identity_direct_usage 2024 ``` @@ -204,14 +284,12 @@ $ build/exemplar/beman.exemplar.examples.identity_direct_usage ```shell # Install build artifacts from `build` directory into `opt/beman.exemplar` path. -$ cmake --install build --prefix /opt/beman.exemplar --- Install configuration: "" +$ cmake --install build/gcc-release --prefix /opt/beman.exemplar +-- Install configuration: "RelWithDebInfo" -- Up-to-date: /opt/beman.exemplar/lib/libbeman.exemplar.a --- Up-to-date: /opt/beman.exemplar/include --- Up-to-date: /opt/beman.exemplar/include/beman --- Up-to-date: /opt/beman.exemplar/include/beman/exemplar -- Up-to-date: /opt/beman.exemplar/include/beman/exemplar/identity.hpp + # Check tree. $ tree /opt/beman.exemplar /opt/beman.exemplar @@ -222,7 +300,7 @@ $ tree /opt/beman.exemplar └── lib └── libbeman.exemplar.a -5 directories, 2 files +4 directories, 2 files ```