From e7db636eab6e797f477731d35adc0ae524fd83c9 Mon Sep 17 00:00:00 2001 From: spo Date: Sat, 30 Jul 2016 13:42:55 +0300 Subject: [PATCH] Improve build scripts for linux --- config.sh | 117 ----------------------------------------- eclipse.sh | 1 - env.sh | 14 +++-- env_linux.sh | 8 +-- env_salome.sh | 10 ---- env_standalone.sh | 19 ------- launcher_env.sh | 1 - launcher_salome_env.sh | 1 - linux_run.sh | 10 ---- make.sh | 12 +---- salome_kill.sh | 1 - salome_run.sh | 1 - test.sh | 1 - 13 files changed, 8 insertions(+), 188 deletions(-) delete mode 100755 config.sh delete mode 100644 env_standalone.sh delete mode 100755 linux_run.sh diff --git a/config.sh b/config.sh deleted file mode 100755 index ee58a03f2..000000000 --- a/config.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/bin/bash -ex - -while [[ $# > 0 ]]; do - key="$1" - - case $key in - standalone|Standalone) - MODE=Standalone - shift - ;; - *) - shift - ;; - esac -done - - -rm env_config.sh || echo "File env_config.sh was not found." - -echo "#!/bin/bash -ex" >> env_config.sh - -PLATFORM="" -if [ -f PLATFORM ]; then - PLATFORM="$(lsb_release -is)" - RELEASE="$(lsb_release -rs)" - if [ "${PLATFORM}" = 'CentOS' ]; then PLATFORM=-centos - elif [ "${PLATFORM}" = 'Debian' ]; then - if [ "${RELEASE}" =~ ^8 ]; then PLATFORM=-d8 - elif [ "${RELEASE}" =~ ^7 ]; then PLATFORM=-d7 - else PLATFORM=-d6 - fi - fi -fi - -if [ -f DEBUG ]; then - PLATFORM=${PLATFORM}_d -fi - -echo "export PLATFORM=${PLATFORM}" >> env_config.sh - -include_products() { - local salome_version=$1 - local platform="$(lsb_release -is)" - local release="$(lsb_release -rs)" - if [[ ${salome_version} = '7.7.0' ]]; then - if [[ "${platform}" = 'CentOS' ]]; then export PRODUCTS_ROOT=/dn23/NEWGEOM/common/PRODUCTS/CentOS.6.3.64/7.7.0 - elif [[ "${platform}" = 'Debian' && ${release} =~ ^6 ]]; then export PRODUCTS_ROOT=/dn23/NEWGEOM/common/PRODUCTS/DEBIAN.6.0.64/7.7.0 - fi - elif [[ ${salome_version} = '7.8.0' ]]; then - if [[ "${platform}" = 'CentOS' ]]; then export PRODUCTS_ROOT=/dn23/NEWGEOM/common/PRODUCTS/CentOS.6.3.64/7.8.0 - elif [[ "${platform}" = 'Debian' && ${release} =~ ^6 ]]; then export PRODUCTS_ROOT=/dn23/NEWGEOM/common/PRODUCTS/DEBIAN.6.0.64/7.8.0 - elif [[ "${platform}" = 'Debian' && ${release} =~ ^7 ]]; then export PRODUCTS_ROOT=/dn23/NEWGEOM/common/PRODUCTS/DEBIAN.7.0.64/7.8.0 - fi - else - echo "Could not find PRODUCTS for the platform ${platform} ${release}" - exit 1 - fi -} -include_products '7.8.0' - -include_suit() { - local salome_version=$1 - local platform="$(lsb_release -is)" - local release="$(lsb_release -rs)" - if [[ ${salome_version} = '7.7.0' ]]; then - if [[ "${platform}" = 'CentOS' ]]; then export SUIT_DIR=/dn46/SALOME/series7x/V7_7_0/CentOS63-64/GUI - elif [[ "${platform}" = 'Debian' && ${release} =~ ^6 ]]; then export SUIT_DIR=/dn46/SALOME/series7x/V7_7_0/Debian60-64/GUI - fi - elif [[ ${salome_version} = '7.8.0' ]]; then - if [[ "${platform}" = 'CentOS' ]]; then export SUIT_DIR=/dn46/SALOME/series7x/V7_8_0/CentOS63-64/GUI - elif [[ "${platform}" = 'Debian' && ${release} =~ ^6 ]]; then export SUIT_DIR=/dn46/SALOME/series7x/V7_8_0/Debian60-64/GUI - elif [[ "${platform}" = 'Debian' && ${release} =~ ^7 ]]; then export SUIT_DIR=/dn46/SALOME/series7x/V7_8_0/Debian70-64/GUI - fi - else - echo "Could not find PRODUCTS for the platform ${platform} ${release}" - exit 1 - fi -} -include_suit '7.8.0' - -include_salome() { - local salome_version=$1 - local platform="$(lsb_release -is)" - local release="$(lsb_release -rs)" - if [[ ${salome_version} = '7.5.1' ]]; then - if [[ "${platform}" = 'CentOS' ]]; then export SALOME_ROOT=/dn48/newgeom/common/SALOME-7.5.1_CentOS-6.3 - elif [[ "${platform}" = 'Debian' && ${release} =~ ^6 ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.5.1_Debian-6.0_SOURCES - elif [[ "${platform}" = 'Debian' && ${release} =~ ^8 ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.5.1_Debian-8.0_SOURCES - fi - elif [[ ${salome_version} = '7.6.0' ]]; then - if [[ "${platform}" = 'CentOS' ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.6.0_CentOS-6.3_SOURCES - elif [[ "${platform}" = 'Debian' && ${release} =~ ^6 ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.6.0_Debian-6.0_SOURCES - fi - elif [[ ${salome_version} = '7.7.0' ]]; then - if [[ "${platform}" = 'CentOS' ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.7.0_CentOS63-64 - elif [[ "${platform}" = 'Debian' && ${release} =~ ^6 ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.7.0_Debian60-64 - fi - elif [[ ${salome_version} = '7.8.0' ]]; then - if [[ "${platform}" = 'CentOS' ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.8.0_CentOS63-64 - elif [[ "${platform}" = 'Debian' && ${release} =~ ^6 ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.8.0_Debian60-64 - elif [[ "${platform}" = 'Debian' && ${release} =~ ^7 ]]; then export SALOME_ROOT=/dn23/NEWGEOM/common/SALOME-7.8.0_Debian70-64 - fi - else - echo "Could not find SALOME for the platform ${platform} ${release}" - exit 1 - fi -} -include_salome '7.8.0' - - -if [[ ${MODE} = 'Standalone' ]]; then - echo "export INST_ROOT=${PRODUCTS_ROOT}" >> env_config.sh - echo "export SUIT_DIR=${SUIT_DIR}" >> env_config.sh -else - echo "export INST_ROOT=${SALOME_ROOT}" >> env_config.sh -fi - diff --git a/eclipse.sh b/eclipse.sh index 33f9c2ff7..7bfacff03 100755 --- a/eclipse.sh +++ b/eclipse.sh @@ -1,7 +1,6 @@ #!/bin/bash source env.sh -source env_salome.sh mkdir -p ${BUILD_DIR} cd ${BUILD_DIR} diff --git a/env.sh b/env.sh index 15f527401..f42749e9e 100644 --- a/env.sh +++ b/env.sh @@ -3,21 +3,19 @@ # Path to sources export SOURCES_DIR=$(pwd) # Path to build directory -export BUILD_DIR=$(cd .. && pwd)/build +export BUILD_DIR=$(cd ${SOURCES_DIR}/.. && pwd)/build # 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 +source /dn64/series7x/work/init.sh 2016-06-20 # Path to solvespace-2 export SHAPER_PDIR=/dn48/newgeom/common/products # Path to install directory -export SHAPER_ROOT_DIR=$(cd .. && pwd)/install +export SHAPER_ROOT_DIR=$(cd ${SOURCES_DIR}/.. && pwd)/install + +source ${TOOLS_DIR}/env_linux.sh +source ${TOOLS_DIR}/env_salome.sh \ No newline at end of file diff --git a/env_linux.sh b/env_linux.sh index 8f431f67b..8148a1462 100644 --- a/env_linux.sh +++ b/env_linux.sh @@ -2,11 +2,10 @@ # This script uses: # -# INST_ROOT - path of SALOME (env_products.sh) # SHAPER_PDIR - path of PRODUCTS for SHAPER (SolveSpace, lcov) # SHAPER_ROOT_DIR - path of SHAPER installation -for path in INST_ROOT SHAPER_PDIR SHAPER_ROOT_DIR; do +for path in SHAPER_PDIR SHAPER_ROOT_DIR; do if [[ -z ${!path+x} ]]; then echo "${path} not found."; exit 1 else @@ -14,11 +13,6 @@ for path in INST_ROOT SHAPER_PDIR SHAPER_ROOT_DIR; do fi done -set +u -echo "Source ${INST_ROOT}/$(cd ${INST_ROOT} && ls *env_products.sh)" -source ${INST_ROOT}/$(cd ${INST_ROOT} && ls *env_products.sh) -set -u - #------ SolveSpace ------ export SOLVESPACE_ROOT_DIR=${SHAPER_PDIR}/solvespace-2.1 export LD_LIBRARY_PATH=${SOLVESPACE_ROOT_DIR}/lib:${LD_LIBRARY_PATH} diff --git a/env_salome.sh b/env_salome.sh index 631a01214..ccaf3aebc 100644 --- a/env_salome.sh +++ b/env_salome.sh @@ -1,15 +1,5 @@ #!/bin/bash -for path in TOOLS_DIR; do - if [[ -z "${!path}" ]]; then - echo "${path} not found."; exit 1 - else - echo "Found ${path}: ${!path}" - fi -done - -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=${SHAPER_ROOT_DIR}/share/salome/resources/shaper:${GUI_ROOT_DIR}/share/salome/resources/gui diff --git a/env_standalone.sh b/env_standalone.sh deleted file mode 100644 index e04a1e0ae..000000000 --- a/env_standalone.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -for path in TOOLS_DIR SUIT_DIR; do - if [[ -z "${!path}" ]]; then - echo "${path} not found."; exit 1 - else - echo "Found ${path}: ${!path}" - fi -done - -source ${TOOLS_DIR}/env_linux.sh - -# SUIT -export PATH=${SUIT_DIR}/bin:${PATH} -export LD_LIBRARY_PATH=${SUIT_DIR}/lib/salome:${LD_LIBRARY_PATH} - -#export LD_LIBRARY_PATH=${KERNEL_ROOT_DIR}/lib/salome:${LD_LIBRARY_PATH} -#export LightAppConfig=${SHAPER_ROOT_DIR}/share/salome/resources/shaper:${GUI_ROOT_DIR}/share/salome/resources/gui -export LightAppConfig=${SHAPER_ROOT_DIR}/share/salome/resources/shaper diff --git a/launcher_env.sh b/launcher_env.sh index 7e567c7b8..d6084d850 100755 --- a/launcher_env.sh +++ b/launcher_env.sh @@ -1,7 +1,6 @@ #!/bin/bash source env.sh -source env_salome.sh export PATH=${SHAPER_ROOT_DIR}/bin:${PATH} diff --git a/launcher_salome_env.sh b/launcher_salome_env.sh index 3d19bef5c..3dc1cfd51 100755 --- a/launcher_salome_env.sh +++ b/launcher_salome_env.sh @@ -1,7 +1,6 @@ #!/bin/bash source env.sh -source env_salome.sh cd ${BUILD_DIR} diff --git a/linux_run.sh b/linux_run.sh deleted file mode 100755 index aad0cde3e..000000000 --- a/linux_run.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -source env.sh -source ${TOOLS_DIR}/env_standalone.sh - -${TOOLS_DIR}/solver.sh "$@" - -APP=${SHAPER_ROOT_DIR}/bin/GeomApp - -${APP} diff --git a/make.sh b/make.sh index 2ebe12011..8aac14dde 100755 --- a/make.sh +++ b/make.sh @@ -1,7 +1,5 @@ #!/bin/bash -source env.sh - while [[ $# > 0 ]]; do key="$1" @@ -15,21 +13,13 @@ while [[ $# > 0 ]]; do USE_TEST_COVERAGE=ON shift ;; - standalone|Standalone) - MODE=Standalone - shift - ;; *) shift ;; esac done -if [[ ${MODE} = 'Standalone' ]]; then - source ${TOOLS_DIR}/env_standalone.sh -else - source ${TOOLS_DIR}/env_salome.sh -fi +source env.sh CMAKE_ARGS="" CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=${BUILD_TYPE:-Release}" diff --git a/salome_kill.sh b/salome_kill.sh index 3fe6b6f18..3ae83e85a 100755 --- a/salome_kill.sh +++ b/salome_kill.sh @@ -3,7 +3,6 @@ a_dir=$(dirname $0) source ${a_dir}/env.sh -source ${a_dir}/env_salome.sh set +e -x diff --git a/salome_run.sh b/salome_run.sh index 8feb27cac..da38262f1 100755 --- a/salome_run.sh +++ b/salome_run.sh @@ -1,7 +1,6 @@ #!/bin/bash source env.sh -source ${TOOLS_DIR}/env_salome.sh ${TOOLS_DIR}/solver.sh "$@" diff --git a/test.sh b/test.sh index c66c9150d..79ab28f25 100755 --- a/test.sh +++ b/test.sh @@ -1,7 +1,6 @@ #!/bin/bash source env.sh -source ${TOOLS_DIR}/env_salome.sh mkdir -p ${BUILD_DIR} cd ${BUILD_DIR} -- 2.39.2