From adc891685d4c8f06b2b540b642cabab8dc3314b0 Mon Sep 17 00:00:00 2001 From: Sergey POKHODENKO Date: Fri, 8 May 2015 10:13:18 +0300 Subject: [PATCH] Improve project generation files for linux --- README | 5 +++-- eclipse.sh | 21 +++++++++++++++------ eclipse_centos.sh | 26 ++------------------------ eclipse_d6.sh | 3 +++ eclipse_d8.sh | 3 +++ eclipse_debian.sh | 26 -------------------------- launcher_env.sh | 37 +++++++++++++++++++++++++++++++++++++ linux_env.sh | 11 ++++++++--- linux_run.sh | 9 ++++++--- linux_run_centos.sh | 3 +++ linux_run_d6.sh | 3 +++ make.sh | 17 +++++++++++++---- make_centos.sh | 19 ++----------------- make_d6.sh | 3 +++ make_debian.sh | 19 ------------------- salome_env.sh | 15 +++++++++++++++ salome_kill.sh | 8 ++++++-- salome_kill_centos.sh | 3 +++ salome_kill_d6.sh | 3 +++ salome_run.sh | 12 ++++++++---- salome_run_centos.sh | 3 +++ salome_run_d6.sh | 3 +++ 22 files changed, 142 insertions(+), 110 deletions(-) create mode 100755 eclipse_d6.sh create mode 100755 eclipse_d8.sh delete mode 100755 eclipse_debian.sh create mode 100755 launcher_env.sh create mode 100755 linux_run_centos.sh create mode 100755 linux_run_d6.sh create mode 100755 make_d6.sh delete mode 100755 make_debian.sh create mode 100644 salome_env.sh create mode 100755 salome_kill_centos.sh create mode 100755 salome_kill_d6.sh create mode 100755 salome_run_centos.sh create mode 100755 salome_run_d6.sh diff --git a/README b/README index 78408a1cd..3d1cd0ec8 100644 --- a/README +++ b/README @@ -5,7 +5,8 @@ Compilation on LINUX: ===================== cd - source linux_env.sh + source salome_env.sh + source linux_env.sh cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=${ROOT_DIR}/install ${ROOT_DIR}/sources make make install @@ -25,7 +26,7 @@ It will create a "build" and "install" folders. Environment is ready to launch a Or without environment call: - linux_run.sh + linux_run.sh Compilation on Windows: diff --git a/eclipse.sh b/eclipse.sh index 9ba180d69..77e3e428f 100755 --- a/eclipse.sh +++ b/eclipse.sh @@ -1,3 +1,4 @@ +#!/bin/bash # Find absolute path to ROOT_DIR export ROOT_DIR=$(pwd)/.. @@ -5,21 +6,29 @@ export ROOT_DIR=`cd "${ROOT_DIR}";pwd` SRC_DIR=${ROOT_DIR}/sources -source ${SRC_DIR}/linux_env.sh -mkdir -p ${ROOT_DIR}/build -cd ${ROOT_DIR}/build +BUILD_DIR=build +INSTALL_DIR=install +if [ $1 ]; then + BUILD_DIR=${BUILD_DIR}-$1 + INSTALL_DIR=${INSTALL_DIR}-$1 +fi + +source ${SRC_DIR}/salome_env.sh +source ${SRC_DIR}/linux_env.sh $1 +mkdir -p ${ROOT_DIR}/${BUILD_DIR} +cd ${ROOT_DIR}/${BUILD_DIR} export LD_LIBRARY_PATH=${KERNEL_ROOT_DIR}/lib/salome:${LD_LIBRARY_PATH} -export LightAppConfig=${ROOT_DIR}/install/share/salome/resources/newgeom:${GUI_ROOT_DIR}/share/salome/resources/gui +export LightAppConfig=${ROOT_DIR}/${INSTALL_DIR}/share/salome/resources/newgeom:${GUI_ROOT_DIR}/share/salome/resources/gui CMAKE_ARGS="-D_ECLIPSE_VERSION=4.3" CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=Debug" CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=ON" -CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=${ROOT_DIR}/install" +CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=${ROOT_DIR}/${INSTALL_DIR}" CMAKE_ARGS="${CMAKE_ARGS} -DPYTHON_EXECUTABLE=${PYTHONHOME}/bin/python" CMAKE_ARGS="${CMAKE_ARGS} -DUSE_TEST_COVERAGE=OFF" CMAKE_ARGS="${CMAKE_ARGS} ${SRC_DIR}" cmake -G "Eclipse CDT4 - Unix Makefiles" ${CMAKE_ARGS} -/misc/dn48/newgeom/common/eclipse-4.4.0/eclipse& +#/misc/dn48/newgeom/common/eclipse-4.4.0/eclipse& diff --git a/eclipse_centos.sh b/eclipse_centos.sh index ea5e02a63..af0926eb2 100755 --- a/eclipse_centos.sh +++ b/eclipse_centos.sh @@ -1,25 +1,3 @@ +#!/bin/bash -# Find absolute path to ROOT_DIR -export ROOT_DIR=$(pwd)/.. -export ROOT_DIR=`cd "${ROOT_DIR}";pwd` - -SRC_DIR=${ROOT_DIR}/sources - -source ${SRC_DIR}/linux_env.sh -mkdir -p ${ROOT_DIR}/build-centos -cd ${ROOT_DIR}/build-centos - -export LD_LIBRARY_PATH=${KERNEL_ROOT_DIR}/lib/salome:${LD_LIBRARY_PATH} -export LightAppConfig=${ROOT_DIR}/install/share/salome/resources/newgeom:${GUI_ROOT_DIR}/share/salome/resources/gui - -CMAKE_ARGS="-D_ECLIPSE_VERSION=4.3" -CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=Debug" -CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=ON" -CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=${ROOT_DIR}/install" -CMAKE_ARGS="${CMAKE_ARGS} -DPYTHON_EXECUTABLE=${PYTHONHOME}/bin/python" -CMAKE_ARGS="${CMAKE_ARGS} -DUSE_TEST_COVERAGE=OFF" -CMAKE_ARGS="${CMAKE_ARGS} ${SRC_DIR}" - -cmake -G "Eclipse CDT4 - Unix Makefiles" ${CMAKE_ARGS} - -/misc/dn48/newgeom/common/eclipse-4.4.0/eclipse& +eclipse.sh centos diff --git a/eclipse_d6.sh b/eclipse_d6.sh new file mode 100755 index 000000000..9c297f17b --- /dev/null +++ b/eclipse_d6.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +eclipse.sh d6 diff --git a/eclipse_d8.sh b/eclipse_d8.sh new file mode 100755 index 000000000..c61f556b6 --- /dev/null +++ b/eclipse_d8.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +eclipse.sh d8 diff --git a/eclipse_debian.sh b/eclipse_debian.sh deleted file mode 100755 index f7d456aef..000000000 --- a/eclipse_debian.sh +++ /dev/null @@ -1,26 +0,0 @@ - -# Find absolute path to ROOT_DIR -export ROOT_DIR=$(pwd)/.. -export ROOT_DIR=`cd "${ROOT_DIR}";pwd` - -SRC_DIR=${ROOT_DIR}/sources - -export INST_ROOT=/misc/dn48/newgeom/common/SALOME-7.5.1_Debian-6.0 -source ${SRC_DIR}/linux_env.sh -mkdir -p ${ROOT_DIR}/build-debian -cd ${ROOT_DIR}/build-debian - -export LD_LIBRARY_PATH=${KERNEL_ROOT_DIR}/lib/salome:${LD_LIBRARY_PATH} -export LightAppConfig=${ROOT_DIR}/install/share/salome/resources/newgeom:${GUI_ROOT_DIR}/share/salome/resources/gui - -CMAKE_ARGS="-D_ECLIPSE_VERSION=4.3" -CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=Debug" -CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=ON" -CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=${ROOT_DIR}/install" -CMAKE_ARGS="${CMAKE_ARGS} -DPYTHON_EXECUTABLE=${PYTHONHOME}/bin/python" -CMAKE_ARGS="${CMAKE_ARGS} -DUSE_TEST_COVERAGE=OFF" -CMAKE_ARGS="${CMAKE_ARGS} ${SRC_DIR}" - -cmake -G "Eclipse CDT4 - Unix Makefiles" ${CMAKE_ARGS} - -/misc/dn48/newgeom/common/eclipse-4.4.0/eclipse& diff --git a/launcher_env.sh b/launcher_env.sh new file mode 100755 index 000000000..34ed0c903 --- /dev/null +++ b/launcher_env.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# Find absolute path to ROOT_DIR +export ROOT_DIR=$(pwd)/.. +export ROOT_DIR=`cd "${ROOT_DIR}";pwd` + +PLATFORM="$(lsb_release -is)" +RELEASE="$(lsb_release -rs)" +if [ "${PLATFORM}" == "CentOS" ]; then PLATFORM=centos +elif [ "${PLATFORM}" == "Debian" ]; then + if [ "${RELEASE}" == "8.0" ]; then PLATFORM=d8 + else PLATFORM=d6 + fi +fi + +SRC_DIR=${ROOT_DIR}/sources +source ${SRC_DIR}/salome_env.sh +source ${SRC_DIR}/linux_env.sh ${PLATFORM} + +BUILD_DIR=build +INSTALL_DIR=install +if [ ${PLATFORM} ]; then + BUILD_DIR=${BUILD_DIR}-${PLATFORM} + INSTALL_DIR=${INSTALL_DIR}-${PLATFORM} +fi + +mkdir -p ${ROOT_DIR}/${BUILD_DIR} +cd ${ROOT_DIR}/${BUILD_DIR} + +export LD_LIBRARY_PATH=${KERNEL_ROOT_DIR}/lib/salome:${LD_LIBRARY_PATH} +export LightAppConfig=${ROOT_DIR}/${INSTALL_DIR}/share/salome/resources/newgeom:${GUI_ROOT_DIR}/share/salome/resources/gui + +if [ $@ ]; then + $@ +else + bash +fi diff --git a/linux_env.sh b/linux_env.sh index 917518588..721071a37 100644 --- a/linux_env.sh +++ b/linux_env.sh @@ -1,7 +1,9 @@ -#!/bin/sh +#!/bin/bash if [ "${INST_ROOT}" = "" ] ; then - source /dn48/newgeom/common/SALOME/env_products.sh +# source /dn48/newgeom/common/SALOME/env_products.sh + echo "Error: INST_ROOT is not defined." + exit 1 else source ${INST_ROOT}/env_products.sh fi @@ -35,7 +37,10 @@ export PATH=${CASROOT}:${PATH} ## #------ NewGEOM ------ -export NEWGEOM_ROOT_DIR=${ROOT_DIR}/install +INSTALL_DIR=install +if [ $1 ]; then INSTALL_DIR=${INSTALL_DIR}-$1; fi + +export NEWGEOM_ROOT_DIR=${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} diff --git a/linux_run.sh b/linux_run.sh index 79ed96720..d6f768320 100755 --- a/linux_run.sh +++ b/linux_run.sh @@ -1,11 +1,14 @@ -#!/bin/sh +#!/bin/bash # Find absolute path to ROOT_DIR export ROOT_DIR=$(pwd)/.. export ROOT_DIR=`cd "${ROOT_DIR}";pwd` SRC_DIR=${ROOT_DIR}/sources +source ${SRC_DIR}/salome_env.sh +source ${SRC_DIR}/linux_env.sh $1 -source ${SRC_DIR}/linux_env.sh +INSTALL_DIR=install +if [ $1 ]; then INSTALL_DIR=${INSTALL_DIR}-$1; fi -${ROOT_DIR}/install/bin/GeomApp +${ROOT_DIR}/${INSTALL_DIR}/bin/GeomApp diff --git a/linux_run_centos.sh b/linux_run_centos.sh new file mode 100755 index 000000000..15735a19f --- /dev/null +++ b/linux_run_centos.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +linux_run.sh centos diff --git a/linux_run_d6.sh b/linux_run_d6.sh new file mode 100755 index 000000000..4655910fa --- /dev/null +++ b/linux_run_d6.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +linux_run.sh d6 diff --git a/make.sh b/make.sh index 98be4c4fb..009f37265 100755 --- a/make.sh +++ b/make.sh @@ -6,12 +6,21 @@ export ROOT_DIR=`cd "${ROOT_DIR}";pwd` SRC_DIR=${ROOT_DIR}/sources -source ${SRC_DIR}/linux_env.sh -mkdir -p ${ROOT_DIR}/build -cd ${ROOT_DIR}/build +BUILD_DIR=build +INSTALL_DIR=install +if [ $1 ] +then + BUILD_DIR=${BUILD_DIR}-$1 + INSTALL_DIR=${INSTALL_DIR}-$1 +fi + +source ${SRC_DIR}/salome_env.sh +source ${SRC_DIR}/linux_env.sh $1 +mkdir -p ${ROOT_DIR}/${BUILD_DIR} +cd ${ROOT_DIR}/${BUILD_DIR} CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=Release" -CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=${ROOT_DIR}/install" +CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=${ROOT_DIR}/${INSTALL_DIR}" CMAKE_ARGS="${CMAKE_ARGS} ${SRC_DIR}" cmake -G "Unix Makefiles" ${CMAKE_ARGS} diff --git a/make_centos.sh b/make_centos.sh index ef61abcce..f38c2c6f7 100755 --- a/make_centos.sh +++ b/make_centos.sh @@ -1,18 +1,3 @@ +#!/bin/bash -# Find absolute path to ROOT_DIR -export ROOT_DIR=$(pwd)/.. -export ROOT_DIR=`cd "${ROOT_DIR}";pwd` - -SRC_DIR=${ROOT_DIR}/sources - -source ${SRC_DIR}/linux_env.sh -mkdir -p ${ROOT_DIR}/build -cd ${ROOT_DIR}/build - -CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=Release" -CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=${ROOT_DIR}/install" -CMAKE_ARGS="${CMAKE_ARGS} ${SRC_DIR}" - -cmake -G "Unix Makefiles" ${CMAKE_ARGS} -make -make install +make.sh centos diff --git a/make_d6.sh b/make_d6.sh new file mode 100755 index 000000000..320139a69 --- /dev/null +++ b/make_d6.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +make.sh d6 diff --git a/make_debian.sh b/make_debian.sh deleted file mode 100755 index e2ce3a0dc..000000000 --- a/make_debian.sh +++ /dev/null @@ -1,19 +0,0 @@ - -# Find absolute path to ROOT_DIR -export ROOT_DIR=$(pwd)/.. -export ROOT_DIR=`cd "${ROOT_DIR}";pwd` - -SRC_DIR=${ROOT_DIR}/sources - -export INST_ROOT=/misc/dn48/newgeom/common/SALOME-7.5.1_Debian-6.0 -source ${SRC_DIR}/linux_env.sh -mkdir -p ${ROOT_DIR}/build-debian -cd ${ROOT_DIR}/build-debian - -CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=Release" -CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=${ROOT_DIR}/install" -CMAKE_ARGS="${CMAKE_ARGS} ${SRC_DIR}" - -cmake -G "Unix Makefiles" ${CMAKE_ARGS} -make -make install diff --git a/salome_env.sh b/salome_env.sh new file mode 100644 index 000000000..a270f2563 --- /dev/null +++ b/salome_env.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +main() { + local platform="$(lsb_release -is)" + local release="$(lsb_release -rs)" + if [ "${platform}" == "CentOS" ]; then + export INST_ROOT=/dn48/newgeom/common/SALOME-7.5.1_CentOS-6.3 + elif [ "${platform}" == "Debian" ]; then + if [[ ${release} =~ ^6 ]]; then export INST_ROOT=/dn23/NEWGEOM/common/SALOME-7.5.1_Debian-6.0_SOURCES + elif [[ ${release} =~ ^8 ]]; then export INST_ROOT=/dn23/NEWGEOM/common/SALOME-7.5.1_Debian-8.0_SOURCES + fi + fi +} + +main diff --git a/salome_kill.sh b/salome_kill.sh index 82360215b..da9b7eec6 100755 --- a/salome_kill.sh +++ b/salome_kill.sh @@ -1,13 +1,17 @@ -#!/bin/sh +#!/bin/bash export ROOT_DIR=$(pwd)/.. export ROOT_DIR=`cd "${ROOT_DIR}";pwd` +source ${ROOT_DIR}/sources/salome_env.sh source ${ROOT_DIR}/sources/linux_env.sh +INSTALL_DIR=install +if [ $1 ]; then INSTALL_DIR=${INSTALL_DIR}-$1; fi + # Correcting path which defined with error export LD_LIBRARY_PATH=${KERNEL_ROOT_DIR}/lib/salome:${LD_LIBRARY_PATH} -export SalomeAppConfig=${ROOT_DIR}/install/share/salome/resources/newgeom:${GUI_ROOT_DIR}/share/salome/resources/gui +export SalomeAppConfig=${ROOT_DIR}/${INSTALL_DIR}/share/salome/resources/newgeom:${GUI_ROOT_DIR}/share/salome/resources/gui ${PYTHONBIN} "${KERNEL_ROOT_DIR}/bin/salome/envSalome.py" ${PYTHONBIN} "${KERNEL_ROOT_DIR}/bin/salome/killSalome.py" diff --git a/salome_kill_centos.sh b/salome_kill_centos.sh new file mode 100755 index 000000000..ecc8dfcef --- /dev/null +++ b/salome_kill_centos.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +salome_kill.sh centos diff --git a/salome_kill_d6.sh b/salome_kill_d6.sh new file mode 100755 index 000000000..627a2395e --- /dev/null +++ b/salome_kill_d6.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +salome_kill.sh d6 diff --git a/salome_run.sh b/salome_run.sh index 78609177a..4eba166fb 100755 --- a/salome_run.sh +++ b/salome_run.sh @@ -1,13 +1,17 @@ -#!/bin/sh +#!/bin/bash export ROOT_DIR=$(pwd)/.. export ROOT_DIR=`cd "${ROOT_DIR}";pwd` -source ${ROOT_DIR}/sources/linux_env.sh +source ${ROOT_DIR}/sources/salome_env.sh +source ${ROOT_DIR}/sources/linux_env.sh $1 + +INSTALL_DIR=install +if [ $1 ]; then INSTALL_DIR=${INSTALL_DIR}-$1; fi # Correcting path which defined with error export LD_LIBRARY_PATH=${KERNEL_ROOT_DIR}/lib/salome:${LD_LIBRARY_PATH} -export SalomeAppConfig=${ROOT_DIR}/install/share/salome/resources/newgeom:${GUI_ROOT_DIR}/share/salome/resources/gui +export SalomeAppConfig=${ROOT_DIR}/${INSTALL_DIR}/share/salome/resources/newgeom:${GUI_ROOT_DIR}/share/salome/resources/gui ${PYTHONBIN} "${KERNEL_ROOT_DIR}/bin/salome/envSalome.py" -${PYTHONBIN} "${KERNEL_ROOT_DIR}/bin/salome/runSalome.py" +${PYTHONBIN} "${KERNEL_ROOT_DIR}/bin/salome/runSalome.py" noexcepthandler diff --git a/salome_run_centos.sh b/salome_run_centos.sh new file mode 100755 index 000000000..fedf04501 --- /dev/null +++ b/salome_run_centos.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +salome_run.sh centos diff --git a/salome_run_d6.sh b/salome_run_d6.sh new file mode 100755 index 000000000..d00238fd4 --- /dev/null +++ b/salome_run_d6.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +salome_run.sh d6 -- 2.39.2