Skip to content

Commit 455f2e4

Browse files
committed
Merge branch 'bugfix/10912_tcmalloc_no_dev_pkg' into next
2 parents 1385fe4 + e6b7099 commit 455f2e4

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

Code/Mantid/Build/CMake/LinuxPackageScripts.cmake

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,19 @@ endif()
2323
set ( CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${LIB_DIR};${CMAKE_INSTALL_PREFIX}/${PLUGINS_DIR};${CMAKE_INSTALL_PREFIX}/${PVPLUGINS_DIR} )
2424

2525
###########################################################################
26-
# LD_PRELOAD libraries
26+
# LD_PRELOAD TCMalloc
2727
###########################################################################
28-
set ( EXTRA_LDPRELOAD_LIBS "${TCMALLOC_LIBRARIES}" )
28+
# User systems will only have the libraries and not the symbolic link
29+
# so we must set the preload to the versioned library. We will assume it is
30+
# in the same location as the system that the package was built on
31+
if ( TCMALLOC_LIBRARIES )
32+
execute_process ( COMMAND readlink --no-newline --canonicalize-existing ${TCMALLOC_LIBRARIES}
33+
OUTPUT_VARIABLE TCMALLOC_PRELOAD
34+
RESULT_VARIABLE READLINK_RESULT )
35+
if ( READLINK_RESULT EQUAL 1 )
36+
message ( FATAL_ERROR "Unable to find real file that tcmalloc symlink, ${TCMALLOC_LIBRARIES}, points to." )
37+
endif()
38+
endif()
2939

3040
###########################################################################
3141
# Environment scripts (profile.d)
@@ -84,10 +94,12 @@ set ( POST_UNINSTALL_FILE ${CMAKE_CURRENT_BINARY_DIR}/postrm )
8494

8595
if ( "${UNIX_DIST}" MATCHES "RedHatEnterprise" OR "${UNIX_DIST}" MATCHES "^Fedora" ) # RHEL/Fedora
8696
if ( "${UNIX_CODENAME}" MATCHES "Santiago" ) # el6
87-
set ( WRAPPER_COMMAND "scl enable mantidlibs" )
97+
set ( WRAPPER_PREFIX "scl enable mantidlibs \"" )
98+
set ( WRAPPER_POSTFIX "\"" )
8899
set ( EXTRA_LDPATH "/usr/lib64/paraview" )
89100
else()
90-
set ( WRAPPER_COMMAND "eval" )
101+
set ( WRAPPER_PREFIX "" )
102+
set ( WRAPPER_POSTFIX "" )
91103
endif()
92104

93105
if ( NOT MPI_BUILD )
@@ -106,7 +118,8 @@ if ( "${UNIX_DIST}" MATCHES "RedHatEnterprise" OR "${UNIX_DIST}" MATCHES "^Fedor
106118
set ( CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE ${POST_UNINSTALL_FILE} )
107119
endif()
108120
elseif ( "${UNIX_DIST}" MATCHES "Ubuntu" )
109-
set ( WRAPPER_COMMAND "eval" )
121+
set ( WRAPPER_PREFIX "" )
122+
set ( WRAPPER_POSTFIX "" )
110123

111124
if ( NOT MPI_BUILD )
112125
configure_file ( ${CMAKE_MODULE_PATH}/Packaging/deb/scripts/deb_pre_inst.in

Code/Mantid/Build/CMake/Packaging/launch_mantidplot.sh.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ SCRIPTFILE=$(readlink -f "$0")
99
INSTALLDIR=$(echo $SCRIPTFILE | sed -r -e 's|^(.*)/(.*)$|\1|g') #.* is greedy and eats up until the final slash
1010

1111
# Define extra libraries and load paths
12-
LOCAL_PRELOAD=$(readlink -f @EXTRA_LDPRELOAD_LIBS@)
12+
LOCAL_PRELOAD=@TCMALLOC_PRELOAD@
1313
if [ -n "${LD_PRELOAD}" ]; then
1414
LOCAL_PRELOAD=${LOCAL_PRELOAD}:${LD_PRELOAD}
1515
fi
@@ -21,4 +21,4 @@ else
2121
fi
2222

2323
# Launch
24-
LD_PRELOAD=${LOCAL_PRELOAD} TCMALLOC_RELEASE_RATE=${TCM_RELEASE} LD_LIBRARY_PATH=${LOCAL_LDPATH} @WRAPPER_COMMAND@ "$INSTALLDIR/@MANTIDPLOT_EXEC@ $*"
24+
LD_PRELOAD=${LOCAL_PRELOAD} TCMALLOC_RELEASE_RATE=${TCM_RELEASE} LD_LIBRARY_PATH=${LOCAL_LDPATH} @WRAPPER_PREFIX@$INSTALLDIR/@MANTIDPLOT_EXEC@ $*@WRAPPER_POSTFIX@

0 commit comments

Comments
 (0)