update compile option

This commit is contained in:
Feng Ren 2024-08-16 16:01:19 +08:00
parent 2638367541
commit a3d785945c
8 changed files with 50 additions and 21 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
build/
thirdparties/

View File

@ -1,12 +1,25 @@
#!/usr/bin/env bash
if [ ! -d "./thirdparties" ]; then
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!'
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

View File

@ -1,12 +1,26 @@
#!/usr/bin/env bash
if [ ! -d "./JYCache_Env" ]; then
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!'
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/

View File

@ -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)

View File

@ -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)

View File

@ -3,7 +3,7 @@
#include <sched.h>
#include <cstring>
#include <iostream>
#include <immintrin.h>
// #include <immintrin.h>
#include "posix_op_req_res.h"

View File

@ -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();
}

View File

@ -3,6 +3,7 @@
#include <atomic>
#include <gflags/gflags.h>
#include <gtest/gtest.h>
#include <assert.h>
#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;