@@ -23,9 +23,19 @@ endif()
23
23
set ( CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX} /${LIB_DIR};${CMAKE_INSTALL_PREFIX}/${PLUGINS_DIR};${CMAKE_INSTALL_PREFIX}/${PVPLUGINS_DIR} )
24
24
25
25
###########################################################################
26
- # LD_PRELOAD libraries
26
+ # LD_PRELOAD TCMalloc
27
27
###########################################################################
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 ()
29
39
30
40
###########################################################################
31
41
# Environment scripts (profile.d)
@@ -84,10 +94,12 @@ set ( POST_UNINSTALL_FILE ${CMAKE_CURRENT_BINARY_DIR}/postrm )
84
94
85
95
if ( "${UNIX_DIST} " MATCHES "RedHatEnterprise" OR "${UNIX_DIST} " MATCHES "^Fedora" ) # RHEL/Fedora
86
96
if ( "${UNIX_CODENAME} " MATCHES "Santiago" ) # el6
87
- set ( WRAPPER_COMMAND "scl enable mantidlibs" )
97
+ set ( WRAPPER_PREFIX "scl enable mantidlibs \" " )
98
+ set ( WRAPPER_POSTFIX "\" " )
88
99
set ( EXTRA_LDPATH "/usr/lib64/paraview" )
89
100
else ()
90
- set ( WRAPPER_COMMAND "eval" )
101
+ set ( WRAPPER_PREFIX "" )
102
+ set ( WRAPPER_POSTFIX "" )
91
103
endif ()
92
104
93
105
if ( NOT MPI_BUILD )
@@ -106,7 +118,8 @@ if ( "${UNIX_DIST}" MATCHES "RedHatEnterprise" OR "${UNIX_DIST}" MATCHES "^Fedor
106
118
set ( CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE ${POST_UNINSTALL_FILE} )
107
119
endif ()
108
120
elseif ( "${UNIX_DIST} " MATCHES "Ubuntu" )
109
- set ( WRAPPER_COMMAND "eval" )
121
+ set ( WRAPPER_PREFIX "" )
122
+ set ( WRAPPER_POSTFIX "" )
110
123
111
124
if ( NOT MPI_BUILD )
112
125
configure_file ( ${CMAKE_MODULE_PATH} /Packaging/deb/scripts/deb_pre_inst.in
0 commit comments