From bf05d8cf9e8ec388185df1ef8b5e0bc6ff8599c8 Mon Sep 17 00:00:00 2001 From: prascle Date: Tue, 20 Sep 2005 14:30:54 +0000 Subject: [PATCH] PR: missing merge --- bin/appliskel/CatalogResources.xml | 28 +++++++ bin/appliskel/README | 42 ++++++++++ bin/appliskel/SalomeApp.xml | 100 ++++++++++++++++++++++++ bin/appliskel/env.d/atFirst.sh | 62 +++++++++++++++ bin/appliskel/env.d/envProducts.sh | 120 +++++++++++++++++++++++++++++ bin/appliskel/env.d/envSalome.sh | 27 +++++++ bin/appliskel/envd | 3 + bin/appliskel/runAppli | 63 +++++++++++++++ bin/appliskel/runConsole | 25 ++++++ bin/appliskel/runParam | 5 ++ bin/appliskel/runRemote.sh | 54 +++++++++++++ bin/appliskel/runSession | 34 ++++++++ 12 files changed, 563 insertions(+) create mode 100644 bin/appliskel/CatalogResources.xml create mode 100644 bin/appliskel/README create mode 100644 bin/appliskel/SalomeApp.xml create mode 100644 bin/appliskel/env.d/atFirst.sh create mode 100644 bin/appliskel/env.d/envProducts.sh create mode 100644 bin/appliskel/env.d/envSalome.sh create mode 100644 bin/appliskel/envd create mode 100755 bin/appliskel/runAppli create mode 100755 bin/appliskel/runConsole create mode 100755 bin/appliskel/runParam create mode 100755 bin/appliskel/runRemote.sh create mode 100755 bin/appliskel/runSession diff --git a/bin/appliskel/CatalogResources.xml b/bin/appliskel/CatalogResources.xml new file mode 100644 index 000000000..8caed2bfb --- /dev/null +++ b/bin/appliskel/CatalogResources.xml @@ -0,0 +1,28 @@ + + + + + + + + diff --git a/bin/appliskel/README b/bin/appliskel/README new file mode 100644 index 000000000..264b879bc --- /dev/null +++ b/bin/appliskel/README @@ -0,0 +1,42 @@ +Set of scripts for a SALOME application +======================================= + +# - A SALOME application distributed on several computers needs APPLI +# directories on the same path ($APPLI) relative to $HOME directory +# of the user, on each computer. + +user scripts: +------------- + +runAppli : SALOME launch (idem runSalome but different name to avoid + confusion with ${KERNEL_ROOT_DIR}/bin/salome/runSalome + +runConsole : a python console in the current SALOME session environment + +runSession : a shell in SALOME environment, either interactive (without args) + or used to run a program (defined by given args) + +internal application scripts: +----------------------------- + +runRemote.sh : called from remote computer, via ssh, rsh... + used for instance to create container + +envd : sets SALOME application environment + sourced by other scripts + +The following files must be adapted to your environment and SALOME Application: +------------------------------------------------------------------------------- + +SalomeApp.xml - list of modules, options on server launch and resources... +CatalogResources.xml - configuration of machines used in SALOME application + (no need of modules list and path here) + +env.d directory must contain the necessary files to source, to define +the SALOME Application environment : + ( envd script source these files in alphanumeric order ) + +For instance, + atFirst.sh - general presets + envProducts.sh - prerequisite SALOME environment + envSalome.sh - list of MODULE_ROOT_DIR diff --git a/bin/appliskel/SalomeApp.xml b/bin/appliskel/SalomeApp.xml new file mode 100644 index 000000000..6897b7136 --- /dev/null +++ b/bin/appliskel/SalomeApp.xml @@ -0,0 +1,100 @@ + +
+ + + + + +
+
+ + + + + + + + + + + + + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + +
+
+ + +
+ + +
+ + +
+
+ +
+
+ + +
+ +
+ + +
+
diff --git a/bin/appliskel/env.d/atFirst.sh b/bin/appliskel/env.d/atFirst.sh new file mode 100644 index 000000000..0c6715f75 --- /dev/null +++ b/bin/appliskel/env.d/atFirst.sh @@ -0,0 +1,62 @@ +#!/bin/sh + +#------------------------------------------------ +# to be sourced first, used in following scripts +#------------------------------------------------ + +export LD_LIBRARY_PATH="." +export PATH="/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/prascle/bin:." +export PYTHONPATH="" + +export RAC=${HOME} +export PAKSAL=/opt +export PUB=${RAC}/public +export TARP=${RAC}/tarpublic +export PYPACKAGES=${PUB}/site_packages + +# ------------------------------------------------ +# ---- gdb 5.3 + +export PATH=${PAKSAL}/gdb53/bin:${PATH} +export LD_LIBRARY_PATH=${PAKSAL}/gdb53/lib:${LD_LIBRARY_PATH} + +# ------------------------------------------------ +# ---- ddd 3.3.7 + +export PATH=${PAKSAL}/ddd337/bin:${PATH} +export LD_LIBRARY_PATH=${PAKSAL}/ddd337/lib:${LD_LIBRARY_PATH} + +# ------------------------------------------------ +# --- Java 1.4 + +export JDKHOME=${PUB}/j2sdk_nb/j2sdk1.4.2 +export JAVAHOME=${PUB}/j2sdk_nb/j2sdk1.4.2 +export PATH=${JAVAHOME}/bin:${PATH} +export LD_LIBRARY_PATH=${JAVAHOME}/lib:${LD_LIBRARY_PATH} +export LD_LIBRARY_PATH=${JAVAHOME}/jre/lib/i386:${LD_LIBRARY_PATH} +export LD_LIBRARY_PATH=${JAVAHOME}/jre/lib/i386/client:${LD_LIBRARY_PATH} + +# ------------------------------------------------ +# --- gsl -1.4 + +export GSLHOME=${PAKSAL}/gsl-1.4 +export PATH=${GSLHOME}/bin:${PATH} +export LD_LIBRARY_PATH=${GSLHOME}/lib:${LD_LIBRARY_PATH} + +# ------------------------------------------------ +# --- fltk 1.1.4 + +export FLTKHOME=${PAKSAL}/fltk114 +export PATH=${FLTKHOME}/bin:${PATH} +export LD_LIBRARY_PATH=${FLTKHOME}/lib:${LD_LIBRARY_PATH} + +# ------------------------------------------------ +# --- gmsh 1.48 + +export GMSHHOME=${PAKSAL}/gmsh148 +export PATH=${GMSHHOME}/bin:${PATH} + +# ------------------------------------------------ +# ---- tkcvs, tkdiffb, cvs + +export PATH=${PAKSAL}/tkcvs7.2/bin:${PAKSAL}/cvs1.11.14/bin:${PATH} diff --git a/bin/appliskel/env.d/envProducts.sh b/bin/appliskel/env.d/envProducts.sh new file mode 100644 index 000000000..aa0570562 --- /dev/null +++ b/bin/appliskel/env.d/envProducts.sh @@ -0,0 +1,120 @@ +#!/bin/sh + +# ------------------------------------------------ +# ---- openpbs + +export OPENPBS=/optroot/openpbs2316 +export PATH=${OPENPBS}/bin:${PATH} +export LD_LIBRARY_PATH=${OPENPBS}/lib:${LD_LIBRARY_PATH} + +#------------------------------------------------------------------------------ + +export INSTALL_ROOT=/home/prascle/PAL_SALOME141 +#------ gcc ------ +export GCC_ROOT=/usr +export CXX=${GCC_ROOT}/bin/g++ +export CC=${GCC_ROOT}/bin/gcc +## +#------ boost ------ +export BOOSTDIR=${INSTALL_ROOT}/boost-1.30.2 +## + +#------ tcltk ------ +export TCLHOME=/usr + +#------ Python ------ +export PYTHONHOME=/usr +export PYTHONPATH=${PYPACKAGES}:${PYTHONPATH} +## +#------ Qt ------ +#export QTDIR=/usr/lib/qt-3.0.5 +export QTDIR=/usr/lib/qt3-gcc3.2 +export PATH=${PATH}:${QTDIR}/bin +export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${QTDIR}/lib +## +#------ Sip ------ +export SIPDIR=/usr +export PYQTDIR=/usr +## +#------ PyQt ------ +export PYQT_SIPS=/usr/share/sip/qt +export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib/python2.2/site-packages +## +#------ Swig ------ +export SWIG_ROOT=${INSTALL_ROOT}/SWIG-1.3.17 +export PATH=${SWIG_ROOT}/bin:${PATH} +export LD_LIBRARY_PATH=${SWIG_ROOT}/lib:${LD_LIBRARY_PATH} +## +#------ OpenCascade ------ +export CASROOT=/opt/CAS52patch +export LD_LIBRARY_PATH=${CASROOT}/Linux/lib:${LD_LIBRARY_PATH} +export PATH=${CASROOT}/Linux/bin:${PATH} +# Variable for Foundation Classes : +export CSF_UnitsLexicon=${CASROOT}/src/UnitsAPI/Lexi_Expr.dat +export CSF_UnitsDefinition=${CASROOT}/src/UnitsAPI/Units.dat +# Variable for DataExchange : +export CSF_SHMessage=${CASROOT}/src/SHMessage +export CSF_XSMessage=${CASROOT}/src/XSMessage +# Variable for Font : +export CSF_MDTVFontDirectory=${CASROOT}/src/FontMFT +export CSF_MDTVTexturesDirectory=${CASROOT}/src/Textures +## +export CSF_LANGUAGE=us +export MMGT_CLEAR=1 +export CSF_EXCEPTION_PROMPT=1 +export CSF_StandardDefaults=${CASROOT}/src/StdResource +export CSF_PluginDefaults=${CASROOT}/src/StdResource +export CSF_XCAFDefaults=${CASROOT}/src/StdResource +export CSF_GraphicShr=${CASROOT}/Linux/lib/libTKOpenGl.so +export CSF_IGESDefaults=${CASROOT}/src/XSTEPResource +export CSF_STEPDefaults=${CASROOT}/src/XSTEPResource +## +#export TCLLIBPATH=$TCLHOME/lib +## +#------ Qwt ------ +export QWTHOME=${INSTALL_ROOT}/qwt-0.4.1 +export LD_LIBRARY_PATH=${QWTHOME}/lib:${LD_LIBRARY_PATH} +## +#------ Hdf ------ +export HDF5HOME=${INSTALL_ROOT}/hdf5-1.4.4 +export PATH=${HDF5HOME}/bin:$PATH +export LD_LIBRARY_PATH=${HDF5HOME}/lib:${LD_LIBRARY_PATH} +## +#------ Med ------ +export MED2HOME=/opt/med2.2.2 +export PATH=${MED2HOME}/bin:${PATH} +export LD_LIBRARY_PATH=${MED2HOME}/lib:${LD_LIBRARY_PATH} +## +#------ Vtk ------ +export VTKHOME=${INSTALL_ROOT}/VTK-4.2.2 +export PATH=${VTKHOME}/bin:${PATH} +export LD_LIBRARY_PATH=${VTKHOME}/lib/vtk:${LD_LIBRARY_PATH} +export PYTHONPATH=${VTKHOME}/lib/vtk:${VTKHOME}/lib/python2.2/site-packages/vtk_python:${PYTHONPATH} +## +#------ netgen ------ +export NETGENROOT=${INSTALL_ROOT}/netgen4.3 +export NETGEN_HOME=${INSTALL_ROOT}/netgen4.3 +## +#------ OmniORB ------ +export OMNIORBDIR=${INSTALL_ROOT}/omniORB-3.0.5 +export OMNIORB_CONFIG=${OMNIORBDIR}/.omniORB.cfg +export PYTHONPATH=${OMNIORBDIR}/lib/python:${OMNIORBDIR}/lib/i586_linux_2.0_glibc2.1:${PYTHONPATH} +export PATH=$OMNIORBDIR/bin/i586_linux_2.0_glibc2.1:$PATH +export LD_LIBRARY_PATH=$OMNIORBDIR/lib/i586_linux_2.0_glibc2.1:$LD_LIBRARY_PATH +## +#------ Numeric ------ +export PYTHONPATH=${INSTALL_ROOT}/Numeric-22.0/lib/python2.2/site-packages/Numeric:${PYTHONPATH} +## +#------ HappyDoc ------ +export PATH=${INSTALL_ROOT}/HappyDoc-r2_1/bin:${PATH} +export PYTHONPATH=${INSTALL_ROOT}/HappyDoc-r2_1/lib/python2.2/site-packages:${PYTHONPATH} +## +#------ Doxygen ------ +export PATH=${INSTALL_ROOT}/doxygen-1.3-rc2/bin:${PATH} +## +#------ Graphviz ------ +export PATH=${INSTALL_ROOT}/graphviz-1.9/bin:${PATH} +export LD_LIBRARY_PATH=${INSTALL_ROOT}/graphviz-1.9/lib/graphviz:${LD_LIBRARY_PATH} +## + +#------------------------------------------------------------------------------ diff --git a/bin/appliskel/env.d/envSalome.sh b/bin/appliskel/env.d/envSalome.sh new file mode 100644 index 000000000..9d765a072 --- /dev/null +++ b/bin/appliskel/env.d/envSalome.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +# --- example to adapt to your own configuration --- +# +# --- envSalome.sh gives a set of MODULE_ROOT_DIR, to source +# --- you must at least define and export KERNEL_ROOT_DIR + +REPINST=/home/prascle/SALOME2/Install + +export KERNEL_ROOT_DIR=${REPINST}/KERNEL_V301 + +export GUI_ROOT_DIR=${REPINST}/GUI_V301 +#export SalomeAppConfig=${GUI_ROOT_DIR}/share/salome/resources +export SalomeAppConfig=${HOME}/${APPLI} +export SUITRoot=${GUI_ROOT_DIR}/share/salome + +export GEOM_ROOT_DIR=${REPINST}/GEOM_V301 +export MED_ROOT_DIR=${REPINST}/MED_V301 +export SMESH_ROOT_DIR=${REPINST}/SMESH_V301 +export SUPERV_ROOT_DIR=${REPINST}/SUPERV_V301 +export VISU_ROOT_DIR=${REPINST}/VISU_V301 +export NETGENPLUGIN_ROOT_DIR=${REPINST}/NETGENPLUGIN_V301 +export COMPONENT_ROOT_DIR=${REPINST}/COMPONENT_V301 +export PYCALCULATOR_ROOT_DIR=${REPINST}/PYCALCULATOR_V301 +export PYHELLO_ROOT_DIR=${REPINST}/PYHELLO_V301 +export PYTIX_ROOT_DIR=${REPINST}/PYTIX_V301 + diff --git a/bin/appliskel/envd b/bin/appliskel/envd new file mode 100644 index 000000000..80261ada2 --- /dev/null +++ b/bin/appliskel/envd @@ -0,0 +1,3 @@ +#!/bin/bash + +for i in $1/env.d/*;do source ${i}; done diff --git a/bin/appliskel/runAppli b/bin/appliskel/runAppli new file mode 100755 index 000000000..3e703bc64 --- /dev/null +++ b/bin/appliskel/runAppli @@ -0,0 +1,63 @@ +#!/bin/bash + +# --- retrieve APPLI path, relative to $HOME +# on sarge, "which" gives not allways the absolute path... + +comName=`which $0` +aa=${comName:0:1} +if test x$aa == x\/; then + mycom=${comName} +elif test x$aa == x\.; then + mycom=${PWD}/${comName:2} +else + mycom=${PWD}/${comName} +fi +APPLI=`echo ${HOME} \`dirname $mycom\` | awk ' { print substr($2,length($1)+2) } '` +#echo $APPLI +export APPLI + +# --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...) + +. ${HOME}/${APPLI}/envd ${HOME}/${APPLI} + +# --- define port for CORBA naming service + +searchFreePort() { + echo -n "Searching for a free port for naming service: " + export NSPORT=2810 + local limit=$NSPORT + let limit=limit+100 + while [ 1 ] + do + aRes=`netstat -ltn | grep -E :${NSPORT}` + if [ -z "$aRes" ]; then + echo ${NSPORT} - Ok + local myhost=`hostname` + export OMNIORB_CONFIG=${HOME}/$APPLI//.omniORB_${myhost}_${NSPORT}.cfg + export NSPORT + local initref="NameService=corbaname::"`hostname`":$NSPORT" + echo "ORBInitRef $initref" > $OMNIORB_CONFIG + break + fi + echo -n "${NSPORT} " + if [[ $NSPORT -eq $limit ]] ; then + echo + echo "Can't find a free port to launch omniNames" + echo "Try to kill the running servers and then launch SALOME again." + exit + fi + let NSPORT=NSPORT+1 + done +} + +# --- run SALOME +# (default arguments defined in local salome.launch could be completed +# by arguments to this command) + +searchFreePort + +if [ $# -ne 0 ] ; then + ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python -i ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py $* +else + ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py +fi diff --git a/bin/appliskel/runConsole b/bin/appliskel/runConsole new file mode 100755 index 000000000..e45f58611 --- /dev/null +++ b/bin/appliskel/runConsole @@ -0,0 +1,25 @@ +#!/bin/bash + +# --- retrieve APPLI path, relative to $HOME +# on sarge, "which" gives not allways the absolute path... + +comName=`which $0` +aa=${comName:0:1} +if test x$aa == x\/; then + mycom=${comName} +elif test x$aa == x\.; then + mycom=${PWD}/${comName:2} +else + mycom=${PWD}/${comName} +fi +APPLI=`echo ${HOME} \`dirname $mycom\` | awk ' { print substr($2,length($1)+2) } '` +#echo $APPLI +export APPLI + +# --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...) + +. ${HOME}/${APPLI}/envd ${HOME}/${APPLI} + +# --- open a Python interpreter with SALOME environment + +${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python -i ${KERNEL_ROOT_DIR}/bin/salome/salomeConsole.py $* diff --git a/bin/appliskel/runParam b/bin/appliskel/runParam new file mode 100755 index 000000000..17bbd618b --- /dev/null +++ b/bin/appliskel/runParam @@ -0,0 +1,5 @@ +#!/bin/bash + +./runAppli --killall + +#./runSession killSalome.py diff --git a/bin/appliskel/runRemote.sh b/bin/appliskel/runRemote.sh new file mode 100755 index 000000000..84a125765 --- /dev/null +++ b/bin/appliskel/runRemote.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# +# --- run command in SALOME environment from remote call, ssh or rsh +# - SALOME configuration is defined by : +# - list of MODULE_ROOT_DIR +# - prerequisite environment +# - specific configuration for a particular SALOME application +# - These elements of configuration are defined locally on each computer +# in the directory APPLI: +# - A SALOME application distributed on several computers needs APPLI +# directories on the same path ($APPLI) relative to $HOME directory +# of the user, on each computer. +# +# --- call example (from cli76cd to cli76ce): +# ssh cli76ce ${APPLI}/runRemote.sh cli76cd 2810 SALOME_Container myContainerName +# +# --- local arguments +# $0 : ${APPLI}/runRemote.sh: from arg name, rebuild and export $APPLI variable +# $1 : computer name for CORBA name service (where SALOME was launched) +# $2 : port for CORBA name service +# $3 and following : local command to execute, with args +# + +# --- retrieve APPLI path, relative to $HOME +# on sarge, "which" gives not allways the absolute path... + +comName=`which $0` +aa=${comName:0:1} +if test x$aa == x\/; then + mycom=${comName} +elif test x$aa == x\.; then + mycom=${PWD}/${comName:2} +else + mycom=${PWD}/${comName} +fi +APPLI=`echo ${HOME} \`dirname $mycom\` | awk ' { print substr($2,length($1)+2) } '` +#echo $APPLI +export APPLI + +# --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...) + +. ${HOME}/${APPLI}/envd ${HOME}/${APPLI} + +# --- set the OMNIORB_CONFIG file and environment relative to this run of SALOME + +export OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_$1_$2.cfg +initref="NameService=corbaname::"$1":$2" +echo "ORBInitRef $initref" > $OMNIORB_CONFIG + +# --- execute the command in the SALOME environment + +shift 2 + +${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/bash --rcfile $HOME/$APPLI/.bashrc -c "$*" diff --git a/bin/appliskel/runSession b/bin/appliskel/runSession new file mode 100755 index 000000000..d94bfff6c --- /dev/null +++ b/bin/appliskel/runSession @@ -0,0 +1,34 @@ +#!/bin/bash +# +# Useful shell to run executable progs or shells under Salome env +# Use it with args to run a program : runSession python -i myprog.py +# Use it without args to run an interactive shell under Salome env +# + +# --- retrieve APPLI path, relative to $HOME +# on sarge, "which" gives not allways the absolute path... + +comName=`which $0` +aa=${comName:0:1} +if test x$aa == x\/; then + mycom=${comName} +elif test x$aa == x\.; then + mycom=${PWD}/${comName:2} +else + mycom=${PWD}/${comName} +fi +APPLI=`echo ${HOME} \`dirname $mycom\` | awk ' { print substr($2,length($1)+2) } '` +#echo $APPLI +export APPLI + +# --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...) + +. ${HOME}/${APPLI}/envd ${HOME}/${APPLI} + +# --- invoque shell with or without args + +if [ $# -ne 0 ] ; then + ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/bash --rcfile ${HOME}/${APPLI}/.bashrc -c "$*" +else + ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/bash --rcfile ${HOME}/${APPLI}/.bashrc +fi -- 2.39.2