Skip to content

Commit 93c6dbe

Browse files
Move jemalloc LD_PRELOAD to be set during environment activation (#39869)
Get #39860 into ornl-next
1 parent 72eae91 commit 93c6dbe

File tree

7 files changed

+24
-3
lines changed

7 files changed

+24
-3
lines changed

buildconfig/CMake/LinuxPackageScripts.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,17 @@ configure_file(
121121
# Needs to be executable
122122
execute_process(COMMAND "chmod" "+x" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/AddPythonPath.py" OUTPUT_QUIET ERROR_QUIET)
123123

124+
if(MANTID_FRAMEWORK_LIB STREQUAL "BUILD")
125+
configure_file(
126+
${CMAKE_MODULE_PATH}/Packaging/activate_mantid.sh.in ${CMAKE_BINARY_DIR}/etc/conda/activate.d/mantid.sh @ONLY
127+
)
128+
configure_file(
129+
${CMAKE_MODULE_PATH}/Packaging/deactivate_mantid.sh.in ${CMAKE_BINARY_DIR}/etc/conda/deactivate.d/mantid.sh @ONLY
130+
)
131+
install(FILES ${CMAKE_BINARY_DIR}/etc/conda/activate.d/mantid.sh DESTINATION ${ETC_DIR}/conda/activate.d)
132+
install(FILES ${CMAKE_BINARY_DIR}/etc/conda/deactivate.d/mantid.sh DESTINATION ${ETC_DIR}/conda/deactivate.d)
133+
endif()
134+
124135
# Package version
125136
unset(PYTHON_ARGS)
126137

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@JEMALLOC_DEFINITIONS@
2+
export LD_PRELOAD=${LOCAL_PRELOAD}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
unset LD_PRELOAD

conda/recipes/mantiddocs/build.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ bash "${parent_dir}"/archive_env_logs.sh "$BUILD_PREFIX" "$PREFIX" 'mantiddocs'
77
mkdir -p build
88
cd build
99

10-
cmake \
10+
# unset LD_PRELOAD as this causes cmake to segfault
11+
LD_PRELOAD="" \
12+
cmake \
1113
${CMAKE_ARGS} \
1214
-DCMAKE_BUILD_TYPE=Release \
1315
-DCMAKE_PREFIX_PATH=$PREFIX \

conda/recipes/mantidqt/build.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ bash "${parent_dir}"/archive_env_logs.sh "$BUILD_PREFIX" "$PREFIX" 'mantidqt'
77
mkdir -p build
88
cd build
99

10-
cmake \
10+
# unset LD_PRELOAD as this causes cmake to segfault
11+
LD_PRELOAD="" \
12+
cmake \
1113
${CMAKE_ARGS} \
1214
-DCMAKE_BUILD_TYPE=Release \
1315
-DCMAKE_PREFIX_PATH=$PREFIX \

conda/recipes/mantidworkbench/build.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ bash "${parent_dir}"/archive_env_logs.sh "$BUILD_PREFIX" "$PREFIX" 'mantidworkbe
88
mkdir -p build
99
cd build
1010

11-
cmake \
11+
# unset LD_PRELOAD as this causes cmake to segfault
12+
LD_PRELOAD="" \
13+
cmake \
1214
${CMAKE_ARGS} \
1315
-DCMAKE_BUILD_TYPE=Release \
1416
-DCMAKE_PREFIX_PATH=$PREFIX \
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- ``jemalloc`` has been add to the conda activation/deactivation scripts to enable use when running just ``python``. Previously it was only applied in the workbench startup script. This should improve the performance of many algorithms.

0 commit comments

Comments
 (0)