diff options
| author | 刘畅 <[email protected]> | 2024-04-18 02:04:02 +0000 |
|---|---|---|
| committer | 刘畅 <[email protected]> | 2024-04-18 02:04:02 +0000 |
| commit | 548a3a53fa87659402aca4fbf6de8eb42d8807b6 (patch) | |
| tree | 2438f8317db4379f4dd00465c9dbf7725b06db5d | |
| parent | 61e253738b5b62b95bd737cdf5a0eb7514597e0f (diff) | |
| parent | 54dfb9600b233349833c9d7aeb0d632b8fecd11a (diff) | |
Merge branch 'add_static_jemalloc' into 'rel'
Add static jemalloc
See merge request tango/shaping-engine!89
| -rw-r--r-- | CMakeLists.txt | 4 | ||||
| -rw-r--r-- | ci/travis.sh | 1 | ||||
| -rw-r--r-- | shaping/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | vendor/CMakeLists.txt | 16 | ||||
| -rw-r--r-- | vendor/jemalloc-5.3.0.tar.bz2 | bin | 0 -> 736023 bytes |
5 files changed, 19 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e356c4..8e8f403 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,8 +39,8 @@ if(ENABLE_WARNING_ALL) endif() if(ENABLE_SANITIZE_ADDRESS) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fsanitize=leak -fno-omit-frame-pointer") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize=leak -fno-omit-frame-pointer") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lasan") elseif(ENABLE_SANITIZE_THREAD) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=thread -fno-omit-frame-pointer") diff --git a/ci/travis.sh b/ci/travis.sh index f9c76c9..695b014 100644 --- a/ci/travis.sh +++ b/ci/travis.sh @@ -48,7 +48,6 @@ yum install -y numactl-libs # required by mrzcpd yum install -y libibverbs # required by mrzcpd yum install -y libbreakpad_mini-devel yum install -y msgpack-devel -yum install -y jemalloc-devel source /etc/profile.d/framework.sh source /etc/profile.d/mrzcpd.sh diff --git a/shaping/CMakeLists.txt b/shaping/CMakeLists.txt index c85bbba..19862eb 100644 --- a/shaping/CMakeLists.txt +++ b/shaping/CMakeLists.txt @@ -12,8 +12,8 @@ add_executable(shaping_engine src/main.cpp) target_link_libraries(shaping_engine PUBLIC shaper) target_link_libraries(shaping_engine PUBLIC maatframe) target_link_libraries(shaping_engine PUBLIC mrzcpd) +target_link_libraries(shaping_engine PUBLIC libjemalloc-static dl) target_link_libraries(shaping_engine PUBLIC swarmkv) -target_link_libraries(shaping_engine PUBLIC jemalloc) install(TARGETS shaping_engine RUNTIME DESTINATION bin COMPONENT Program) diff --git a/vendor/CMakeLists.txt b/vendor/CMakeLists.txt index e10f3d2..c9f518d 100644 --- a/vendor/CMakeLists.txt +++ b/vendor/CMakeLists.txt @@ -35,3 +35,19 @@ add_library(cjson SHARED IMPORTED GLOBAL) add_dependencies(cjson cJSON) set_property(TARGET cjson PROPERTY IMPORTED_LOCATION ${INSTALL_DIR}/lib64/libcjson.a) set_property(TARGET cjson PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${INSTALL_DIR}/include) + +# jemalloc +ExternalProject_Add(libjemalloc PREFIX libjemalloc + URL ${CMAKE_CURRENT_SOURCE_DIR}/jemalloc-5.3.0.tar.bz2 + CONFIGURE_COMMAND ./autogen.sh --prefix=<INSTALL_DIR> #--enable-prof + BUILD_COMMAND make + BUILD_IN_SOURCE 1 + INSTALL_COMMAND make install prefix=<INSTALL_DIR>) + +ExternalProject_Get_Property(libjemalloc INSTALL_DIR) +file(MAKE_DIRECTORY ${INSTALL_DIR}/include) + +add_library(libjemalloc-static STATIC IMPORTED GLOBAL) +add_dependencies(libjemalloc-static libjemalloc) +set_property(TARGET libjemalloc-static PROPERTY IMPORTED_LOCATION ${INSTALL_DIR}/lib/libjemalloc.a) +set_property(TARGET libjemalloc-static PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${INSTALL_DIR}/include) diff --git a/vendor/jemalloc-5.3.0.tar.bz2 b/vendor/jemalloc-5.3.0.tar.bz2 Binary files differnew file mode 100644 index 0000000..5de860d --- /dev/null +++ b/vendor/jemalloc-5.3.0.tar.bz2 |
