Skip to content

Commit

Permalink
Also place NeXus first in linker list in Kernel for gcc 4.4
Browse files Browse the repository at this point in the history
If it is not after stdc++ then we get a crash in Python when accessing
the C api.
Refs #7798
  • Loading branch information
martyngigg committed Aug 8, 2014
1 parent 691e8a9 commit 20230fa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Code/Mantid/Framework/Kernel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -363,13 +363,15 @@ set_target_properties ( Kernel PROPERTIES OUTPUT_NAME MantidKernel
set_property ( TARGET Kernel PROPERTY FOLDER "MantidFramework" )

# Using gcc, for tcmalloc to report the correct memory usage we must link it first.
# However, if we do not put stdc++ first on gcc 4.4 systems then things crash when an exceptions are thrown in Python
# If we are not using tcmalloc then the variable is empty and it makes no difference
# However, if we do not put stdc++ first on gcc 4.4 systems then things crash when an
# exceptions are thrown in Python and if libnexus is not second then we get a crash when
# accessing the nexus C api.
# If we are not using tcmalloc then the variable is empty and it makes no difference.
if ( GCC_COMPILER_VERSION )
if ( GCC_COMPILER_VERSION VERSION_GREATER "4.5" )
target_link_libraries ( Kernel ${TCMALLOC_LIBRARY} stdc++ )
else ()
target_link_libraries ( Kernel stdc++ ${TCMALLOC_LIBRARY} )
target_link_libraries ( Kernel stdc++ ${NEXUS_C_LIBRARIES} ${TCMALLOC_LIBRARY} )
endif()
endif()

Expand Down

0 comments on commit 20230fa

Please sign in to comment.