Skip to content

Commit

Permalink
Merge branch 'bugfix/10912_tcmalloc_no_dev_pkg' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
martyngigg committed Jan 16, 2015
2 parents 1385fe4 + e6b7099 commit 455f2e4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
23 changes: 18 additions & 5 deletions Code/Mantid/Build/CMake/LinuxPackageScripts.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,19 @@ endif()
set ( CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${LIB_DIR};${CMAKE_INSTALL_PREFIX}/${PLUGINS_DIR};${CMAKE_INSTALL_PREFIX}/${PVPLUGINS_DIR} )

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

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

if ( "${UNIX_DIST}" MATCHES "RedHatEnterprise" OR "${UNIX_DIST}" MATCHES "^Fedora" ) # RHEL/Fedora
if ( "${UNIX_CODENAME}" MATCHES "Santiago" ) # el6
set ( WRAPPER_COMMAND "scl enable mantidlibs" )
set ( WRAPPER_PREFIX "scl enable mantidlibs \"" )
set ( WRAPPER_POSTFIX "\"" )
set ( EXTRA_LDPATH "/usr/lib64/paraview" )
else()
set ( WRAPPER_COMMAND "eval" )
set ( WRAPPER_PREFIX "" )
set ( WRAPPER_POSTFIX "" )
endif()

if ( NOT MPI_BUILD )
Expand All @@ -106,7 +118,8 @@ if ( "${UNIX_DIST}" MATCHES "RedHatEnterprise" OR "${UNIX_DIST}" MATCHES "^Fedor
set ( CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE ${POST_UNINSTALL_FILE} )
endif()
elseif ( "${UNIX_DIST}" MATCHES "Ubuntu" )
set ( WRAPPER_COMMAND "eval" )
set ( WRAPPER_PREFIX "" )
set ( WRAPPER_POSTFIX "" )

if ( NOT MPI_BUILD )
configure_file ( ${CMAKE_MODULE_PATH}/Packaging/deb/scripts/deb_pre_inst.in
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Build/CMake/Packaging/launch_mantidplot.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SCRIPTFILE=$(readlink -f "$0")
INSTALLDIR=$(echo $SCRIPTFILE | sed -r -e 's|^(.*)/(.*)$|\1|g') #.* is greedy and eats up until the final slash

# Define extra libraries and load paths
LOCAL_PRELOAD=$(readlink -f @EXTRA_LDPRELOAD_LIBS@)
LOCAL_PRELOAD=@TCMALLOC_PRELOAD@
if [ -n "${LD_PRELOAD}" ]; then
LOCAL_PRELOAD=${LOCAL_PRELOAD}:${LD_PRELOAD}
fi
Expand All @@ -21,4 +21,4 @@ else
fi

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

0 comments on commit 455f2e4

Please sign in to comment.