From 68943017c1b2c9944dca1ec9fbc4023d049642d9 Mon Sep 17 00:00:00 2001 From: Bob Chen Date: Wed, 12 Jun 2024 09:41:51 +0800 Subject: [PATCH] PHOTON_ENABLE_ECOSYSTEM defaults to off (#507) --- .github/workflows/ci.linux.arm.yml | 18 ++++++++++++++---- .github/workflows/ci.linux.x86-64.yml | 3 ++- .github/workflows/ci.macos.arm.yml | 10 +++++++--- .github/workflows/ci.macos.x86.yml | 10 +++++++--- CMakeLists.txt | 6 ++---- doc/docs/introduction/how-to-build.md | 12 ++++++------ doc/docs/performance/network-performance.md | 2 +- fs/test/test.cpp | 3 ++- 8 files changed, 41 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.linux.arm.yml b/.github/workflows/ci.linux.arm.yml index 6a806f49..bd045a5a 100644 --- a/.github/workflows/ci.linux.arm.yml +++ b/.github/workflows/ci.linux.arm.yml @@ -26,8 +26,13 @@ jobs: - name: Build run: | source /opt/rh/gcc-toolset-9/enable - cmake -B build -D CMAKE_BUILD_TYPE=MinSizeRel -D PHOTON_BUILD_TESTING=ON \ - -D PHOTON_ENABLE_SASL=ON -D PHOTON_ENABLE_FUSE=ON -D PHOTON_ENABLE_EXTFS=ON + cmake -B build \ + -D CMAKE_BUILD_TYPE=MinSizeRel \ + -D PHOTON_ENABLE_ECOSYSTEM=ON \ + -D PHOTON_BUILD_TESTING=ON \ + -D PHOTON_ENABLE_SASL=ON \ + -D PHOTON_ENABLE_FUSE=ON \ + -D PHOTON_ENABLE_EXTFS=ON cmake --build build -j $(nproc) -- VERBOSE=1 - name: Test @@ -54,8 +59,13 @@ jobs: - name: Build run: | source /opt/rh/gcc-toolset-9/enable - cmake -B build -D CMAKE_BUILD_TYPE=Debug -D PHOTON_BUILD_TESTING=ON \ - -D PHOTON_ENABLE_SASL=ON -D PHOTON_ENABLE_FUSE=ON -D PHOTON_ENABLE_EXTFS=ON + cmake -B build \ + -D CMAKE_BUILD_TYPE=Debug \ + -D PHOTON_ENABLE_ECOSYSTEM=ON \ + -D PHOTON_BUILD_TESTING=ON \ + -D PHOTON_ENABLE_SASL=ON \ + -D PHOTON_ENABLE_FUSE=ON \ + -D PHOTON_ENABLE_EXTFS=ON cmake --build build -j $(nproc) -- VERBOSE=1 - name: Test diff --git a/.github/workflows/ci.linux.x86-64.yml b/.github/workflows/ci.linux.x86-64.yml index 3edf34a2..04e6600b 100644 --- a/.github/workflows/ci.linux.x86-64.yml +++ b/.github/workflows/ci.linux.x86-64.yml @@ -15,6 +15,7 @@ jobs: run: | rm -fr build cmake -B build -D CMAKE_BUILD_TYPE=MinSizeRel \ + -D PHOTON_ENABLE_ECOSYSTEM=ON \ -D PHOTON_BUILD_TESTING=ON \ -D PHOTON_ENABLE_SASL=ON \ -D PHOTON_ENABLE_FUSE=ON \ @@ -158,7 +159,7 @@ jobs: - name: Build1121 run: | source /opt/rh/gcc-toolset-10/enable - cmake --build build -j --clean-first -- VERBOSE=1 + cmake --build build -j $(nproc) --clean-first -- VERBOSE=1 ln -f common/checksum/test/checksum.in build/output/ tar -c --use-compress-program=zstdmt -f output1121.tzs build/output/ - name: Upload1121 diff --git a/.github/workflows/ci.macos.arm.yml b/.github/workflows/ci.macos.arm.yml index 753acd6b..737e6600 100644 --- a/.github/workflows/ci.macos.arm.yml +++ b/.github/workflows/ci.macos.arm.yml @@ -26,9 +26,13 @@ jobs: - name: Build run: | - cmake -B ${{github.workspace}}/build -D PHOTON_BUILD_TESTING=ON -D CMAKE_BUILD_TYPE=Release \ - -D PHOTON_ENABLE_SASL=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/Cellar/openssl@1.1/1.1.1w - cmake --build ${{github.workspace}}/build -j $(nproc) + cmake -B ${{github.workspace}}/build \ + -D PHOTON_ENABLE_ECOSYSTEM=ON \ + -D PHOTON_BUILD_TESTING=ON \ + -D CMAKE_BUILD_TYPE=MinSizeRel \ + -D PHOTON_ENABLE_SASL=ON \ + -D OPENSSL_ROOT_DIR=/opt/homebrew/Cellar/openssl@1.1/1.1.1w + cmake --build ${{github.workspace}}/build -j $(sysctl -n hw.logicalcpu) - name: Test working-directory: ${{github.workspace}}/build diff --git a/.github/workflows/ci.macos.x86.yml b/.github/workflows/ci.macos.x86.yml index 4ca1ef90..81e6bf34 100644 --- a/.github/workflows/ci.macos.x86.yml +++ b/.github/workflows/ci.macos.x86.yml @@ -26,9 +26,13 @@ jobs: - name: Build run: | - cmake -B ${{github.workspace}}/build -D PHOTON_BUILD_TESTING=ON -D CMAKE_BUILD_TYPE=Release \ - -D PHOTON_ENABLE_SASL=ON -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl@3 - cmake --build ${{github.workspace}}/build -j $(nproc) + cmake -B ${{github.workspace}}/build \ + -D PHOTON_ENABLE_ECOSYSTEM=ON \ + -D PHOTON_BUILD_TESTING=ON \ + -D CMAKE_BUILD_TYPE=MinSizeRel \ + -D PHOTON_ENABLE_SASL=ON \ + -D OPENSSL_ROOT_DIR=/usr/local/opt/openssl@3 + cmake --build ${{github.workspace}}/build -j $(sysctl -n hw.logicalcpu) - name: Test working-directory: ${{github.workspace}}/build diff --git a/CMakeLists.txt b/CMakeLists.txt index 79bc0491..74eb86e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ option(PHOTON_ENABLE_SASL "enable sasl" OFF) option(PHOTON_ENABLE_MIMIC_VDSO "enable mimic vdso" OFF) option(PHOTON_ENABLE_FSTACK_DPDK "Use f-stack + DPDK as the event engine" OFF) option(PHOTON_ENABLE_EXTFS "enable extfs" OFF) -option(PHOTON_ENABLE_ECOSYSTEM "enable ecosystem" ON) +option(PHOTON_ENABLE_ECOSYSTEM "enable ecosystem" OFF) option(PHOTON_BUILD_DEPENDENCIES "" OFF) set(PHOTON_AIO_SOURCE "https://pagure.io/libaio/archive/libaio-0.3.113/libaio-0.3.113.tar.gz" CACHE STRING "") @@ -44,12 +44,11 @@ set(PHOTON_RAPIDXML_SOURCE "https://sourceforge.net/projects/rapidxml/files/rapi set(PHOTON_RAPIDYAML_SOURCE "https://github.com/biojppm/rapidyaml/releases/download/v0.5.0/rapidyaml-0.5.0.hpp" CACHE STRING "") set(PHOTON_CPP_REDIS_SOURCE "https://github.com/cpp-redis/cpp_redis/archive/refs/tags/4.3.1.tar.gz" CACHE STRING "") -# Get CPU arch and number +# Get CPU arch execute_process(COMMAND uname -m OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) if (NOT (${ARCH} STREQUAL x86_64) AND NOT (${ARCH} STREQUAL aarch64) AND NOT (${ARCH} STREQUAL arm64)) message(FATAL_ERROR "Unknown CPU architecture ${ARCH}") endif () -ProcessorCount(NumCPU) # Global compile options, only effective within this project set(global_compile_options -Wall -Wno-error=pragmas) @@ -77,7 +76,6 @@ set(CMAKE_CXX_FLAGS_MINSIZEREL "-O2") # Only for CI test set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_BUILD_RPATH_USE_ORIGIN ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON) -set(CMAKE_BUILD_PARALLEL_LEVEL ${NumCPU}) if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-packed-bitfield-compat") diff --git a/doc/docs/introduction/how-to-build.md b/doc/docs/introduction/how-to-build.md index 4266c6f2..d91a06df 100644 --- a/doc/docs/introduction/how-to-build.md +++ b/doc/docs/introduction/how-to-build.md @@ -64,7 +64,7 @@ brew install cmake openssl@1.1 pkg-config ```bash cd PhotonLibOS cmake -B build -cmake --build build -j +cmake --build build -j 8 ``` ```mdx-code-block @@ -75,7 +75,7 @@ cmake --build build -j ```bash cd PhotonLibOS cmake -B build -cmake --build build -j +cmake --build build -j 8 ``` ```mdx-code-block @@ -86,7 +86,7 @@ cmake --build build -j ```bash cd PhotonLibOS cmake -B build -D OPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1 -cmake --build build -j +cmake --build build -j 8 ``` ```mdx-code-block @@ -115,7 +115,7 @@ dnf install gtest-devel gmock-devel gflags-devel fuse-devel libgsasl-devel # Build examples and test code cmake -B build -D PHOTON_BUILD_TESTING=ON -cmake --build build -j +cmake --build build -j 8 # Run all test cases cd build @@ -133,7 +133,7 @@ apt install libgtest-dev libgmock-dev libgflags-dev libfuse-dev libgsasl7-dev # Build examples and test code cmake -B build -D PHOTON_BUILD_TESTING=ON -cmake --build build -j +cmake --build build -j 8 # Run all test cases cd build @@ -151,7 +151,7 @@ brew install gflags googletest gsasl # Build examples and test code cmake -B build -D PHOTON_BUILD_TESTING=ON -cmake --build build -j +cmake --build build -j 8 # Run all test cases cd build diff --git a/doc/docs/performance/network-performance.md b/doc/docs/performance/network-performance.md index 7f3d7234..fd3d310c 100644 --- a/doc/docs/performance/network-performance.md +++ b/doc/docs/performance/network-performance.md @@ -18,7 +18,7 @@ https://github.com/alibaba/PhotonLibOS/blob/main/examples/perf/net-perf.cpp ```cmake cmake -B build -D PHOTON_BUILD_TESTING=1 -D PHOTON_ENABLE_URING=1 -D CMAKE_BUILD_TYPE=Release -cmake --build build -j -t net-perf +cmake --build build -j 8 -t net-perf ``` ### Run diff --git a/fs/test/test.cpp b/fs/test/test.cpp index c0d4ffc0..02d73eeb 100644 --- a/fs/test/test.cpp +++ b/fs/test/test.cpp @@ -873,7 +873,7 @@ TEST(range_split_power2, random_test) { offset = rand(); length = rand(); auto interval_shift = rand()%32 + 1; - interval = 1<