From 4198954dfe9df8cc1fbcb8aaa2925d314e496c04 Mon Sep 17 00:00:00 2001 From: inv Date: Wed, 6 Jun 2012 08:24:25 +0000 Subject: [PATCH] SALOME 6.5.0 preparation: correct build.sh and build.csh scripts to unset VTK_AUTOLOAD_PATH variable when building PARAVIS, 'cause otherwise there's a SIGSEGV on make step. --- config_files/build.csh | 427 +++++++++++++++++++++-------------------- config_files/build.sh | 50 +++-- 2 files changed, 246 insertions(+), 231 deletions(-) diff --git a/config_files/build.csh b/config_files/build.csh index feec243..8eb0a32 100755 --- a/config_files/build.csh +++ b/config_files/build.csh @@ -200,253 +200,258 @@ echo "========================================================================== # loop for all given modules ######################################################### foreach module (${modules}) - echo ">>> Processing ${module} module" + echo ">>> Processing ${module} module" - set module_src=`printenv ${module}_SRC_DIR` - set module_build=${BUILD_DIR}/${module}_BUILD + set module_src=`printenv ${module}_SRC_DIR` + set module_build=${BUILD_DIR}/${module}_BUILD - if ( ${module_src} != "" ) then - cd ${BUILD_DIR} - ######################################################### - # check if sources directory exists - ######################################################### - if ( ! -e ${module_src} ) then - echo "\!\!\! Error \!\!\! Can't find sources directory: ${module_src} does not exist." - continue - endif - ######################################################### - # check if configure script exists - ######################################################### - set cfg_exist=0 - if ( -e ${module_src}/configure ) then - set cfg_exist=1 - endif - ######################################################### - # perform build_configure if -b flag is given or if - # configure script does not exist (first compilation?) - ######################################################### - if ( $is_build_configure == 1 || $cfg_exist == 0 ) then - echo "... Performing build_configure" + if ( ${module_src} != "" ) then + cd ${BUILD_DIR} ######################################################### - # check if build_configure script exists + # check if sources directory exists ######################################################### - if ( ! -e ${module_src}/build_configure && "${module}" != "PARAVIS" ) then - echo "\!\!\! Warning \!\!\! Can not find build_configure script in ${module_src}." - else - if ( "${module}" == "PARAVIS" ) then - echo "\!\!\! Warning \!\!\! build_configure step is not executed for ${module}." - else + if ( ! -e ${module_src} ) then + echo "\!\!\! Error \!\!\! Can't find sources directory: ${module_src} does not exist." + continue + endif + ######################################################### + # check if configure script exists + ######################################################### + set cfg_exist=0 + if ( -e ${module_src}/configure ) then + set cfg_exist=1 + endif + ######################################################### + # perform build_configure if -b flag is given or if + # configure script does not exist (first compilation?) + ######################################################### + if ( $is_build_configure == 1 || $cfg_exist == 0 ) then + echo "... Performing build_configure" ######################################################### - # call build_configure + # check if build_configure script exists ######################################################### - if (! ($?BUILDCONF_OPTS) ) then - set mybuildconf_keys="" + if ( ! -e ${module_src}/build_configure && "${module}" != "PARAVIS" ) then + echo "\!\!\! Warning \!\!\! Can not find build_configure script in ${module_src}." else - set mybuildconf_keys="${BUILDCONF_OPTS}" - endif - if ( $inst_with_gui == 0 ) then - set mybuildconf_keys="${mybuildconf_keys} --without-gui" - endif - cd ${module_src} - ./build_configure ${mybuildconf_keys} >& ${LOG_DIR}/build_configure_${module}.log - ######################################################### - # echo possible errors - ######################################################### - if ( $verbose_level > 0 ) then - cat ${LOG_DIR}/build_configure_${module}.log | grep -E "(failed|: error:)" >/dev/stderr + if ( "${module}" == "PARAVIS" ) then + echo "\!\!\! Warning \!\!\! build_configure step is not executed for ${module}." + else + ######################################################### + # call build_configure + ######################################################### + if (! ($?BUILDCONF_OPTS) ) then + set mybuildconf_keys="" + else + set mybuildconf_keys="${BUILDCONF_OPTS}" + endif + if ( $inst_with_gui == 0 ) then + set mybuildconf_keys="${mybuildconf_keys} --without-gui" + endif + cd ${module_src} + ./build_configure ${mybuildconf_keys} >& ${LOG_DIR}/build_configure_${module}.log + ######################################################### + # echo possible errors + ######################################################### + if ( $verbose_level > 0 ) then + cat ${LOG_DIR}/build_configure_${module}.log | grep -E "(failed|: error:)" + endif + endif endif endif + ######################################################### + # deleting build directory if -d flag is given + ######################################################### + if ( -e ${module_build} && $is_delete == 1 ) then + echo "... Removing ${module_build}" + chmod -R +w ${module_build} && rm -rf ${module_build} >& /dev/null + if ( "$?" != "0" ) then + echo "\!\!\! Warning \!\!\! Cannot remove build directory ${module_build}. Permission denied." + endif endif - endif - ######################################################### - # deleting build directory if -d flag is given - ######################################################### - if ( -e ${module_build} && $is_delete == 1 ) then - echo "... Removing ${module_build}" - chmod -R +w ${module_build} && rm -rf ${module_build} >& /dev/null - if ( "$?" != "0" ) then - echo "\!\!\! Warning \!\!\! Cannot remove build directory ${module_build}. Permission denied." - endif - endif - ######################################################### - # creating build directory if it does not exist - ######################################################### - if ( ! -e ${module_build} ) then - mkdir -p ${module_build} >& /dev/null - if ( "$?" != "0" ) then - echo "\!\!\! Error \!\!\! Cannot create build directory ${module_build}. Permission denied." - continue + ######################################################### + # creating build directory if it does not exist + ######################################################### + if ( ! -e ${module_build} ) then + mkdir -p ${module_build} >& /dev/null + if ( "$?" != "0" ) then + echo "\!\!\! Error \!\!\! Cannot create build directory ${module_build}. Permission denied." + continue + endif endif - endif - cd ${module_build} - ######################################################### - # check if top Makefile exists in build directory, i.e. - # is it necessary to run configure script - ######################################################### - set mkfile_exist=0 - if ( -e ${module_build}/Makefile ) then - set mkfile_exist=1 - endif - ######################################################### - # check if configure options are changed from the - # previous launch - ######################################################### - set opts_changed=0 -## if ( -f ${module_build}/config.log ) then -## set old_prefix=`grep -e '^prefix=' ${module_build}/config.log | sed -e "s%^prefix='\(.*\)'%\1%"` -## if ( "$old_prefix" != "$prefix" ) then -## set opts_changed=1 -## endif -## endif - ######################################################### - # define installation directory (by using module's version - # number); default is a build directory - ######################################################### - set vx="" - if ( -e ${module_src}/configure.ac ) then - set vx=`grep -e "^AC_INIT" ${module_src}/configure.ac | sed -e "s%.*\[\([[:digit:].]*\)\].*%\1%g"` - else if ( -e ${module_src}/configure.in.base ) then - set vx=`grep -e "^VERSION=" ${module_src}/configure.in.base | awk -F= '{ if (NF>1) print $NF; }' | tr -d '[:space:]'` - if ( "$vx" == "" ) then - set vx=`grep -e "^AC_INIT" ${module_src}/configure.in.base | sed -e "s%.*\[\([[:digit:].]*\)\].*%\1%g"` + cd ${module_build} + ######################################################### + # check if top Makefile exists in build directory, i.e. + # is it necessary to run configure script + ######################################################### + set mkfile_exist=0 + if ( -e ${module_build}/Makefile ) then + set mkfile_exist=1 endif - else if ( -e ${module_src}/CMakeLists.txt ) then + ######################################################### + # check if configure options are changed from the + # previous launch + ######################################################### + set opts_changed=0 + ######################################################### + # define installation directory (by using module's version + # number); default is a build directory + ######################################################### + set vx="" + if ( -e ${module_src}/configure.ac ) then + set vx=`grep -e "^AC_INIT" ${module_src}/configure.ac | sed -e "s%.*\[\([[:digit:].]*\)\].*%\1%g"` + else if ( -e ${module_src}/configure.in.base ) then + set vx=`grep -e "^VERSION=" ${module_src}/configure.in.base | awk -F= '{ if (NF>1) print $NF; }' | tr -d '[:space:]'` + if ( "$vx" == "" ) then + set vx=`grep -e "^AC_INIT" ${module_src}/configure.in.base | sed -e "s%.*\[\([[:digit:].]*\)\].*%\1%g"` + endif + else if ( -e ${module_src}/CMakeLists.txt ) then set ver_maj=`cat ${module_src}/CMakeLists.txt | grep SET\(VERSION_MAJOR | sed -e "s%[A-Z_() ]%%g"` set ver_min=`cat ${module_src}/CMakeLists.txt | grep SET\(VERSION_MINOR | sed -e "s%[A-Z_() ]%%g"` set ver_maintenance=`cat ${module_src}/CMakeLists.txt | grep SET\(VERSION_MAINTENANCE | sed -e "s%[A-Z_() ]%%g"` set vx="${ver_maj}.${ver_min}.${ver_maintenance}" - endif - if ( "$vx" != "" ) then - set vx="_$vx" - endif - if ( "$prefix" == "" ) then - #set module_root_dir=`printenv ${module}_ROOT_DIR` - #if ( "$module_root_dir" != "" ) then - # set px=$module_root_dir - #else - set px=${BUILD_DIR}${def_install_dir}/${module}${vx} - #endif - else - set px=${prefix}/${module}${vx} - endif - ######################################################### - # perform configure if -c flag is given or if - # Makefile does not exist (first compilation?) - ######################################################### - if ( $is_configure == 1 || $mkfile_exist == 0 || $opts_changed == 1 ) then - echo "... Performing configure" + endif + if ( "$vx" != "" ) then + set vx="_$vx" + endif + if ( "$prefix" == "" ) then + set px=${BUILD_DIR}${def_install_dir}/${module}${vx} + else + set px=${prefix}/${module}${vx} + endif ######################################################### - # check if configure script exists + # perform configure if -c flag is given or if + # Makefile does not exist (first compilation?) ######################################################### - if ( ! -e ${module_src}/configure && "${module}" != "PARAVIS" ) then - echo "\!\!\! Warning \!\!\! Can not find configure script in ${module_src}." - else - if (! ($?BUILDCONF_OPTS) ) then - set myconf_keys="" + if ( $is_configure == 1 || $mkfile_exist == 0 || $opts_changed == 1 ) then + echo "... Performing configure" + ######################################################### + # check if configure script exists + ######################################################### + if ( ! -e ${module_src}/configure && "${module}" != "PARAVIS" ) then + echo "\!\!\! Warning \!\!\! Can not find configure script in ${module_src}." else - set myconf_keys="${CONF_OPTS}" - endif - if ( $inst_with_gui == 0 ) then - set myconf_keys="${myconf_keys} --without-gui" - endif - if ( "${module}" == "MED" && ($?METISDIR) && ($?SCOTCHDIR) ) then - set myconf_keys="${myconf_keys} --enable-splitter=yes --with-metis=${METISDIR} --with-scotch=${SCOTCHDIR}" - endif - if ( "${module}" == "NETGENPLUGIN" && ($?NETGENHOME) ) then - set myconf_keys="${myconf_keys} --with-netgen=${NETGENHOME}" - endif + if (! ($?BUILDCONF_OPTS) ) then + set myconf_keys="" + else + set myconf_keys="${CONF_OPTS}" + endif + if ( $inst_with_gui == 0 ) then + set myconf_keys="${myconf_keys} --without-gui" + endif + if ( "${module}" == "MED" && ($?METISDIR) && ($?SCOTCHDIR) ) then + set myconf_keys="${myconf_keys} --enable-splitter=yes --with-metis=${METISDIR} --with-scotch=${SCOTCHDIR}" + endif + if ( "${module}" == "NETGENPLUGIN" && ($?NETGENHOME) ) then + set myconf_keys="${myconf_keys} --with-netgen=${NETGENHOME}" + endif + if ( "${module}" == "PARAVIS" ) then cd ${module_build}; cmake ${module_src} -DCMAKE_INSTALL_PREFIX=$px >& ${LOG_DIR}/configure_${module}.log else ${module_src}/configure --prefix=$px ${optim} ${myconf_keys} >& ${LOG_DIR}/configure_${module}.log endif - ######################################################### - # echo possible errors - ######################################################### - if ( $verbose_level > 0 ) then - cat ${LOG_DIR}/configure_${module}.log | grep ": error:" >/dev/stderr + + ######################################################### + # echo possible errors + ######################################################### + if ( $verbose_level > 0 ) then + cat ${LOG_DIR}/configure_${module}.log | grep ": error:" + endif + if ( $verbose_level > 1 ) then + cat ${LOG_DIR}/configure_${module}.log | grep ": WARNING:" + endif endif - if ( $verbose_level > 1 ) then - cat ${LOG_DIR}/configure_${module}.log | grep ": WARNING:" >/dev/stderr + endif + ######################################################### + # perform make + ######################################################### + echo "... Performing make" + ######################################################### + # first clear dependencies + ######################################################### + find . -name ".dep*" -type f -exec rm -f {} \; >& /dev/null + ######################################################### + # then make + ######################################################### + if ( "${module}" == "PARAVIS" ) then + if ( ($?VTK_AUTOLOAD_PATH) ) then + setenv VTK_AUTOLOAD_PATH_BACKUP ${VTK_AUTOLOAD_PATH} + unsetenv VTK_AUTOLOAD_PATH endif endif - endif - ######################################################### - # perform make - ######################################################### - echo "... Performing make" - ######################################################### - # first clear dependencies - ######################################################### - find . -name ".dep*" -type f -exec rm -f {} \; >& /dev/null - make >& ${LOG_DIR}/make_${module}.log - set sts=$status - ######################################################### - # if make step is successful set the ${module}_ROOT_DIR - # environment variable - ######################################################### - #if ( $sts == 0 ) then - # setenv ${module}_ROOT_DIR ${module_build} - #endif - ######################################################### - # print make errors - ######################################################### - cat ${LOG_DIR}/make_${module}.log | grep -Ei '[*][*][*].*error' >/dev/stderr - ######################################################### - # 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++... - ######################################################### - if ( $verbose_level > 0 ) then - ###cat ${LOG_DIR}/make_${module}.log | grep ": error" - cat ${LOG_DIR}/make_${module}.log | awk 'substr($0,0,1)!=" " {print ""} {print $0} END {print ""}' | grep "${module_src}/[A-Za-z_0-9./]*:" | sed s@"^${module_src}/src/"@@ >/dev/stderr - endif - if ( $verbose_level > 1 ) then - cat ${LOG_DIR}/make_${module}.log | awk 'substr($0,0,1)!=" " {print ""} {print $0} END {print ""}' | grep -E ": warning|* Warning" | sed s@"^${module_src}/src/"@@ >/dev/stderr - endif - ######################################################### - # perform make dev_docs step if -t flag is given - ######################################################### - if ( $is_tui == 1 && $sts == 0 && -d ${module_build}/doc ) then - cd ${module_build}/doc - set dd=`cat Makefile | grep -E "dev_docs[[:space:]]*:"` - if ( "$dd" != "" ) then - echo "... Performing make dev_docs" - make dev_docs >& ${LOG_DIR}/make_dev_docs_${module}.log - cat ${LOG_DIR}/make_dev_docs_${module}.log | grep '[*][*][*]' >/dev/stderr + make >& ${LOG_DIR}/make_${module}.log + set sts=$status + if ( "${module}" == "PARAVIS" ) then + if ( ($?VTK_AUTOLOAD_PATH_BACKUP) ) then + setenv VTK_AUTOLOAD_PATH ${VTK_AUTOLOAD_PATH_BACKUP} + endif endif - endif - cd ${module_build} - ######################################################### - # perform make if -i or -p flags are given - ######################################################### - if ( $is_install == 1 && $sts == 0 || "${module}" == "KERNEL" ) then ######################################################### - # deleting build directory if -d flag is given + # if make step is successful set the ${module}_ROOT_DIR + # environment variable ######################################################### - if ( -e $px && $is_delete == 1 ) then - echo "... Removing $px" - rm -rf $px >& /dev/null - if ( "$?" != "0" ) then - echo "\!\!\! Warning \!\!\! Cannot remove install directory ${px}. Permission denied." + #if ( $sts == 0 ) then + # setenv ${module}_ROOT_DIR ${module_build} + #endif + ######################################################### + # print make errors + ######################################################### + cat ${LOG_DIR}/make_${module}.log | grep -Ei '[*][*][*].*error' + ######################################################### + # 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++... + ######################################################### + if ( $verbose_level > 0 ) then + ###cat ${LOG_DIR}/make_${module}.log | grep ": error" + cat ${LOG_DIR}/make_${module}.log | awk 'substr($0,0,1)!=" " {print ""} {print $0} END {print ""}' | grep "${module_src}/[A-Za-z_0-9./]*:" | sed s@"^${module_src}/src/"@@ + endif + if ( $verbose_level > 1 ) then + cat ${LOG_DIR}/make_${module}.log | awk 'substr($0,0,1)!=" " {print ""} {print $0} END {print ""}' | grep -E ": warning|* Warning" | sed s@"^${module_src}/src/"@@ + endif + ######################################################### + # perform make dev_docs step if -t flag is given + ######################################################### + if ( $is_tui == 1 && $sts == 0 && -d ${module_build}/doc ) then + cd ${module_build}/doc + set dd=`cat Makefile | grep -E "dev_docs[[:space:]]*:"` + if ( "$dd" != "" ) then + echo "... Performing make dev_docs" + make dev_docs >& ${LOG_DIR}/make_dev_docs_${module}.log + cat ${LOG_DIR}/make_dev_docs_${module}.log | grep '[*][*][*]' endif endif - echo "... Performing make install" - make install >& ${LOG_DIR}/make_install_${module}.log - set sts=$status + cd ${module_build} ######################################################### - # if make install step is successful set the - # ${module}_ROOT_DIR environment variable + # perform make if -i or -p flags are given ######################################################### - if ( $sts == 0 ) then - setenv ${module}_ROOT_DIR $px + if ( $is_install == 1 && $sts == 0 || "${module}" == "KERNEL" ) then + ######################################################### + # deleting build directory if -d flag is given + ######################################################### + if ( -e $px && $is_delete == 1 ) then + echo "... Removing $px" + rm -rf $px >& /dev/null + if ( "$?" != "0" ) then + echo "\!\!\! Warning \!\!\! Cannot remove install directory ${px}. Permission denied." + endif + endif + echo "... Performing make install" + make install >& ${LOG_DIR}/make_install_${module}.log + set sts=$status + ######################################################### + # if make install step is successful set the + # ${module}_ROOT_DIR environment variable + ######################################################### + if ( $sts == 0 ) then + setenv ${module}_ROOT_DIR $px + endif endif + echo ">>> Finished ${module} module" + else + echo "\!\!\! Error \!\!\! Can't find module sources. ${module}_SRC_DIR environment variable is not set." endif - echo ">>> Finished ${module} module" - else - echo "\!\!\! Error \!\!\! Can't find module sources. ${module}_SRC_DIR environment variable is not set." - endif end ######################################################### # finalize diff --git a/config_files/build.sh b/config_files/build.sh index 8bbbff5..5f16e51 100755 --- a/config_files/build.sh +++ b/config_files/build.sh @@ -246,23 +246,23 @@ for module in ${modules}; do else if [ "${module}" == "PARAVIS" ]; then echo '!!! Warning !!! build_configure step is not executed for '${module}'.' - else - ######################################################### - # call build_configure - ######################################################### - mybuildconf_keys="${BUILDCONF_OPTS}" - if [ $inst_with_gui -eq 0 ] ; then - mybuildconf_keys="${mybuildconf_keys} --without-gui" + else + ######################################################### + # call build_configure + ######################################################### + mybuildconf_keys="${BUILDCONF_OPTS}" + if [ $inst_with_gui -eq 0 ] ; then + mybuildconf_keys="${mybuildconf_keys} --without-gui" + fi + cd ${module_src} + ./build_configure ${mybuildconf_keys} >& ${LOG_DIR}/build_configure_${module}.log + ######################################################### + # echo possible errors + ######################################################### + if [ $verbose_level -gt 0 ] ; then + cat ${LOG_DIR}/build_configure_${module}.log | grep -E "(failed|: error:)" >&2 + fi fi - cd ${module_src} - ./build_configure ${mybuildconf_keys} >& ${LOG_DIR}/build_configure_${module}.log - ######################################################### - # echo possible errors - ######################################################### - if [ $verbose_level -gt 0 ] ; then - cat ${LOG_DIR}/build_configure_${module}.log | grep -E "(failed|: error:)" >&2 - fi - fi fi fi ######################################################### @@ -325,7 +325,7 @@ for module in ${modules}; do vx="_$vx" fi if [ "$prefix" == "" ] ; then - px=${BUILD_DIR}${def_install_dir}/${module}${vx} + px=${BUILD_DIR}${def_install_dir}/${module}${vx} else px=$prefix/${module}${vx} fi @@ -355,9 +355,9 @@ for module in ${modules}; do fi if [ "${module}" == "PARAVIS" ] ; then - cd ${module_build}; cmake ${module_src} -DCMAKE_INSTALL_PREFIX=$px >& ${LOG_DIR}/configure_${module}.log - else - ${module_src}/configure --prefix=$px ${optim} ${myconf_keys} >& ${LOG_DIR}/configure_${module}.log + cd ${module_build}; cmake ${module_src} -DCMAKE_INSTALL_PREFIX=$px >& ${LOG_DIR}/configure_${module}.log + else + ${module_src}/configure --prefix=$px ${optim} ${myconf_keys} >& ${LOG_DIR}/configure_${module}.log fi ######################################################### @@ -379,8 +379,18 @@ for module in ${modules}; do # first clear dependencies ######################################################### find . -name ".dep*" -type f -exec rm -f {} \; >& /dev/null + ######################################################### + # then make + ######################################################### + if [ "${module}" == "PARAVIS" ] ; then + VTK_AUTOLOAD_PATH_BACKUP=${VTK_AUTOLOAD_PATH} + test "${VTK_AUTOLOAD_PATH}" != "" && unset VTK_AUTOLOAD_PATH + fi make >& ${LOG_DIR}/make_${module}.log sts=$? + if [ "${module}" == "PARAVIS" ] ; then + test "${VTK_AUTOLOAD_PATH_BACKUP}" != "" && export VTK_AUTOLOAD_PATH=${VTK_AUTOLOAD_PATH_BACKUP} + fi ######################################################### # if make step is successful set the ${module}_ROOT_DIR # environment variable -- 2.39.2