mirror of
https://github.com/marian-nmt/marian.git
synced 2025-01-07 17:10:15 +03:00
only use tcmalloc_minimal
This commit is contained in:
parent
7d2045a907
commit
cfc33f5498
@ -491,15 +491,21 @@ if(USE_STATIC_LIBS)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
# Find Tcmalloc
|
||||
# Find Tcmalloc_minimal
|
||||
# re-used from sentencepiece
|
||||
if(NOT WIN32)
|
||||
find_package(Tcmalloc)
|
||||
if(Tcmalloc_FOUND)
|
||||
include_directories(${Tcmalloc_INCLUDE_DIR})
|
||||
if(USE_STATIC_LIBS)
|
||||
find_library(TCMALLOC_LIB NAMES libtcmalloc_minimal.a)
|
||||
else()
|
||||
find_library(TCMALLOC_LIB NAMES tcmalloc_minimal)
|
||||
endif()
|
||||
if (TCMALLOC_LIB)
|
||||
message(STATUS "Found TCMalloc: ${TCMALLOC_LIB}")
|
||||
set(EXT_LIBS ${EXT_LIBS} ${Tcmalloc_LIBRARIES})
|
||||
else(Tcmalloc_FOUND)
|
||||
message(WARNING "Cannot find TCMalloc library. Continuing.")
|
||||
endif(Tcmalloc_FOUND)
|
||||
add_definitions(-fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free)
|
||||
else()
|
||||
message(STATUS "Not Found TCMalloc: ${TCMALLOC_LIB}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
|
Loading…
Reference in New Issue
Block a user