]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Improve scripts for Linux
authorspo <sergey.pokhodenko@opencascade.com>
Wed, 14 Oct 2015 07:49:51 +0000 (10:49 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Wed, 14 Oct 2015 07:49:51 +0000 (10:49 +0300)
env.sh
env_linux.sh
env_salome.sh
env_standalone.sh
linux_run.sh
salome_run.sh

diff --git a/env.sh b/env.sh
index 67da8f7580fc39018bb7b1280a656ec3f500b230..68b0c0931f92ac61358bb6ae2ba06fa14b6adfdf 100644 (file)
--- a/env.sh
+++ b/env.sh
@@ -1,16 +1,23 @@
 #!/bin/bash -x
 
-set -o nounset
+# Path to sources
+export SOURCES_DIR=$(pwd)
+# Path to build directory
+export BUILD_DIR=$(cd ../build && pwd)
+# Path to linux_run.sh & salome_run.sh
+export AUT_DIR=$(pwd)
 
+# Path to env_*.sh files
+export TOOLS_DIR=$(pwd)
+
+# Extracts INST_ROOT directory for SALOME
 if [[ ! -f env_config.sh ]]; then
   echo "Can not find env_config.sh. Please, run config.sh."
   exit 1
 fi
 source env_config.sh
 
-export ROOT_DIR=$(cd $(dirname $0)/.. && pwd)
-export SOURCES_DIR=${ROOT_DIR}/sources
-export BUILD_DIR=${ROOT_DIR}/build${PLATFORM}
-export INSTALL_DIR=${ROOT_DIR}/install${PLATFORM}
-
+# Path to solvespace-2
 export NEWGEOM_PDIR=/dn48/newgeom/common/products
+# Path to install directory
+export NEWGEOM_ROOT_DIR=$(cd ../install && pwd)
index b2a04b0f841572ee534c7037e5582cfcadfba4c7..379bdd24c0acdb28eaccf2fd6166be3170dcb83a 100644 (file)
@@ -1,7 +1,20 @@
 #!/bin/bash
 
+# This script uses:
+#
+# INST_ROOT - path of SALOME (env_products.sh)
+# NEWGEOM_PDIR - path of PRODUCTS for NEWGEOM (SolveSpace, lcov)
+# NEWGEOM_ROOT_DIR - path of NEWGEOM installation
+
+for path in INST_ROOT NEWGEOM_PDIR NEWGEOM_ROOT_DIR; do
+  if [[ -z ${!path+x} ]]; then
+    echo "${path} not found."; exit 1
+  else
+    echo "Found ${path}: ${!path}"
+  fi
+done
+
 set +u
-echo "Export SALOME from ${INST_ROOT}..."
 source ${INST_ROOT}/env_products.sh
 set -u
 
@@ -25,7 +38,6 @@ export PATH=${CASROOT}:${PATH}
 ##
 
 #------ NewGEOM ------
-export NEWGEOM_ROOT_DIR=${INSTALL_DIR}
 export PATH=${NEWGEOM_ROOT_DIR}/bin:${NEWGEOM_ROOT_DIR}/plugins:${PATH}
 export PYTHONPATH=${NEWGEOM_ROOT_DIR}/swig:${NEWGEOM_ROOT_DIR}/plugins:${NEWGEOM_ROOT_DIR}/addons:${NEWGEOM_ROOT_DIR}/pythonAPI:${PYTHONPATH}
 export LD_LIBRARY_PATH=${NEWGEOM_ROOT_DIR}/bin:${NEWGEOM_ROOT_DIR}/swig:${NEWGEOM_ROOT_DIR}/plugins:${LD_LIBRARY_PATH}
index eea2eca66b8190d04b8310cdf9f8c25bbe2642c8..e4898ba709350b63935d9028ead420f799874e27 100644 (file)
@@ -1,9 +1,7 @@
 #!/bin/bash
 
-a_dir=$(dirname $0)
-
-source ${a_dir}/env_linux.sh
+source ${TOOLS_DIR}/env_linux.sh
 
 # Correcting path which defined with error
 export LD_LIBRARY_PATH=${KERNEL_ROOT_DIR}/lib/salome:${LD_LIBRARY_PATH}
-export SalomeAppConfig=${INSTALL_DIR}/share/salome/resources/newgeom:${GUI_ROOT_DIR}/share/salome/resources/gui
+export SalomeAppConfig=${NEWGEOM_ROOT_DIR}/share/salome/resources/newgeom:${GUI_ROOT_DIR}/share/salome/resources/gui
index 6be641c77915e288c53950b4feb38f87dc068ea1..7e55f36cc4a5a721e0d8cfbee1421d6147daea92 100644 (file)
@@ -1,8 +1,14 @@
 #!/bin/bash
 
-a_dir=$(dirname $0)
+for path in TOOLS_DIR; do
+  if [[ -z "${!path}" ]]; then 
+    echo "${path} not found."; exit 1
+  else
+    echo "Found ${path}: ${!path}"
+  fi
+done
 
-source ${a_dir}/env_linux.sh
+source ${TOOLS_DIR}/env_linux.sh
 
 export LD_LIBRARY_PATH=${KERNEL_ROOT_DIR}/lib/salome:${LD_LIBRARY_PATH}
-export LightAppConfig=${INSTALL_DIR}/share/salome/resources/newgeom:${GUI_ROOT_DIR}/share/salome/resources/gui
+export LightAppConfig=${NEWGEOM_ROOT_DIR}/share/salome/resources/newgeom:${GUI_ROOT_DIR}/share/salome/resources/gui
index 10b6112649585f749c2ddff49c7b1698c0e57db4..5294b88287ccf7f3de55d1a420577f8457319062 100755 (executable)
@@ -1,17 +1,8 @@
 #!/bin/bash
 
-a_dir=$(dirname $0)
+source env.sh
+source ${TOOLS_DIR}/env_standalone.sh
 
-cd ${a_dir}
+APP=${NEWGEOM_ROOT_DIR}/bin/GeomApp
 
-source ${a_dir}/env.sh
-source ${a_dir}/env_standalone.sh
-
-if [ -f GDB ]; then
-  ${INSTALL_DIR}/bin/GeomApp >>log_GeomApp 2>>err_GeomApp &
-  APP_PID=$!
-  echo "Connecting GDB to PID ${APP_PID}..."
-  gdb - ${APP_PID} >>log_gdb_linux 2>>err_gdb_linux
-else
-  ${INSTALL_DIR}/bin/GeomApp
-fi
+${APP}
index cd02e5baa42b0522f30eb70a00312ccc77ef3c2f..ce82805fa075cd3a18179f9322f5be290bfca2b7 100755 (executable)
@@ -1,18 +1,7 @@
-#!/bin/bash -x
+#!/bin/bash
 
-a_dir=$(dirname $0)
-
-cd ${a_dir}
-
-source ${a_dir}/env.sh
-source ${a_dir}/env_salome.sh
-
-SALOME_ARGS="-r ./test.squish/shared/testdata/SalomeApp.xml"
-if [ -f GDB ]; then
-  echo "No --gdb-session"
-  #SALOME_ARGS="${SALOME_ARGS} --gdb-session"
-fi
-SALOME_ARGS="${SALOME_ARGS} --ns-port-log=$(pwd)/.salomeport"
+source env.sh
+source ${TOOLS_DIR}/env_salome.sh
 
 # kill processes of previous SALOME run
 if [ -f .salomeport ]; then
@@ -22,42 +11,13 @@ if [ -f .salomeport ]; then
   rm .salomeport
 fi 
 
-${KERNEL_ROOT_DIR}/bin/salome/runSalome.py ${SALOME_ARGS} >log_runSalome 2>err_runSalome &
-SALOME_PID=$!
-
-ATTEMPT=0
-while [[ ! -f .salomeport && ${ATTEMPT} -lt 5 ]]; do
-  sleep 5
-  SALOME_PORT=$(cat .salomeport)
-  ATTEMPT=$[${ATTEMPT}+1]
-done 
-if [ ${ATTEMPT} = 5 ]; then 
-  echo "Can not receive SALOME_PORT: file .salomeport does not exist..."
-  exit 1
-fi
-
-echo "SALOME_PORT ${SALOME_PORT}"
-
-if [ -f GDB ]; then
-  SALOME_SESSION_SERVER_PID="$(salome_pid.py ${SALOME_PORT} 'SALOME_Session_Server' 2>/dev/null)"
-  ATTEMPT=0
-  while [[ "${SALOME_SESSION_SERVER_PID}" = "" && "${ATTEMPT}" -lt 5 ]]; do
-    sleep 5
-    SALOME_SESSION_SERVER_PID="$(salome_pid.py ${SALOME_PORT} 'SALOME_Session_Server' 2>/dev/null)"
-    ATTEMPT=$[${ATTEMPT}+1]
-  done
-  if [ ${ATTEMPT} = 5 ]; then 
-    echo "Can not receive SALOME_SESSION_SERVER_PID..."
-    exit 2
-  fi
-
-  echo "SALOME_SESSION_SERVER_PID ${SALOME_SESSION_SERVER_PID}"
-  echo "Connecting GDB to PID ${SALOME_SESSION_SERVER_PID}..."
-  gdb - ${SALOME_SESSION_SERVER_PID} >>log_gdb_salome 2>>err_gdb_salome
-fi
+SALOME_ARGS=""
+SALOME_ARGS="${SALOME_ARGS} -r ./test.squish/shared/testdata/SalomeApp.xml"
+SALOME_ARGS="${SALOME_ARGS} --ns-port-log=$(pwd)/.salomeport"
 
-wait ${SALOME_PID}
+${KERNEL_ROOT_DIR}/bin/salome/runSalome.py ${SALOME_ARGS} >log_runSalome 2>err_runSalome
 
+SALOME_PORT=$(cat .salomeport)
 echo "Kill SALOME on port ${SALOME_PORT}"
 ${KERNEL_ROOT_DIR}/bin/salome/killSalomeWithPort.py ${SALOME_PORT}
 pkill -f "omniNames -start ${SALOME_PORT}"