# Try build.sh -h for more details about usage.
#
# Last update: 13/12/2013: porting SALOME build procedure to CMake
-# TODO:
-# - get back verbosity option which is currently switched off
#
####################################################################################
# default installation directory
def_install_dir="$(pwd)/INSTALL"
-# default verbosity level
-def_verbosity_level=0
# default modules list
def_modules=""
def_modules="${def_modules} KERNEL GUI GEOM MED SMESH PARAVIS YACS HOMARD HEXABLOCK JOBMANAGER"
echo ""
echo "-p <PREFIX> Specify installation directory."
echo " Default: ${def_install_dir}."
-# echo ""
-# echo "-v <LEVEL> Specify verbosity level:"
-# echo " 0 - show only errors;"
-# echo " 1 - show errors and warnings."
-# echo " Default: ${def_verbosity_level}."
echo ""
echo "-D<OPT>=<VAL> Specify additional options to be passed to CMake command."
echo ""
is_delete=0
build_devdocs=0
prefix=
-verbosity=${def_verbosity_level}
nbjobs=
cmake_options=
fi
break
;;
- v ) verbosity=${ov}
- if [ "${verbosity}" = "" ] ; then
- wait_arg=1
- wait_opt=v
- fi
- break
- ;;
j ) nbjobs=${ov}
if [ "${nbjobs}" = "" ] ; then
wait_arg=1
elif [ "${wait_opt}" != "" ] ; then
case ${wait_opt} in
p ) prefix=${o} ;;
- v ) verbosity=${o} ;;
j ) nbjobs=${o} ;;
* ) error_exit "unknown option -- ${wait_opt}" ;;
esac
echo
echo "====== debug script: options: begin ====="
echo "prefix=$prefix"
- echo "verbosity=$verbosity"
echo "nbjobs=$nbjobs"
echo "cmake_options=$cmake_options"
echo "modules=$modules"
( cd ${module_build} && cmake ${module_src} -DCMAKE_INSTALL_PREFIX=${px} ${module_cmake_options} >> ${LOG_DIR}/${module}_cmake.log 2>&1 )
sts=$?
- # print errors/warnings
- if [ ${verbosity} -gt 0 ] ; then
- cat ${LOG_DIR}/${module}_cmake.log | grep -iE ": (warning|error):" >&2
- else
- cat ${LOG_DIR}/${module}_cmake.log | grep ": error:" >&2
- fi
-
# stop if there were any errors
if [ "${sts}" != "0" ] ; then
- echo "Error: cmake failed."
+ echo "Error: cmake failed; see ${LOG_DIR}/${module}_cmake.log for more details."
continue
fi
( cd ${module_build} && make ${nbjobs} >> ${LOG_DIR}/${module}_make.log 2>&1 )
sts=$?
- # print errors/warnings
- #-------------------------------------------------------------------------
- # print compiler errors and warnings
- # Note: here awk is used to concatenate together several lines of single
- # error or warning message produced by stupid gnu compiler
- # Actually, instead of that we could use 'fmessage length=n' option of g++...
- #-------------------------------------------------------------------------
- cat ${LOG_DIR}/${module}_make.log | grep -Ei '[*][*][*].*error' >&2
- if [ ${verbosity} -gt 0 ] ; then
- cat ${LOG_DIR}/${module}_make.log | awk 'substr($0,0,1)!=" " {print ""} {print $0} END {print ""}' | grep -E ": warning|* Warning|${module_src}/[A-Za-z_0-9./]*:" | sed s@"^${module_src}/src/"@@ >&2
- fi
-
# stop if there were any errors
if [ "${sts}" != "0" ] ; then
- echo "Error: make failed."
+ echo "Error: make failed; see ${LOG_DIR}/${module}_make.log for more details."
continue
fi
echo "make dev_docs" >> ${LOG_DIR}/${module}_make_devdocs.log
echo "========================================================================" >> ${LOG_DIR}/${module}_make_devdocs.log
( cd ${module_build} && make dev_docs >> ${LOG_DIR}/${module}_make_devdocs.log 2>&1 )
- cat ${LOG_DIR}/${module}_make_devdocs.log | grep '[*][*][*]' >&2
+ sts=$?
+
+ if [ "${sts}" != "0" ] ; then
+ echo "Warning: make dev_docs failed; see ${LOG_DIR}/${module}_make_devdocs.log for more details."
+ fi
fi
fi
sts=$?
if [ "${sts}" != "0" ] ; then
- echo "Error: make install failed."
+ echo "Error: make install failed; see ${LOG_DIR}/${module}_make_install.log for more details."
continue
fi