From a3d785945cb15ea8bc24f30316c7db3e19d95ae2 Mon Sep 17 00:00:00 2001 From: Feng Ren Date: Fri, 16 Aug 2024 16:01:19 +0800 Subject: [PATCH] update compile option --- .gitignore | 2 ++ build.sh | 27 +++++++++++++++++------- install.sh | 28 ++++++++++++++++++------- intercept/CMakeLists.txt | 6 +++--- intercept/internal/CMakeLists.txt | 2 +- intercept/internal/posix_op_req_res.cpp | 2 +- local_cache/page_cache.cpp | 1 - test/test_global_write_cache_perf.cpp | 3 ++- 8 files changed, 50 insertions(+), 21 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..130e7a5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +build/ +thirdparties/ diff --git a/build.sh b/build.sh index 2302716..a6f3c2b 100755 --- a/build.sh +++ b/build.sh @@ -1,12 +1,25 @@ #!/usr/bin/env bash if [ ! -d "./thirdparties" ]; then - wget https://madstorage.s3.cn-north-1.jdcloud-oss.com/JYCache_Dendepency_x64.tgz - md5=`md5sum JYCache_Dendepency_x64.tgz | awk {'print $1'}` - if [ "$md5" != "48f67dd9b7bcb1b2bdd6be9f2283b714" ]; then -   echo 'JYCache_Dendepency version inconsistency!' - exit 1 - fi - tar -zxvf JYCache_Dendepency_x64.tgz + case $(uname -m) in + x86_64) + wget https://madstorage.s3.cn-north-1.jdcloud-oss.com/JYCache_Dendepency_x64.tgz + md5=`md5sum JYCache_Dendepency_x64.tgz | awk {'print $1'}` + if [ "$md5" != "48f67dd9b7bcb1b2bdd6be9f2283b714" ]; then + echo 'JYCache_Dendepency version inconsistency!' + exit 1 + fi + tar -zxvf JYCache_Dendepency_x64.tgz + ;; + aarch64) + wget https://madstorage.s3.cn-north-1.jdcloud-oss.com/JYCache_Dendepency_arm64.tgz + md5=`md5sum JYCache_Dendepency_arm64.tgz | awk {'print $1'}` + if [ "$md5" != "5c90ddd6b0849336adeccbdadf42f065" ]; then + echo 'JYCache_Dendepency version inconsistency!' + exit 1 + fi + tar -zxvf JYCache_Dendepency_arm64.tgz + ;; + esac fi mkdir -p build && cd build diff --git a/install.sh b/install.sh index cde4575..136afe9 100755 --- a/install.sh +++ b/install.sh @@ -1,12 +1,26 @@ #!/usr/bin/env bash + if [ ! -d "./JYCache_Env" ]; then - wget https://madstorage.s3.cn-north-1.jdcloud-oss.com/JYCache_Env_x64.tgz - md5=`md5sum JYCache_Env_x64.tgz | awk {'print $1'}` - if [ "$md5" != "cd27e0db8b1fc33b88bf1c467ed012b8" ]; then -   echo 'JYCache_Env version inconsistency!' - exit 1 - fi - tar -zxvf JYCache_Env_x64.tgz + case $(uname -m) in + x86_64) + wget https://madstorage.s3.cn-north-1.jdcloud-oss.com/JYCache_Env_x64.tgz + md5=`md5sum JYCache_Env_x64.tgz | awk {'print $1'}` + if [ "$md5" != "cd27e0db8b1fc33b88bf1c467ed012b8" ]; then + echo 'JYCache_Env version inconsistency!' + exit 1 + fi + tar -zxvf JYCache_Env_x64.tgz + ;; + aarch64) + wget https://madstorage.s3.cn-north-1.jdcloud-oss.com/JYCache_Env_arm64.tgz + md5=`md5sum JYCache_Env_arm64.tgz | awk {'print $1'}` + if [ "$md5" != "5717814115a9ce3f2fa7f6759449e5bf" ]; then + echo 'JYCache_Env version inconsistency!' + exit 1 + fi + tar -zxvf JYCache_Env_arm64.tgz + ;; + esac fi cp ./build/intercept/intercept_server JYCache_Env/ diff --git a/intercept/CMakeLists.txt b/intercept/CMakeLists.txt index 170886d..4671e31 100644 --- a/intercept/CMakeLists.txt +++ b/intercept/CMakeLists.txt @@ -4,7 +4,7 @@ find_library(ICEORYX_POSH_LIB iceoryx_posh PATHS ../thirdparties/iceoryx/lib) find_library(ICEORYX_HOOFS_LIB iceoryx_hoofs PATHS ../thirdparties/iceoryx/lib) find_library(ICEORYX_PLATFORM_LIB iceoryx_platform PATHS ../thirdparties/iceoryx/lib) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../thirdparties/spdlog/include) @@ -18,7 +18,7 @@ add_subdirectory(middleware) add_subdirectory(posix) add_executable(intercept_server server.cpp) -target_link_libraries(intercept_server PUBLIC intercept_discovery intercept_internal common_lib intercept_filesystem intercept_middleware intercept_registry hybridcache_local madfs_global s3fs_lib ${THIRD_PARTY_LIBRARIES} ${ICEORYX_POSH_LIB} ${ICEORYX_HOOFS_LIB} ${ICEORYX_PLATFORM_LIB} -pthread -lcurl -lxml2 -lcrypto -ldl -laio -lrt -lacl) +target_link_libraries(intercept_server PUBLIC intercept_discovery intercept_internal common_lib intercept_filesystem intercept_middleware intercept_registry hybridcache_local madfs_global s3fs_lib ${ICEORYX_POSH_LIB} ${ICEORYX_HOOFS_LIB} ${ICEORYX_PLATFORM_LIB} -pthread -lcurl -lxml2 -lcrypto -ldl -laio -lrt) add_library(intercept_client SHARED client.cpp) target_link_libraries(intercept_client PUBLIC @@ -31,4 +31,4 @@ target_link_libraries(intercept_client PUBLIC -lrt -L${CMAKE_CURRENT_SOURCE_DIR}/../thirdparties/intercept/lib ) -target_compile_options(intercept_client PUBLIC -DCLIENT_BUILD -mavx2) +target_compile_options(intercept_client PUBLIC -DCLIENT_BUILD) diff --git a/intercept/internal/CMakeLists.txt b/intercept/internal/CMakeLists.txt index 0ca488e..a7cd4c5 100644 --- a/intercept/internal/CMakeLists.txt +++ b/intercept/internal/CMakeLists.txt @@ -8,5 +8,5 @@ target_link_libraries(intercept_internal PUBLIC common_lib) add_library(intercept_internal_client ${INTERNAL_SOURCES}) target_include_directories(intercept_internal_client PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) -target_compile_options(intercept_internal_client PUBLIC -fPIC -mavx2) +target_compile_options(intercept_internal_client PUBLIC -fPIC) target_link_libraries(intercept_internal_client PUBLIC common_lib_client) diff --git a/intercept/internal/posix_op_req_res.cpp b/intercept/internal/posix_op_req_res.cpp index 209903b..3110781 100644 --- a/intercept/internal/posix_op_req_res.cpp +++ b/intercept/internal/posix_op_req_res.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +// #include #include "posix_op_req_res.h" diff --git a/local_cache/page_cache.cpp b/local_cache/page_cache.cpp index b6a023c..917b45f 100644 --- a/local_cache/page_cache.cpp +++ b/local_cache/page_cache.cpp @@ -117,7 +117,6 @@ int PageCacheImpl::Init() { nvmConfig.navyConfig.blockCache() .setDataChecksum(cfg_.CacheLibCfg.DataChecksum); - nvmConfig.navyConfig.setReaderAndWriterThreads(1, 1, 0, 0); config.enableNvmCache(nvmConfig).validate(); } diff --git a/test/test_global_write_cache_perf.cpp b/test/test_global_write_cache_perf.cpp index 267cfa6..a846c26 100644 --- a/test/test_global_write_cache_perf.cpp +++ b/test/test_global_write_cache_perf.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "S3DataAdaptor.h" #include "FileSystemDataAdaptor.h" @@ -50,7 +51,7 @@ TEST(global_cache_client, perf) for (int j = 0; j < FLAGS_depth; ++j) { int ret = posix_memalign((void **) &buffer[j].data, 4096, chunk_size); // memset(buffer[j].data, 'x', chunk_size); - ASSERT(!ret); + assert(!ret); buffer[j].len = chunk_size; } uint64_t operations = 0;