@ -562,9 +562,35 @@ if (STORM_USE_INTELTBB)
message ( STATUS "Storm - Found Intel TBB with interface version ${TBB_INTERFACE_VERSION}." )
message ( STATUS "Storm - Found Intel TBB with interface version ${TBB_INTERFACE_VERSION}." )
message ( STATUS "Storm - Linking with Intel TBB in ${TBB_LIBRARY_DIRS}." )
message ( STATUS "Storm - Linking with Intel TBB in ${TBB_LIBRARY_DIRS}." )
set ( STORM_HAVE_INTELTBB ON )
set ( STORM_HAVE_INTELTBB ON )
link_directories ( ${ TBB_LIBRARY_DIRS } )
include_directories ( ${ TBB_INCLUDE_DIRS } )
list ( APPEND STORM_LINK_LIBRARIES tbb tbbmalloc )
# U n d e r L i n u x l i b t b b . s o c o n t a i n s a l i n k e r s c r i p t t o l i b t b b . s o . 2 i n s t e a d o f a s y m l i n k .
# T h i s b r e a k s C M a k e .
# A s a w o r k a r o u n d w e m a n u a l l y t r y t o a d d t h e n e c e s s a r y s u f f i x " . 2 " t o t h e s o f i l e a n d h o p e f o r t h e b e s t .
if ( LINUX )
# C h e c k i f t h e l i b r a r y i s a l i n k e r s c r i p t w h i c h o n l y l i n k s t o t h e c o r r e c t l i b r a r y
# R e a d f i r s t b y t e s o f f i l e
file ( READ "${TBB_LIBRARY}" TMPTXT LIMIT 128 )
# C h e c k i f f i l e s t a r t s w i t h " INPUT ( libtbb.so.2 ) "
if ( "${TMPTXT}" MATCHES "INPUT \\(libtbb\\.so\\.(.*)\\)" )
# M a n u a l l y s e t l i b r a r y b y a d d i n g t h e s u f f i x f r o m t h e l i n k e r s c r i p t .
# C M A K E _ M A T C H _ 1 c o n t a i n s t h e p a r s e d s u f f i x .
set ( TBB_LIB_LINUX "${TBB_LIBRARY}.${CMAKE_MATCH_1}" )
set ( TBB_MALLOC_LIB_LINUX "${TBB_MALLOC_LIBRARY}.${CMAKE_MATCH_1}" )
if ( EXISTS "${TBB_LIB_LINUX}" )
set ( TBB_LIBRARY ${ TBB_LIB_LINUX } )
message ( STATUS "Storm - Using Intel TBB library in manually set path ${TBB_LIBRARY}." )
endif ( )
if ( EXISTS "${TBB_MALLOC_LIB_LINUX}" )
set ( TBB_MALLOC_LIBRARY ${ TBB_MALLOC_LIB_LINUX } )
message ( STATUS "Storm - Using Intel TBB malloc library in manually set path ${TBB_MALLOC_LIBRARY}." )
endif ( )
endif ( )
endif ( )
add_imported_library ( tbb SHARED ${ TBB_LIBRARY } ${ TBB_INCLUDE_DIRS } )
list ( APPEND STORM_DEP_TARGETS tbb_SHARED )
add_imported_library ( tbb_malloc SHARED ${ TBB_MALLOC_LIBRARY } ${ TBB_INCLUDE_DIRS } )
list ( APPEND STORM_DEP_TARGETS tbb_malloc_SHARED )
else ( TBB_FOUND )
else ( TBB_FOUND )
message ( FATAL_ERROR "Storm - TBB was requested, but not found." )
message ( FATAL_ERROR "Storm - TBB was requested, but not found." )
endif ( TBB_FOUND )
endif ( TBB_FOUND )