--- cpp/cmake_modules/ThirdpartyToolchain.cmake +++ cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -1461,6 +1461,6 @@ # jemalloc - Unix-only high-performance allocator - if(ARROW_JEMALLOC) +if(0) message(STATUS "Building (vendored) jemalloc from source") # We only use a vendored jemalloc as we want to control its version. # Also our build of jemalloc is specially prefixed so that it will not @@ -1519,6 +1519,8 @@ add_dependencies(jemalloc::jemalloc jemalloc_ep) list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) +else() + find_package(jemalloc REQUIRED) +endif() endif() - # ---------------------------------------------------------------------- # mimalloc - Cross-platform high-performance allocator, from Microsoft --- cpp/src/arrow/CMakeLists.txt +++ cpp/src/arrow/CMakeLists.txt @@ -307,7 +307,7 @@ set(_allocator_dependencies "") # Empty list if(ARROW_JEMALLOC) - list(APPEND _allocator_dependencies jemalloc_ep) + list(APPEND _allocator_dependencies jemalloc::jemalloc) endif() if(ARROW_MIMALLOC) list(APPEND _allocator_dependencies mimalloc_ep) --- cpp/src/arrow/memory_pool.cc +++ cpp/src/arrow/memory_pool.cc @@ -31,7 +31,7 @@ // Needed to support jemalloc 3 and 4 #define JEMALLOC_MANGLE // Explicitly link to our version of jemalloc -#include "jemalloc_ep/dist/include/jemalloc/jemalloc.h" +#include "jemalloc/jemalloc.h" #endif #ifdef ARROW_MIMALLOC