#=========================================================
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)
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