From 7007c1f31a3d00576f8ef0e9713d80b16a36c1c3 Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 27 Jan 2005 15:08:21 +0000 Subject: [PATCH] Provide a script for automatic building of SALOME modules from sources packages (KERNEL7695). --- README | 200 +++++++++++++++--------- config_files/build.csh | 336 +++++++++++++++++++++++++++++++++++++++++ config_files/common.sh | 4 + 3 files changed, 471 insertions(+), 69 deletions(-) create mode 100755 config_files/build.csh diff --git a/README b/README index d660661..6b6bdbe 100644 --- a/README +++ b/README @@ -17,6 +17,8 @@ 3.3. Testing of the installed SALOME platform 4. How to build SALOME modules from sources + 4.1. General procedure + 4.2. Automatic build procedure: build.csh script ================================================================================ @@ -141,14 +143,14 @@ --killall Kill SALOME, running on all ports --modules=,,..., - Use module(s), possible values are GEOM, SMESH, VISU, MED, SUPERV + Use module(s), possible values are GEOM,SMESH,VISU,MED,SUPERV --embedded=,,... Start specified container(s) embedded in SALOME Session server - (i.e. running in the same process), possible values are registry, study, - moduleCatalog, cppContainer, pyContainer, supervContainer + (i.e. running in the same process), possible values are registry, + study, moduleCatalog, cppContainer, pyContainer, supervContainer --standalone=,,... - Start standalone container(s), possible values are registry, study, - moduleCatalog, cppContainer, pyContainer, supervContainer + Start standalone container(s), possible values are registry, + study, moduleCatalog, cppContainer, pyContainer, supervContainer Note that there is no key which corresponds to the tag. This tag can be used currently only for SMESH module to point external @@ -208,15 +210,20 @@ 4. How to build SALOME modules from sources - If you want to build SALOME modules from sources, install all products - necessary for the platform and then follow the scenario described below. - In the sample scenario it is supposed that you have installed SALOME - modules sources in the /home/salome directory. The name of each module's - sources directory depends on the version of the platform, for example, - KERNEL_SRC_2.2.0 for KERNEL module of SALOME version 2.2.0. + This section describes the way how to build SALOME modules manually from + sources packages provided with Installation Wizard. + 4.1. General procedure - The order of compilation and installation should be performed in accordance - with modules dependancies: + If you want to build SALOME modules from sources, install all products + necessary for the platform and SALOME modules sources. + Then follow the scenario described below. + In the scenario below it is supposed that you have installed SALOME + modules sources in the /home/salome directory. The name of each module + sources directory depends on the version of the platform, for example, + KERNEL_SRC_2.2.0 for KERNEL module of SALOME version 2.2.0. + + The order of compilation and installation should be performed according + to the dependancies between modules: * KERNEL -> no dependancies * GEOM -> KERNEL @@ -229,82 +236,137 @@ * NETGENPLUGIN -> KERNEL, SMESH * GHS3DPLUGIN -> KERNEL, SMESH - Note: NETGENPLUGIN, GHS3DPLUGIN are optional components. You may skip compiling them if - you do not plan to use NETGEN and/or GHS3D mesher algorithms. - In general, each module (except KERNEL, of course) is optional for SALOME. - If you do not need any module, just do not compile or install it. + Note: NETGENPLUGIN, GHS3DPLUGIN are optional components. You may skip + compiling them if you do not plan to use NETGEN and/or GHS3D mesher + algorithms. + In general, each module (except KERNEL, of course) is optional for + SALOME. If you do not need any module, just do not compile or install + it. But remember that some modules require other ones to be built first + (see dependancies table above). + + - go to KERNEL module's sources directory: + + cd /home/salome/KERNEL_SRC_2.2.0 + + - set environment variables (use bash or csh script, depending on + your shell): + + source salome.csh + or + source salome.sh - - go to KERNEL module's sources directory: + - create a configuration script by typing - cd /home/salome/KERNEL_SRC_2.2.0 + ./build_configure - - set environment variables (use bash or csh script, depending on - your shell): + - go to the parent directory and create build directory: - source salome.c[s]h + cd .. + mkdir KERNEL_build - - create a configuration script by typing + - run configure script which will check the environment and create + Makefile files: - ./build_configure + cd KERNEL_build + ../KERNEL_SRC_2.2.0/configure --prefix=/home/salome/KERNEL_install - - go to the parent directory and create build directory: + Note, that --prefix option defines the directory where you want to + install KERNEL module after 'make install' procedure. + More about certain module's configure options you can learn by using + --help (-h) parameter. - cd .. - mkdir KERNEL_build + - build and install KERNEL module: - - configure the sources and create Makefile files: + make + make install - cd KERNEL_build - ../KERNEL_SRC_2.2.0/configure --prefix=/home/salome/KERNEL_install + After you have completed this scenario, KERNEL module is built and + installed into /home/salome/KERNEL_install directory. - Note, that --prefix option defines the directory where you want to install - KERNEL module after make install procedure. - More about certain module's configure options you can learn by typing - --help (-h) parameter. + - set environment: - - build and install KERNEL module: + * for bash: - make - make install + export KERNEL_ROOT_DIR=/home/salome/KERNEL_install + or + export KERNEL_ROOT_DIR=/home/salome/KERNEL_build + (if make install step was not performed). - After you have completed this scenario, KERNEL module is built and - installed into /home/salome/KERNEL_install directory. + * for csh: - - set environment: + setenv KERNEL_ROOT_DIR /home/salome/KERNEL_install + or + setenv KERNEL_ROOT_DIR /home/salome/KERNEL_build + (if make install step was not performed). - * for bash: - export KERNEL_ROOT_DIR=/home/salome/KERNEL_install - or - export KERNEL_ROOT_DIR=/home/salome/KERNEL_build - (if make install step was not performed). + - then repeat this scenario for other modules you want to build taking + into account the dependancies between modules (see dependancies table + above). - * for csh: - setenv KERNEL_ROOT_DIR /home/salome/KERNEL_install - or - setenv KERNEL_ROOT_DIR /home/salome/KERNEL_build - (if make install step was not performed). + Note: if the compilation fails it may be caused by bad environment. + In this case you should check that environment script you use + (salome.csh or salome.sh) contains the following lines for each module: - - then repeat this scenario for other modules you want to build in accordance - with modules dependancies. + * for bash: - Note: if the compilation fails it may be caused by poor environment. - In this case you should check that environment script you use (salome.csh - or salome.sh) contains the following lines for each module: + export PATH=${_ROOT_DIR}/bin/salome:${PATH} + export LD_LIBRARY_PATH=${_ROOT_DIR}/lib/salome:${LD_LIBRARY_PATH} + export PYTHONPATH=${_ROOT_DIR}/bin/salome:${PYTHONPATH} + export PYTHONPATH=${_ROOT_DIR}/lib/salome:${PYTHONPATH} + export PYTHONPATH=${_ROOT_DIR}/lib/python2.2/site-packages/salome:${PYTHONPATH} + export PYTHONPATH=${_ROOT_DIR}/lib/python2.2/site-packages/salome/shared_modules:${PYTHONPATH} - * for bash: - export PATH=${_ROOT_DIR}/bin/salome:${PATH} - export LD_LIBRARY_PATH=${_ROOT_DIR}/lib/salome:${LD_LIBRARY_PATH} - export PYTHONPATH=${_ROOT_DIR}/bin/salome:${PYTHONPATH} - export PYTHONPATH=${_ROOT_DIR}/lib/salome:${PYTHONPATH} - export PYTHONPATH=${_ROOT_DIR}/lib/python2.2/site-packages/salome:${PYTHONPATH} - export PYTHONPATH=${_ROOT_DIR}/lib/python2.2/site-packages/salome/shared_modules:${PYTHONPATH} + * for csh: - * for csh: - setenv PATH ${_ROOT_DIR}/bin/salome:${PATH} - setenv LD_LIBRARY_PATH ${_ROOT_DIR}/lib/salome:${LD_LIBRARY_PATH} - setenv PYTHONPATH ${_ROOT_DIR}/bin/salome:${PYTHONPATH} - setenv PYTHONPATH ${_ROOT_DIR}/lib/salome:${PYTHONPATH} - setenv PYTHONPATH ${_ROOT_DIR}/lib/python2.2/site-packages/salome:${PYTHONPATH} - setenv PYTHONPATH ${_ROOT_DIR}/lib/python2.2/site-packages/salome/shared_modules:${PYTHONPATH} + setenv PATH ${_ROOT_DIR}/bin/salome:${PATH} + setenv LD_LIBRARY_PATH ${_ROOT_DIR}/lib/salome:${LD_LIBRARY_PATH} + setenv PYTHONPATH ${_ROOT_DIR}/bin/salome:${PYTHONPATH} + setenv PYTHONPATH ${_ROOT_DIR}/lib/salome:${PYTHONPATH} + setenv PYTHONPATH ${_ROOT_DIR}/lib/python2.2/site-packages/salome:${PYTHONPATH} + setenv PYTHONPATH ${_ROOT_DIR}/lib/python2.2/site-packages/salome/shared_modules:${PYTHONPATH} + 4.2. Automatic build procedure: build.csh script + + From version 2.2.0 SALOME Installation Wizard provides the script + for automatic building of SALOME modules from sources packages: + build.csh. It is installed into the top-level target directory + (the same directory where env_products.[c]sh files are generated. + + To use this script just install SALOME sources packages with + Installation Wizard, then cd to the SALOME isntallation directory + and type: + + ./build.csh + + and that's all. + + By default, build.csh only compiles the modules but not installs them, + i.e. does not perform 'make install' step. + To do this, use -i option or -p where is target + directory. + + If you want to build only some SALOME modules, just pass them as + parameters, e.g.: + + ./build.csh -i KERNEL MED GEOM + + The script also provides some other options which specify compiling + and installation parameters. You can learn about options by using + -h key: + + ./build.csh -h + + When you run build.csh at first time it is not necessary to pass + -b, -c parameters. The script detects if build procedure has not yet + been performed and runs build_configure, configure procedures + in this case. + + Note: for avoiding of collisions it is recommended not to install + SALOME binaries packages with Installation Wizard if you plan to build + SALOME modules from sources packages or to edit/comment all rows + in env_products.csh file concerning binaries packages. + + Note: use -d option carefully because in this case the script removes + existing (previously installed) SALOME modules. + ================================================================================ diff --git a/config_files/build.csh b/config_files/build.csh new file mode 100755 index 0000000..bf67104 --- /dev/null +++ b/config_files/build.csh @@ -0,0 +1,336 @@ +#! /bin/csh -f +################################################################################################## +# Name : build.csh +# Description: Build and install SALOME2 modules from sources +# Author : Vadim SANDLER (VSR), Open CASCADE S.A. +# Created : 27.01.2005 +################################################################################################## + +set is_build_configure=0 +set is_configure=0 +set is_delete=0 +set verbose_level=2 +set params="" +set b_params="" +set modules=(KERNEL GEOM MED SMESH VISU SUPERV NETGENPLUGIN GHS3DPLUGIN COMPONENT PYCALCULATOR) +set optim="" +set is_install=0 +set is_help=0 +set prefix="" + +######################################################### +# parse parameters +######################################################### +while ( ${%1} > 0 ) + if ( "$1" == "-b" ) then + set is_build_configure=1 + set is_configure=1 + else if ( "$1" == "-c" ) then + set is_configure=1 + else if ( "$1" == "-d" ) then + set is_delete=1 + else if ( "$1" == "-o" ) then + set optim="--enable-production=yes --disable-debug" + else if ( "$1" == "-i" ) then + set is_install=1 + else if ( "$1" == "-v" ) then + shift + set verbose_level=$1 + else if ( "$1" == "-p" ) then + shift + set is_install=1 + set prefix=$1 + else if ( "$1" == "-h" ) then + set is_help=1 + else + set ckt=`echo ${modules} | grep $1` + if ( "$ckt" != "" ) then + set params="$params $1" + else + set b_params="$b_params $1" + echo "Warning: Unknown module: $1. Skipping." + endif + endif + shift +end + +######################################################### +# if -h option is given - print help info and exit +######################################################### + if ( $is_help == 1 ) then +echo "" +echo "" +echo "Description:" +echo " Builds given SALOME2 modules by performing make and (optionally) make install commands" +echo "" +echo "Usage:" +echo " build.csh [