From ea61e98aed4316bda8b156aea5980b08eaf4302b Mon Sep 17 00:00:00 2001 From: schaerer Date: Tue, 23 Mar 2010 16:30:59 +0000 Subject: [PATCH] mechanism for hiding experimental stuff in vv --- CMakeLists.txt | 3 +- common/CMakeLists.txt | 2 ++ common/clitkCommon.h | 2 ++ fast_make.sh | 66 +++++++++++++++++++++---------------------- 4 files changed, 39 insertions(+), 34 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e121c6..e34db9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,9 +67,10 @@ ENDIF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR}) #========================================================= OPTION(CLITK_BUILD_VV "Build vv the 4D visualizer (requires VTK and QT)" ON) OPTION(CLITK_BUILD_TOOLS "Build command-line tools" OFF) +OPTION(CLITK_EXPERIMENTAL "Enable experimental software and features" OFF) #========================================================= -include_directories(itk filters) +include_directories(itk filters ${PROJECT_BINARY_DIR}) #========================================================= add_subdirectory(common) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 93c9a01..e40a81f 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -8,6 +8,8 @@ INCLUDE(${PROJECT_SOURCE_DIR}/cmake/common.cmake) #========================================================= # make clitk libraries* +configure_file(clitkConfiguration.h.in ${PROJECT_BINARY_DIR}/clitkConfiguration.h) + SET(clitkCommon_SRC clitkCommon.cxx clitkListOfPair.cxx diff --git a/common/clitkCommon.h b/common/clitkCommon.h index 3a12a00..5820966 100644 --- a/common/clitkCommon.h +++ b/common/clitkCommon.h @@ -12,6 +12,8 @@ -------------------------------------------------------------------*/ // clitk include + +#include "clitkConfiguration.h" #include "clitkPortability.h" // itk include (include std) diff --git a/fast_make.sh b/fast_make.sh index deb86d6..2007b0b 100755 --- a/fast_make.sh +++ b/fast_make.sh @@ -35,38 +35,38 @@ nice -n12 ionice -c3 make -j ${cpus} $@ & make_pid=$(jobs -p %nice) #watch memory use to avoid crashes -while ps $make_pid >>/dev/null -do - if [ x"$(ps aux | grep cc1plus | grep -v grep | wc -l)" != x0 ] - then - ps ax -o vsize,comm | grep cc1plus | grep -o "\<[0-9]*\>" > mem_use - used_mem=$(awk 'BEGIN {sum=0;} {sum+=$1;} END {print sum;}' mem_use) - if (( "$used_mem"> ($available_mem - 300) )) - then - touch memory_exhausted_lock - echo "Stopping due to exagerated memory use ( $used_mem )" - handle_exit - elif (( "$used_mem"> ($available_mem/2) )) - then - if [ x$high_mem != xtrue ] - then - echo "Warning, high memory use, not spawning any more compilation jobs... ( $used_mem )" - killall -s SIGSTOP make - killall -s SIGCONT cc1plus - high_mem="true" - date_mem=$(date +%s) - fi - echo mem $used_mem / $available_mem - elif [ x$high_mem = xtrue ] && (( $(date +%s) > ( $date_mem + 5 ) )) - then - echo "Memory use back to normal" - high_mem="" - killall -s SIGCONT make - fi - rm mem_use - fi - sleep 1 -done -rm memory_exhausted_lock 2>>/dev/null +#while ps $make_pid >>/dev/null +#do +# if [ x"$(ps aux | grep cc1plus | grep -v grep | wc -l)" != x0 ] +# then +# ps ax -o vsize,comm | grep cc1plus | grep -o "\<[0-9]*\>" > mem_use +# used_mem=$(awk 'BEGIN {sum=0;} {sum+=$1;} END {print sum;}' mem_use) +# if (( "$used_mem"> ($available_mem - 300) )) +# then +# touch memory_exhausted_lock +# echo "Stopping due to exagerated memory use ( $used_mem )" +# handle_exit +# elif (( "$used_mem"> ($available_mem/2) )) +# then +# if [ x$high_mem != xtrue ] +# then +# echo "Warning, high memory use, not spawning any more compilation jobs... ( $used_mem )" +# killall -s SIGSTOP make +# killall -s SIGCONT cc1plus +# high_mem="true" +# date_mem=$(date +%s) +# fi +# echo mem $used_mem / $available_mem +# elif [ x$high_mem = xtrue ] && (( $(date +%s) > ( $date_mem + 5 ) )) +# then +# echo "Memory use back to normal" +# high_mem="" +# killall -s SIGCONT make +# fi +# rm mem_use +# fi +# sleep 1 +#done +#rm memory_exhausted_lock 2>>/dev/null echo Done! echo -- 2.45.1