Commit 41832b5b authored by dino's avatar dino
Browse files

generate fake lost revision 1268

git-svn-id: svn://gal-serv.lnl.infn.it/agata/trunk/narval_emulator@1268 170316e4-aea8-4b27-aad4-0380ec0519c9
parent 36514ffe
......@@ -86,9 +86,9 @@ find_package(ADF REQUIRED)
# Find module using simple test
include(AGAPROMacroUtilities)
include(AGAPROSearchInstalledSoftware)
#
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
#
MESSAGE("[AGAPRO]")
......@@ -122,6 +122,11 @@ endif()
# Add modules
#
ADD_DEFINITIONS(-DHAS_AGAPROCONFIG)
if ( HAS_C11 )
MESSAGE("[AGAPRO] C++11 FOUND ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
endif()
#
add_subdirectory(common)
add_subdirectory(builders)
......@@ -134,10 +139,14 @@ TODAY(CDATE)
file(APPEND ${AGATASOFTWARE_TOP_DIR}/CMAKE_LOG_FILE "CMAKE has been called: ${CDATE}")
#
if ( UNIX )
if( HAS_BOOST )
SET(BOOST_MESSAGE "Compiled with BOOST")
if( HAS_C11 )
SET(THREAD_MESSAGE "Compiled with C++11 thread" )
else()
SET(BOOST_MESSAGE "Compiled without BOOST")
if ( HAS_BOOST )
SET(THREAD_MESSAGE "Compiled with BOOST thread")
else()
SET(THREAD_MESSAGE "Compiled without thread")
endif()
endif()
find_package(Subversion)
IF(SUBVERSION_FOUND)
......@@ -150,7 +159,7 @@ if ( UNIX )
COMMAND ${CMAKE_COMMAND} -E echo "at " >> LAST_AGAPRO_MAKE_LOG
COMMAND date >> LAST_AGAPRO_MAKE_LOG
COMMAND ${CMAKE_COMMAND} -E echo ${SUBVERSION_LOG} >> LAST_AGAPRO_MAKE_LOG
COMMAND ${CMAKE_COMMAND} -E echo ${BOOST_MESSAGE} >> LAST_AGAPRO_MAKE_LOG
COMMAND ${CMAKE_COMMAND} -E echo ${THREAD_MESSAGE} >> LAST_AGAPRO_MAKE_LOG
COMMENT " Call log target to trackback last building "
)
endif()
......
......@@ -5,6 +5,7 @@ PROJECT(femul)
################################################################
# Type of build
set( CMAKE_BUILD_TYPE "Release" )
#set( CMAKE_BUILD_TYPE "Debug" )
################################################################
# Where FIND_PACKAGE should search "non-distribution" FindXxxx.cmake
......@@ -17,13 +18,15 @@ ADD_DEFINITIONS( -DNRV_TYPE=NRV_OFFLINE )
################################################################
# Select the threads library as THR_NONE, THR_BOOST or THR_STD
if( 1 ) # 0 to select from command line ( e.g. cmake . -DTHR_TYPE=THR_STD )
set( THR_TYPE THR_STD ) # default
set( THR_TYPE THR_BOOST ) # default
endif()
if( NOT DEFINED THR_TYPE ) # in case default not set and nothing given from command line
set( THR_TYPE THR_NONE )
endif()
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
if( THR_TYPE STREQUAL THR_NONE)
message( "Not Using threads ==> ${THR_TYPE}" )
elseif(THR_TYPE STREQUAL THR_BOOST)
......@@ -35,7 +38,7 @@ elseif(THR_TYPE STREQUAL THR_BOOST)
elseif(THR_TYPE STREQUAL THR_STD)
message("Using std::thread ==> ${THR_TYPE}" )
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") # should check if compiler supports
SET(CMAKE_CPP_FLAGS "${CMAKE_CPP_FLAGS} -std=c++11")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
if( 0 )
# these 3 lines needed if building on anodes at ganil using THR_STD
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++") # because after updating to gcc 4.7.4 they have not updated libstdc
......
......@@ -737,7 +737,8 @@ bool topologyRead(string topo)
ChainOfActors * pChain = theChains[nc];
for(int na = 0; na < pChain->numActors; na++) {
actor *pActor = &pChain->theActors[na];
pActor->sizeOut = pChain->ioBuffsSize;
if(na)
pActor->sizeOut = pChain->ioBuffsSize; // in this way it is possible to have a smaller size for producer
#if 0
// Tests on the size of the ioBuffers, done in the attempt to avoid buffer overflow in the filters
// No more needed because ChainOfActors::Run() gives only 3/4 of the actual size to PRODUCERs and BUILDERs
......
......@@ -19,42 +19,60 @@ endif()
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
# THREAD SUPPORT.
#
if ( NOT WITHOUT_BOOST )
# find_package(Boost QUIET COMPONENTS thread)
find_package(Boost QUIET COMPONENTS system thread)
# find_package(Boost COMPONENTS system filesystem thread REQUIRED)
endif()
# TRY FIRST Cxx11. IF NOT, try boost.
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" CHECK_CXX_FLAG_C11)
IF(CHECK_CXX_FLAG_C11)
SET(IS_C11_OK ON)
MESSAGE("[AGAPRO] Compilation with c++11 thread support possible ...")
ENDIF()
#
# if WITHOUT_BOOST is given explicitely, it means even if boost installed, it is not used ==> HAS_BOOST
# Otherwise HAS_BOOST set to ON
#
if ( NOT WITHOUT_BOOST ) # to not use Boost even if installed
if ( Boost_FOUND )
MESSAGE("[AGAPRO] Compilation with boost found on your system")
SET(HAS_BOOST ON)
else()
# not found traditionally, just check if boost is in AGATASOFTWARE_TOP_DIR, if defined
# check boost
find_package(Boost QUIET COMPONENTS system thread)
if ( Boost_FOUND )
MESSAGE("[AGAPRO] Compilation with boost [thread], found on your system, possible ...")
SET(IS_BOOST_OK ON)
else(Boost_FOUND)
# not found traditionally, just check if boost is in AGATASOFTWARE_TOP_DIR, if defined
if ( AGATASOFTWARE_TOP_DIR )
if (EXISTS ${AGATASOFTWARE_TOP_DIR}/include/boost )
MESSAGE("[AGAPRO] Compilation with boost installed in agapro")
if ( EXISTS ${AGATASOFTWARE_TOP_DIR}/include/boost )
MESSAGE("[AGAPRO] Compilation with boost [thread], installed in agapro, possible ...")
SET(IS_BOOST_OK ON)
endif()
endif()
endif(Boost_FOUND)
if ( GUESS_THREAD )
if (IS_C11_OK)
MESSAGE("[AGAPRO] Compilation with c++11 thread support")
SET(HAS_C11 ON)
else()
if (IS_BOOST_OK)
MESSAGE("[AGAPRO] Compilation with boost thread support")
SET(HAS_BOOST ON)
else ()
MESSAGE("[AGAPRO] Compilation with thread support not possible !")
endif ()
endif()
else(GUESS_THREAD)
if ( IS_C11_OK )
if ( WITH_CPP_THREAD )
MESSAGE("[AGAPRO] Compilation with c++11 thread support")
SET(HAS_C11 ON)
endif ()
else()
MESSAGE("[AGAPRO] Compilation without boost")
SET(HAS_BOOST OFF)
if ( IS_BOOST_OK )
if ( WITH_BOOST_THREAD )
MESSAGE("[AGAPRO] Compilation with boost thread support")
SET(HAS_BOOST ON)
endif()
else ()
MESSAGE("[AGAPRO] Compilation with thread support not possible !")
endif ()
endif()
else()
MESSAGE("[AGAPRO] Compilation without boost")
SET(HAS_BOOST OFF)
endif()
if ( HAS_BOOST )
MESSAGE("[AGAPRO] Boost in ${Boost_LIBRARY_DIRS} ")
endif()
#
#----------------------------------------------------------------------------
endif(GUESS_THREAD)
#----------------------------------------------------------------------------
# Search skstream-0.3 : Not mandatory
......@@ -104,7 +122,6 @@ IF(CHECK_CXX_FLAG_msse4)
ELSE()
MESSAGE("[AGAPRO] Compilation without msse4")
ENDIF()
#----------------------------------------------------------------------------
......@@ -4,6 +4,7 @@
#cmakedefine HAS_BOOST
#cmakedefine HAS_SKSTREAM
#cmakedefine HAS_SSE
#cmakedefine HAS_C11
//////////////////////////////
////// Define OS_TYPE ////////
......@@ -36,4 +37,35 @@
#endif
#endif
//////////////////////////////////////////////
//////// Choose your version of threads //////
//////////////////////////////////////////////
#define THR_NONE 0 // no threads
#define THR_BOOST 1 // using boost c++ libraries
#define THR_STD 2 // using std in c++11 (if supported by compiler)
// THR_TYPE should be defined in the project
#define THR_TYPE @CMAKE_THR_TYPE@
#if THR_TYPE == THR_BOOST
#define thrLib boost
#define thrYield() ( thrLib::this_thread::yield() )
#define thrSleep(msecs) ( thrLib::this_thread::sleep(thrLib::posix_time::milliseconds(msecs)) )
#define thrLock thrLib::mutex::scoped_lock
#elif THR_TYPE == THR_STD
#define thrLib std
#define thrYield() ( thrLib::this_thread::yield() )
#define thrSleep(msecs) ( thrLib::this_thread::sleep_for(thrLib::chrono::milliseconds(msecs)) )
#define thrLock thrLib::unique_lock<std::mutex>
#elif THR_TYPE == THR_NONE
#define thrLib
#define thrYield()
#define thrSleep(msecs)
#define thrLock
#else
#error THR_TYPE should be either THR_BOOST, THR_STD or THR_NONE
#endif
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment