From dd0443b239396d695a1ed71e581ee0e91f7e4f0b Mon Sep 17 00:00:00 2001 From: bri Date: Mon, 10 Feb 2014 18:24:28 +0400 Subject: [PATCH] addition of castem_env_products.sh and update of the scripts --- scripts/README | 18 +++++-- scripts/build.sh | 5 +- scripts/castem_env_products.sh | 25 +++++++++ scripts/env_build.sh | 21 +++++--- scripts/env_products.sh | 21 +++++--- scripts/run_salome_siman.sh | 97 ++++++++++++++++++++++++---------- 6 files changed, 140 insertions(+), 47 deletions(-) create mode 100755 scripts/castem_env_products.sh diff --git a/scripts/README b/scripts/README index 4c786ab..4f2a18d 100644 --- a/scripts/README +++ b/scripts/README @@ -16,13 +16,23 @@ where is : "BR_siman_phase1" if you are based on SALOME 6.5.0 "V7_siman" if you are based on SALOME 7.X -2. Copy the required Web Services product wso2-wsf-cpp-2.1.0_.tgz from SIMANIO_SRC to root directory (..) and unpack it : -wso2-wsf-cpp-2.1.0_debian60-64.tgz -wso2-wsf-cpp-2.1.0_mandriva_2010-64.tgz +2. Copy the required WSO2 Web Services product : copy the folder wso2-wsf-cpp-2.1.0 (including source and binary build for correspondent target platforms) from SALOME-SIMAN binary delivery to the current build directory. +You can also build this product using provided product sources and documentation. 3. Copy the required scripts from SIMANIO_SRC/scripts directory to root directory (../..) and adjust them as necessary +build.sh - SALOME build script +env_build.sh - SALOME build environment +env_products.sh - SALOME run environment +env_build_mandiva-2010-64.sh - SALOME build environment for Mandriva 2010-64 +env_products_mandriva-2010-64.sh - SALOME run environment for Mandriva 2010-64 +README - this file +env_siman.sh - SIMAN (SIMANIO) build environment +siman_build.sh - SIMAN (SIMANIO) build script +castem_env_products.sh - CASTEM run environment +run_salome_siman.sh - the script used by SIMAN for SALOME running in the SIMAN mode + For Mandriva 2010-64 rename and use env_build_mandiva-2010-64.sh env_products_mandriva-2010-64.sh. -This README files is also delivered in SIMANIO_SRC/scripts directory +This README file is also delivered in SIMANIO_SRC/scripts directory 4. Build SIMANIO_SRC using these scripts as following : . env_siman.sh diff --git a/scripts/build.sh b/scripts/build.sh index 935a10c..07a96c9 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -84,9 +84,8 @@ inst_with_gui=1 is_delete=0 verbose_level=2 params="" -modules="KERNEL GUI GEOM MED SMESH VISU PARAVIS YACS NETGENPLUGIN GHS3DPLUGIN BLSURFPLUGIN HexoticPLUGIN GHS3DPRLPLUGIN COMPONENT PYCALCULATOR CALCULATOR HELLO PYHELLO LIGHT PYLIGHT SIERPINSKY RANDOMIZER HEXABLOCK HEXABLOCKPLUGIN ATOMIC ATOMGEN ATOMSOLV HOMARD JOBMANAGER" -#modules="KERNEL GUI GEOM MED SMESH VISU PARAVIS YACS NETGENPLUGIN GHS3DPLUGIN BLSURFPLUGIN HexoticPLUGIN GHS3DPRLPLUGIN PYHELLO" -modules="KERNEL GUI GEOM MED SMESH PYHELLO" +#modules="KERNEL GUI GEOM MED SMESH VISU PARAVIS YACS NETGENPLUGIN GHS3DPLUGIN BLSURFPLUGIN HexoticPLUGIN GHS3DPRLPLUGIN COMPONENT PYCALCULATOR CALCULATOR HELLO PYHELLO LIGHT PYLIGHT SIERPINSKY RANDOMIZER HEXABLOCK HEXABLOCKPLUGIN ATOMIC ATOMGEN ATOMSOLV HOMARD JOBMANAGER" +modules="KERNEL GUI GEOM MED SMESH VISU PARAVIS YACS NETGENPLUGIN GHS3DPLUGIN BLSURFPLUGIN HexoticPLUGIN GHS3DPRLPLUGIN PYHELLO" optim="" is_install=1 is_tui=0 diff --git a/scripts/castem_env_products.sh b/scripts/castem_env_products.sh new file mode 100755 index 0000000..7edb240 --- /dev/null +++ b/scripts/castem_env_products.sh @@ -0,0 +1,25 @@ +#!/bin/bash -noprofile + +#------ SALOME V6 main ------ +#source /export/home/salome/V6_main_FD17_64/env_launch.sh + +if [ -z "${SALOME_ROOT_DIR}" ]; then + echo "You need to set the environment variable SALOME_ROOT_DIR" + exit 1 +fi + +#. ${SALOME_ROOT_DIR}}/env_products.sh + +#------ CASTEM_src ------ +#export CASTEM_PATH=/export/home/fkl/Kloss/Castem/EtudeCastem +#export CASTEM_SRC_DIR=${CASTEM_PATH}/CASTEM_SRC +export CASTEM_PATH=${SALOME_ROOT_DIR}/CASTEM +export CASTEM_SRC_DIR=${CASTEM_PATH}/CASTEM_SRC + +#------ CASTEM ------ +#export CASTEM_ROOT_DIR=${CASTEM_PATH}/CASTEM_INSTALL +export CASTEM_ROOT_DIR=${CASTEM_PATH} +export PATH=${CASTEM_ROOT_DIR}/bin/salome:${PATH} +export LD_LIBRARY_PATH=${CASTEM_ROOT_DIR}/lib/salome:${LD_LIBRARY_PATH} +export PYTHONPATH=${CASTEM_ROOT_DIR}/bin/salome:${CASTEM_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${PYTHONPATH} + diff --git a/scripts/env_build.sh b/scripts/env_build.sh index 12aeeeb..44dd2fe 100644 --- a/scripts/env_build.sh +++ b/scripts/env_build.sh @@ -80,7 +80,15 @@ export $1=$out_var #------ Setting products installation directory ------ #export INST_ROOT=/dn40/PRODUCTS/salome/6.x/opt/DEBIAN.6.0.64/6.6.0 -export INST_ROOT=${PWD} + +if [ -z "${SALOME_ROOT_DIR}" ]; then + echo "You need to set the environment variable SALOME_ROOT_DIR" + exit 1 +fi + +echo "SALOME_ROOT_DIR = " ${SALOME_ROOT_DIR} + +export INST_ROOT=${SALOME_ROOT_DIR} ### Variables for OCCT 653 ### Set this variable to 1 in order to use OCCT products from ${INST_ROOT} @@ -362,9 +370,9 @@ exportp PATH ${INST_ROOT}/Sphinx-1.1.3/bin # nothing to do ## #------ libxml2 ------ -export LIBXML_DIR=${INST_ROOT}/libxml2-2.7.8 -exportp PATH ${LIBXML_DIR}/bin -exportp LD_LIBRARY_PATH ${LIBXML_DIR}/lib +#export LIBXML_DIR=${INST_ROOT}/libxml2-2.7.8 +#exportp PATH ${LIBXML_DIR}/bin +#exportp LD_LIBRARY_PATH ${LIBXML_DIR}/lib ## #------ libxml2_src ------ # nothing to do @@ -417,10 +425,11 @@ elif [ -e KERNEL_SRC/CMakeLists.txt ] ; then fi if [ "$vx" != "" ] ; then vx="_$vx" +else + vx="_7.0.0" fi -#echo vx ================== ${vx} -#exit +echo vx == ${vx} #------ KERNEL ------ export KERNEL_ROOT_DIR=${INST_ROOT}/KERNEL${vx} diff --git a/scripts/env_products.sh b/scripts/env_products.sh index 4f06e12..bb94023 100644 --- a/scripts/env_products.sh +++ b/scripts/env_products.sh @@ -80,7 +80,15 @@ export $1=$out_var #------ Setting products installation directory ------ #export INST_ROOT=/dn40/PRODUCTS/salome/6.x/opt/DEBIAN.6.0.64/6.6.0 -export INST_ROOT=${PWD} + +if [ -z "${SALOME_ROOT_DIR}" ]; then + echo "You need to set the environment variable SALOME_ROOT_DIR" + exit 1 +fi + +echo "SALOME_ROOT_DIR = " ${SALOME_ROOT_DIR} + +export INST_ROOT=${SALOME_ROOT_DIR} ### Variables for OCCT 653 ### Set this variable to 1 in order to use OCCT products from ${INST_ROOT} @@ -362,9 +370,9 @@ exportp PATH ${INST_ROOT}/Sphinx-1.1.3/bin # nothing to do ## #------ libxml2 ------ -export LIBXML_DIR=${INST_ROOT}/libxml2-2.7.8 -exportp PATH ${LIBXML_DIR}/bin -exportp LD_LIBRARY_PATH ${LIBXML_DIR}/lib +#export LIBXML_DIR=${INST_ROOT}/libxml2-2.7.8 +#exportp PATH ${LIBXML_DIR}/bin +#exportp LD_LIBRARY_PATH ${LIBXML_DIR}/lib ## #------ libxml2_src ------ # nothing to do @@ -417,10 +425,11 @@ elif [ -e KERNEL_SRC/CMakeLists.txt ] ; then fi if [ "$vx" != "" ] ; then vx="_$vx" +else + vx="_7.0.0" fi -#echo vx ================== ${vx} -#exit +echo vx == ${vx} #------ KERNEL ------ export KERNEL_ROOT_DIR=${INST_ROOT}/KERNEL${vx} diff --git a/scripts/run_salome_siman.sh b/scripts/run_salome_siman.sh index f95bd9f..dce1f07 100644 --- a/scripts/run_salome_siman.sh +++ b/scripts/run_salome_siman.sh @@ -1,58 +1,99 @@ #!/bin/bash -echo "parameters : $1 $2 $3" > check_params.txt -echo "$#" >> check_params.txt + +exec 3>&1 4>&2 +trap 'exec 2>&4 1>&3' 0 1 2 3 +exec 1>~/salome_siman_log.out 2>&1 +# all script actions below are logged to the file '~/salome_siman_log.out': + +echo "the script execution is logged to the log file ~/salome_siman_log.out" >&3 + +echo "parameters : $1 $2 $3" +echo "$#" if [ "$#" -ne 3 ] ; then echo "Usage : -`basename $0` --siman-study= --siman-scenario= --siman-user=" +`basename $0` --siman-study= --siman-scenario= --siman-user=" >&3 echo "for example : -`basename $0` --siman-study=1162 --siman-scenario=1163 --siman-user=8" +`basename $0` --siman-study=1162 --siman-scenario=1163 --siman-user=1158" >&3 exit fi +echo "pwd = " ${PWD} +echo "display = " ${DISPLAY} -#echo dir1 = `dirname $0` -#echo dir2 = ${PWD} +if [ -z "${SALOME_ROOT_DIR}" ]; then + echo "You need to set the environment variable SALOME_ROOT_DIR" >&3 + exit 1 +fi -echo "pwd = " ${PWD} >> check_params.txt -echo "display = " ${DISPLAY} >> check_params.txt +echo "SALOME_ROOT_DIR = " ${SALOME_ROOT_DIR} -env_script=${PWD}/env_products.sh +env_script=${SALOME_ROOT_DIR}/env_products.sh echo script = $env_script if [ -e $env_script ] ; then - echo - echo ">>> Setting SALOME environment" >> check_params.txt - echo ">>> Environment script = " $env_script >> check_params.txt - source $env_script >> check_params.txt - echo ">>> After products " >> check_params.txt + echo + echo ">>> Setting SALOME environment" + echo ">>> Environment script = " $env_script + . $env_script + else + echo + echo '!!! Warning !!! SALOME Environment is not set.' + echo 'No environment file (env_products.sh) is found.' + echo 'Proceed with the current environment.' +fi + +castem_env_script=${SALOME_ROOT_DIR}/castem_env_products.sh + +if [ -e $castem_env_script ] ; then + echo + echo ">>> Setting CASTEM environment" + echo ">>> Environment script = " $castem_env_script + . $castem_env_script else - echo - echo '!!! Warning !!! Environment is not set.' - echo 'No environment file (env_products.sh) is found.' - echo 'Proceed with the current environment.' + echo + echo '!!! Warning !!! CASTEM Environment is not set.' + echo 'No environment file (castem_env_products.sh) is found.' + echo 'Proceed with the current environment.' fi -echo ">>> Setting SALOME-SAMAN environment" >> check_params.txt +echo "CASTEM_ROOT_DIR = " $CASTEM_ROOT_DIR + +echo ">>> Setting SALOME-SIMAN environment" -export WSFCPP_HOME=${PWD}/wso2-wsf-cpp-2.1.0 +export WSFCPP_HOME=${SALOME_ROOT_DIR}/wso2-wsf-cpp-2.1.0 #export PATH=${WSFCPP_HOME}/lib:${PATH} export LD_LIBRARY_PATH=${WSFCPP_HOME}/lib:${LD_LIBRARY_PATH} -echo "WSFCPP_HOME = " ${WSFCPP_HOME} >> check_params.txt +echo "WSFCPP_HOME = " ${WSFCPP_HOME} -export SIMANIO_ROOT_DIR=${PWD}/SIMANIO +export SIMANIO_ROOT_DIR=${SALOME_ROOT_DIR}/SIMANIO export PATH=${SIMANIO_ROOT_DIR}/lib:${PATH} export LD_LIBRARY_PATH=${SIMANIO_ROOT_DIR}/lib:${LD_LIBRARY_PATH} -export SIMAN_WS_HOST="172.22.2.65:8080" +export SIMAN_WS_HOST="172.22.0.102:8080" -echo "parameters 3: $1 $2 $3" >> check_params.txt +echo "parameters 3: $1 $2 $3" -#export SALOME_ROOT_DIR=${PWD} +export SIMAN_DATA_TMP="/tmp/SimanSalome/${1##*=}/${2##*=}/${3##*=}/" +mkdir -p ${SIMAN_DATA_TMP} +chmod -R g+w /tmp/SimanSalome +cd $SIMAN_DATA_TMP +echo SIMAN_DATA_TMP = $SIMAN_DATA_TMP -echo ">>> SALOME-SIMAN running" >> check_params.txt +echo ">>> SALOME-SIMAN running" -echo "parameters 4: $1 $2 $3" >> check_params.txt +echo "parameters 4: $1 $2 $3" -runSalome --siman $1 $2 $3 -k >> check_params.txt +#modules="KERNEL,GEOM,MED,SMESH,VISU,PARAVIS,YACS,CASTEM" +modules="KERNEL,GEOM,MED,SMESH,VISU,YACS,CASTEM" + +#runSalome --siman $1 $2 $3 -k +runSalome --siman $1 $2 $3 -k --modules=$modules + +rc=$? +if [[ $rc != 0 ]] ; then + echo "SALOME-SIMAN running problem. Please check the script parameters". + exit $rc +fi +rm -rf "/tmp/SimanSalome/${1##*=}/${2##*=}" -- 2.39.2