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
================================================================================
--killall
Kill SALOME, running on all ports
--modules=<module>,<module>,...,<module>
- Use module(s), possible values are GEOM, SMESH, VISU, MED, SUPERV
+ Use module(s), possible values are GEOM,SMESH,VISU,MED,SUPERV
--embedded=<container>,<container>,...<container>
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=<container>,<container>,...<container>
- 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 <plugin> tag.
This tag can be used currently only for SMESH module to point external
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
* 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=${<module>_ROOT_DIR}/bin/salome:${PATH}
+ export LD_LIBRARY_PATH=${<module>_ROOT_DIR}/lib/salome:${LD_LIBRARY_PATH}
+ export PYTHONPATH=${<module>_ROOT_DIR}/bin/salome:${PYTHONPATH}
+ export PYTHONPATH=${<module>_ROOT_DIR}/lib/salome:${PYTHONPATH}
+ export PYTHONPATH=${<module>_ROOT_DIR}/lib/python2.2/site-packages/salome:${PYTHONPATH}
+ export PYTHONPATH=${<module>_ROOT_DIR}/lib/python2.2/site-packages/salome/shared_modules:${PYTHONPATH}
- * for bash:
- export PATH=${<module>_ROOT_DIR}/bin/salome:${PATH}
- export LD_LIBRARY_PATH=${<module>_ROOT_DIR}/lib/salome:${LD_LIBRARY_PATH}
- export PYTHONPATH=${<module>_ROOT_DIR}/bin/salome:${PYTHONPATH}
- export PYTHONPATH=${<module>_ROOT_DIR}/lib/salome:${PYTHONPATH}
- export PYTHONPATH=${<module>_ROOT_DIR}/lib/python2.2/site-packages/salome:${PYTHONPATH}
- export PYTHONPATH=${<module>_ROOT_DIR}/lib/python2.2/site-packages/salome/shared_modules:${PYTHONPATH}
+ * for csh:
- * for csh:
- setenv PATH ${<module>_ROOT_DIR}/bin/salome:${PATH}
- setenv LD_LIBRARY_PATH ${<module>_ROOT_DIR}/lib/salome:${LD_LIBRARY_PATH}
- setenv PYTHONPATH ${<module>_ROOT_DIR}/bin/salome:${PYTHONPATH}
- setenv PYTHONPATH ${<module>_ROOT_DIR}/lib/salome:${PYTHONPATH}
- setenv PYTHONPATH ${<module>_ROOT_DIR}/lib/python2.2/site-packages/salome:${PYTHONPATH}
- setenv PYTHONPATH ${<module>_ROOT_DIR}/lib/python2.2/site-packages/salome/shared_modules:${PYTHONPATH}
+ setenv PATH ${<module>_ROOT_DIR}/bin/salome:${PATH}
+ setenv LD_LIBRARY_PATH ${<module>_ROOT_DIR}/lib/salome:${LD_LIBRARY_PATH}
+ setenv PYTHONPATH ${<module>_ROOT_DIR}/bin/salome:${PYTHONPATH}
+ setenv PYTHONPATH ${<module>_ROOT_DIR}/lib/salome:${PYTHONPATH}
+ setenv PYTHONPATH ${<module>_ROOT_DIR}/lib/python2.2/site-packages/salome:${PYTHONPATH}
+ setenv PYTHONPATH ${<module>_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 <prefix> where <prefix> 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.
+
================================================================================
--- /dev/null
+#! /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 [ <option> ] ... [ <module> [ <module> ... ] ]"
+echo ""
+echo "<module> Modules to build, separated by space(s)."
+echo " If no modules are given - all SALOME2 modules are assumed."
+echo " Note, that modules given in command lines are automatically sorted in such order"
+echo " to support correct modules dependencies."
+echo ""
+echo "Options:"
+echo "-b Perform build_configure command for all given modules."
+echo " This option forces configure (-c) key to be set. Default is off."
+echo ""
+echo "-c Perform configure command for all given modules. Default is off."
+echo ""
+echo "-d Delete build directories before calling configure, to enforce full rebuild"
+echo " (and reinstall if -i or -p option is used) of module."
+echo " Use this option carefully."
+echo ""
+echo "-o Build sources in optimized mode. Default is off that means debug mode."
+echo " Use this option together with -c or -b."
+echo " This option can require -d option to be set (to ensure that previously"
+echo " created build directories are removed to enforce rebuild in optimized mode)."
+echo ""
+echo "-i Performs make install step. Default is off that means only make step."
+echo ""
+echo "-p <prefix> Define the directory where to install modules after compilation."
+echo " By default the directory where compilation is performed is used."
+echo ""
+echo "-v <level> Verbose level (0-2, default 2): print information on build status:"
+echo " 0: only 'make' errors"
+echo " 1: 0 + compiler and other errors (including build_configure, configure)"
+echo " 2: 1 + compiler and other warnings "
+echo ""
+echo "-h Prints this help information."
+echo ""
+echo "Note: If no keys are given script just performs make step."
+echo ""
+echo "Example:"
+echo " ./build.csh -o -i -b KERNEL MED GEOM"
+echo ""
+echo " This will make KERNEL, GEOM and MED modules: build_configure, configure, make"
+echo " and install procedures will be performed for all specified modules."
+echo " The modules will be built in the optimized mode"
+echo ""
+exit
+endif
+
+#########################################################
+# sort modules in proper order according to the dependancies
+#########################################################
+if ( "${params}" != "" ) then
+ set xparams=""
+ foreach module (${modules})
+ set ckt=`echo ${params} | grep ${module}`
+ if ( "$ckt" != "" ) then
+ set xparams="$xparams $module"
+ endif
+ end
+ set modules=($xparams)
+else
+ if ( "${b_params}" != "" ) then
+ echo "Nothing to be built. Exiting."
+ exit
+ endif
+endif
+
+echo "The following SALOME packages will be built:"
+echo $modules
+
+#########################################################
+# set environment
+#########################################################
+set env_script=`dirname $0`/env_products.csh
+if ( -e $env_script ) then
+ echo "Setting environment"
+ source $env_script
+else
+ echo "Warning! Environment is not set: file env_products.csh is not found."
+endif
+
+set BUILD_DIR=${PWD}
+set LOG_DIR=${BUILD_DIR}/LOGS
+
+#########################################################
+# create log directory
+#########################################################
+if ( ! -e ${LOG_DIR} ) then
+ mkdir -p ${LOG_DIR}
+endif
+
+echo "==========================================================================="
+echo "Starting SALOME build at `date`"
+
+#########################################################
+# loop for all given modules
+#########################################################
+foreach module (${modules})
+ echo "==========================================================================="
+ echo "Processing ${module} module"
+
+ set module_src=`printenv ${module}_SRC_DIR`
+ set module_build=${BUILD_DIR}/${module}_BUILD
+
+ if ( ${module_src} != "" ) then
+ set add_keys=""
+ cd ${BUILD_DIR}
+ #########################################################
+ # check if sources directory exists
+ #########################################################
+ if ( ! -e ${module_src} ) then
+ echo "Error! Can't find sources directory: ${module_src} does not exist."
+ continue
+ endif
+ #########################################################
+ # check if configure script exists
+ #########################################################
+ set cfg_exist=0
+ if ( -e ${module_src}/configure ) then
+ set cfg_exist=1
+ endif
+ #########################################################
+ # perform build_configure if -b flag is given or if
+ # configure script does not exist (first compilation?)
+ #########################################################
+ if ( $is_build_configure == 1 || $cfg_exist == 0 ) then
+ echo "------- Build configure ---------"
+ #########################################################
+ # if build_configure script is not found, omit the module
+ #########################################################
+ if ( ! -e ${module_src}/build_configure ) then
+ echo "Error! Nothing to build in ${module_src}. Skipping module."
+ continue
+ endif
+ #########################################################
+ # call build_configure
+ #########################################################
+ cd ${module_src}
+ ./build_configure >& ${LOG_DIR}/build_configure_${module}.log
+ #########################################################
+ # echo possible errors
+ #########################################################
+ if ( $verbose_level > 0 ) then
+ cat ${LOG_DIR}/build_configure_${module}.log | grep ": error:"
+ endif
+ endif
+ #########################################################
+ # deleting build directory if -d flag is given
+ #########################################################
+ if ( -e ${module_build} && $is_delete == 1 ) then
+ echo "Deleting ${module_build}"
+ rm -rf ${module_build}
+ endif
+ #########################################################
+ # creating build directory if it does not exist
+ #########################################################
+ if ( ! -e ${module_build} ) then
+ mkdir -p ${module_build}
+ endif
+ cd ${module_build}
+ #########################################################
+ # check if top Makefile exists in build directory, i.e.
+ # is it necessary to run configure script
+ #########################################################
+ set mkfile_exist=0
+ if ( -e ${module_build}/Makefile ) then
+ set mkfile_exist=1
+ endif
+ #########################################################
+ # define installation directory (by using module's version
+ # number); default is a build directory
+ #########################################################
+ set vx=""
+ if ( -e ${module_src}/bin/VERSION ) then
+ set vx=`awk -F: '{split ( $2,x," " ) ; print x[1];}' ${module_src}/bin/VERSION`
+ endif
+ set px=${BUILD_DIR}/${module}
+ if ( "$prefix" != "" ) then
+ set px=$prefix/${module}
+ endif
+ if ( "$vx" != "" ) then
+ set px="$px"_"$vx"
+ endif
+ #########################################################
+ # perform configure if -c flag is given or if
+ # Makefile does not exist (first compilation?)
+ #########################################################
+ if ( $is_configure == 1 || $mkfile_exist == 0) then
+ echo "------- Configure ---------------"
+ if ( "${module}" == "NETGENPLUGIN" && ($?NETGEN_DIR) ) then
+ set add_keys="--with-netgen=${NETGEN_DIR}"
+ endif
+ ${module_src}/configure --prefix=$px ${optim} ${add_keys} >& ${LOG_DIR}/configure_${module}.log
+ #########################################################
+ # echo possible errors
+ #########################################################
+ if ( $verbose_level > 0 ) then
+ cat ${LOG_DIR}/configure_${module}.log | grep ": error:"
+ endif
+ if ( $verbose_level > 1 ) then
+ cat ${LOG_DIR}/configure_${module}.log | grep ": WARNING:"
+ endif
+ endif
+ #########################################################
+ # perform make
+ #########################################################
+ echo "------- Make --------------------"
+ #########################################################
+ # first clear dependencies
+ #########################################################
+ find . -name ".dep*" -exec rm -rf {} \; >& /dev/null
+ make >& ${LOG_DIR}/make_${module}.log
+ set sts=$status
+ #########################################################
+ # if make step is successful set the ${module}_ROOT_DIR
+ # environment variable
+ #########################################################
+ if ( $sts == 0 ) then
+ setenv ${module}_ROOT_DIR ${module_build}
+ endif
+ #########################################################
+ # print make errors
+ #########################################################
+ cat ${LOG_DIR}/make_${module}.log | grep '[*][*][*]'
+ #########################################################
+ # print compiler errors and warnings
+ # Note: here awk is used to concatenate together several lines of single
+ # error or warning message produced by stupid gnu compiler
+ # Actually, instead of that we could use 'fmessage length=n' option of g++...
+ #########################################################
+ if ( $verbose_level > 0 ) then
+ ###cat ${LOG_DIR}/make_${module}.log | grep ": error"
+ cat ${LOG_DIR}/make_${module}.log | awk 'substr($0,0,1)!=" " {print ""} {printf $0} END {print ""}' | grep "${module_src}/[A-Za-z_0-9./]*:" | sed s@"^${module_src}/src/"@@
+ endif
+ if ( $verbose_level > 1 ) then
+ cat ${LOG_DIR}/make_${module}.log | awk 'substr($0,0,1)!=" " {print ""} {printf $0} END {print ""}' | grep ": warning" | sed s@"^${module_src}/src/"@@
+ endif
+ #########################################################
+ # perform make if -i or -p flags are given
+ #########################################################
+ if ( $is_install == 1 && $sts == 0 ) then
+ echo "------- Make install ------------"
+ #########################################################
+ # deleting build directory if -d flag is given
+ #########################################################
+ if ( -e $px && $is_delete == 1 ) then
+ echo "Deleting $px"
+ rm -rf $px
+ endif
+ make install >& ${LOG_DIR}/make_install_${module}.log
+ set sts=$status
+ #########################################################
+ # if make install step is successful set the
+ # ${module}_ROOT_DIR environment variable
+ #########################################################
+ if ( $sts == 0 ) then
+ setenv ${module}_ROOT_DIR $px
+ endif
+ endif
+ echo ""
+ else
+ echo "Error! Can't find module sources. ${module}_SRC_DIR environment variable is not set."
+ endif
+end
+#########################################################
+# finalize
+#########################################################
+cd ${BUILD_DIR}
+
+echo "==========================================================================="
+echo "SALOME build finished at `date`"
+echo "==========================================================================="