Here you find examples of use of YACSGEN for every type of component.
In order to build and test the examples, you have to:
-- change the SALOME installation directory in exec.sh (SALOME_DIR)
+- change the SALOME installation directory in exec.sh (SALOME_APPLI_PATH)
- run "build.sh"
Every example contains a "build.sh" script which shows you how to build and
#set -e
cd $script_dir
-
+$script_dir/clean.sh
list_dirs="calcium1 calcium2 cpp1 cpp2 cppgui1 fort1 fort2 pydoc1 pygui1 pyth1 pyth2 types1"
#" mpi1 parahxx1 hxx1"
for dir in $list_dirs ; do
../exec.sh python components.py
# test
-appli/salome -t
appli/salome shell ../test_compo.py
-appli/salome killall
../exec.sh python components.py
# test
-appli/salome -t
appli/salome shell ../test_compo.py
-appli/salome killall
import os,sys
-SALOME_ROOT=os.getenv("SALOME_DIR")
-SALOME_PACKAGES=os.getenv("SALOME_DIR")
-SALOME_PREREQ=os.path.join(SALOME_PACKAGES, "salome_prerequisites.sh")
-#SALOME_PREREQ=os.path.join(SALOME_ROOT, "salome_prerequisites_appli.sh")
+SALOME_ROOT=os.getenv("ROOT_SALOME_INSTALL")
+SALOME_PREREQ=os.path.join(SALOME_ROOT, "env.d", "envProducts.sh")
KERNEL_ROOT_DIR=os.getenv("KERNEL_ROOT_DIR","")
GUI_ROOT_DIR=os.getenv("GUI_ROOT_DIR","")
"geom":GEOM_ROOT_DIR,
}
-SYS_MODULES=[]
+sys.path.insert(0, SALOME_ROOT)
+import salome_common
+SYS_MODULES=salome_common.MODULES
../exec.sh python components.py
# test
-appli/salome -t
appli/salome shell ../test_compo.py
-appli/salome killall
../exec.sh make
# test
-appli/salome -t
appli/salome shell ../test_compo.py
-appli/salome killall
# execute a command within SALOME environment
com=$*
+SCRIPT_DIR=`dirname $0`
-# Modify to your SALOME installation
-export SALOME_DIR=__YACSGEN_INSTALL_PATH__
-export SALOME_PACKAGES=__YACSGEN_INSTALL_PATH__
-
-source $SALOME_PACKAGES/salome_prerequisites.sh
-source $SALOME_PACKAGES/salome_modules.sh
-
-echo execution: $com
-$com
-
+SALOME_APPLI_PATH=/home/I35256/salome/base/appli_DEV_package
+$SALOME_APPLI_PATH/salome shell -- bash $SCRIPT_DIR/salome_env_exec.sh $com
+exit $?
../exec.sh python components.py
# test
-appli/salome -t
appli/salome shell ../test_compo.py
-appli/salome killall
../exec.sh make
# test
-appli/salome -t
appli/salome shell ../test_compo.py
-appli/salome killall
../exec.sh python components.py
# test
-appli/salome -t
appli/salome shell ../test_compo.py
-appli/salome killall
../exec.sh python components.py
# test
-appli/salome -t
appli/salome shell ../test_compo.py
-appli/salome killall
--- /dev/null
+com=$*
+
+source $ROOT_SALOME/salome_modules.sh
+$com
../exec.sh python components.py
# test
-appli/salome -t
appli/salome shell ../test_compo.py
-appli/salome killall