From: Nabil Ghodbane Date: Thu, 9 Feb 2023 13:33:49 +0000 (+0100) Subject: spns #33457: SOLVERLAB new GUI X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fspns%2F33457;p=tools%2Fsat_salome.git spns #33457: SOLVERLAB new GUI --- diff --git a/applications/SALOME-master-native.pyconf b/applications/SALOME-master-native.pyconf index 5186a63..6cdedd2 100644 --- a/applications/SALOME-master-native.pyconf +++ b/applications/SALOME-master-native.pyconf @@ -94,7 +94,7 @@ APPLICATION : openturns: '1.19' ospray : '2.4.0' packaging : 'native' - packagespy : '9bb05ac' + packagespy : '74152cd' pandas : 'native' ParaView : {tag:'5.11.0', base: 'no', section: 'version_5_11_0_MPI', hpc: 'yes'} PERSALYS: 'v13.0' @@ -180,6 +180,7 @@ APPLICATION : 'YDEFX' 'pmml' 'SOLVERLAB' + 'SOLVERLABGUI' 'TopIIVolMesh' #'TESTBASE' 'CEATESTBASE' : 'SalomeV9' diff --git a/products/SOLVERLAB.pyconf b/products/SOLVERLAB.pyconf index d61c407..48d18ed 100644 --- a/products/SOLVERLAB.pyconf +++ b/products/SOLVERLAB.pyconf @@ -37,7 +37,6 @@ default : { is_SALOME_module : "yes" incremental : "yes" - has_salome_gui : "yes" } patches: [] } @@ -61,6 +60,16 @@ default_MPI : opt_depend : ['mpi4py'] } +version_V9_10_0 : +{ + properties: + { + is_SALOME_module : "yes" + incremental : "yes" + has_salome_gui : "yes" + } +} + version_V9_10_0_MPI : { depend : @@ -78,6 +87,22 @@ version_V9_10_0_MPI : 'openmpi' ] opt_depend : ['mpi4py'] + properties: + { + is_SALOME_module : "yes" + incremental : "yes" + has_salome_gui : "yes" + } +} + +version_V9_9_0 : +{ + properties: + { + is_SALOME_module : "yes" + incremental : "yes" + has_salome_gui : "yes" + } } version_V9_9_0_MPI : @@ -97,4 +122,20 @@ version_V9_9_0_MPI : 'openmpi' ] opt_depend : ['mpi4py'] + properties: + { + is_SALOME_module : "yes" + incremental : "yes" + has_salome_gui : "yes" + } +} + +version_V9_8_0 : +{ + properties: + { + is_SALOME_module : "yes" + incremental : "yes" + has_salome_gui : "yes" + } } diff --git a/products/SOLVERLABGUI.pyconf b/products/SOLVERLABGUI.pyconf new file mode 100644 index 0000000..6ec27a0 --- /dev/null +++ b/products/SOLVERLABGUI.pyconf @@ -0,0 +1,35 @@ +default : +{ + name : "SOLVERLABGUI" + build_source : "cmake" + build_command : "-DPython_ROOT_DIR=${PYTHON_ROOT_DIR} -DPython_EXECUTABLE=${PYTHONBIN} -DPACKAGESPY_ROOT_DIR=${PACKAGESPY_ROOT_DIR}" + get_source : "dir" + dir_info : + { + dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + 'SOLVERLAB' + $VARS.sep + 'solverlabGUI' + } + environ : + { + SalomeAppConfig_ : $install_dir + $VARS.sep + "share" + $VARS.sep + "salome" + $VARS.sep + "resources" + $VARS.sep + "solverlabgui" + env_script : $name + ".py" + } + depend : + [ + 'KERNEL', + 'GUI', + 'SOLVERLAB', + 'MEDCOUPLING', + 'packagespy' + ] + build_depend : ["cmake", "swig", "doxygen", "graphviz","cppunit"] + source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + 'SOLVERLAB' + $VARS.sep + 'solverlabGUI' + build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name + nb_proc : 1 + properties: + { + is_SALOME_module : "yes" + incremental : "yes" + has_salome_gui : "yes" + } + patches: [] +} diff --git a/products/compil_scripts/SOLVERLAB.sh b/products/compil_scripts/SOLVERLAB.sh index df0e932..fa08db5 100755 --- a/products/compil_scripts/SOLVERLAB.sh +++ b/products/compil_scripts/SOLVERLAB.sh @@ -4,46 +4,68 @@ echo "########################################################################## echo "SOLVERLAB" $VERSION echo "##########################################################################" +rm -rf $BUILD_DIR +mkdir $BUILD_DIR +cd $BUILD_DIR +CMAKE_OPTIONS= CMAKE_OPTIONS+=" -DPython_ROOT_DIR=${PYTHON_ROOT_DIR}" CMAKE_OPTIONS+=" -DPython_EXECUTABLE=${PYTHONBIN}" CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX=${PRODUCT_INSTALL}" -if [ $VERSION == "V9_6_0" ]; then - # GUI was ported after 9.6.0 - CMAKE_OPTIONS+=" -DCOREFLOWS_WITH_GUI=OFF" - # following variables are automatically detected in environment after 9.6.0 - CMAKE_OPTIONS+=" -DPYQT5_ROOT_DIR=${PYQT5_ROOT_DIR}" - CMAKE_OPTIONS+=" -DMATPLOTLIB_ROOT_DIR=${MATPLOTLIB_ROOT_DIR}" - CMAKE_OPTIONS+=" -DSWIG_EXECUTABLE=${SWIG_ROOT_DIR}/bin/swig" - CMAKE_OPTIONS+=" -DDOXYGEN_EXECUTABLE=${DOXYGEN_ROOT_DIR}/bin/doxygen" - CMAKE_OPTIONS+=" -DCPPUNIT_ROOT_USER=${CPPUNIT_ROOT_DIR}" - CMAKE_OPTIONS+=" -DHDF5_ROOT=${HDF5_ROOT_DIR}" - CMAKE_OPTIONS+=" -DMEDFILE_ROOT_DIR=${MEDFILE_ROOT_DIR}" - CMAKE_OPTIONS+=" -DPARAVIEW_ROOT_DIR=${PARAVIEW_ROOT_DIR}" - CMAKE_OPTIONS+=" -DPETSC_DIR=${PETSC_ROOT_DIR}" - CMAKE_OPTIONS+=" -DKERNEL_ROOT_DIR=${KERNEL_ROOT_DIR}" - CMAKE_OPTIONS+=" -DGUI_ROOT_DIR=${GUI_ROOT_DIR}" - CMAKE_OPTIONS+=" -DMEDCOUPLING_ROOT_DIR=${MEDCOUPLING_ROOT_DIR}" -else - CMAKE_OPTIONS+=" -DCOREFLOWS_WITH_GUI=ON" -fi - -if [ -n "$SAT_HPC" ]; then - if [ $VERSION == "V9_6_0" ] && [ -n "$MPI_ROOT_DIR" ]; then - # following variable is automatically detected in environment after 9.6.0 - CMAKE_OPTIONS+=" -DMPI_HOME=${MPI_ROOT_DIR}" +if [ ! -d $SOURCE_DIR/solverlabGUI ]; then + if [ $VERSION == "V9_6_0" ]; then + # GUI was ported after 9.6.0 + CMAKE_OPTIONS+=" -DCOREFLOWS_WITH_GUI=OFF" + # following variables are automatically detected in environment after 9.6.0 + CMAKE_OPTIONS+=" -DPYQT5_ROOT_DIR=${PYQT5_ROOT_DIR}" + CMAKE_OPTIONS+=" -DMATPLOTLIB_ROOT_DIR=${MATPLOTLIB_ROOT_DIR}" + CMAKE_OPTIONS+=" -DSWIG_EXECUTABLE=${SWIG_ROOT_DIR}/bin/swig" + CMAKE_OPTIONS+=" -DDOXYGEN_EXECUTABLE=${DOXYGEN_ROOT_DIR}/bin/doxygen" + CMAKE_OPTIONS+=" -DCPPUNIT_ROOT_USER=${CPPUNIT_ROOT_DIR}" + CMAKE_OPTIONS+=" -DHDF5_ROOT=${HDF5_ROOT_DIR}" + CMAKE_OPTIONS+=" -DMEDFILE_ROOT_DIR=${MEDFILE_ROOT_DIR}" + CMAKE_OPTIONS+=" -DPARAVIEW_ROOT_DIR=${PARAVIEW_ROOT_DIR}" + CMAKE_OPTIONS+=" -DPETSC_DIR=${PETSC_ROOT_DIR}" + CMAKE_OPTIONS+=" -DKERNEL_ROOT_DIR=${KERNEL_ROOT_DIR}" + CMAKE_OPTIONS+=" -DGUI_ROOT_DIR=${GUI_ROOT_DIR}" + CMAKE_OPTIONS+=" -DMEDCOUPLING_ROOT_DIR=${MEDCOUPLING_ROOT_DIR}" + else + CMAKE_OPTIONS+=" -DCOREFLOWS_WITH_GUI=ON" + CMAKE_OPTIONS+=" -DPACKAGESPY_ROOT_DIR=${PACKAGESPY_ROOT_DIR}" + # CMAKE_OPTIONS+=" -DSOLVERLAB_WITH_PACKAGESPY=ON" fi - CMAKE_OPTIONS+=" -DMPI_ROOT_DIR=${MPI_ROOT_DIR}" - CMAKE_OPTIONS+=" -DSOLVERLAB_WITH_MPI=ON" - if [ -n "$MPI_ROOT_DIR" ]; then - CMAKE_OPTIONS+=" -DCMAKE_CXX_COMPILER:STRING=${MPI_CXX_COMPILER}" - CMAKE_OPTIONS+=" -DCMAKE_C_COMPILER:STRING=${MPI_C_COMPILER}" + if [ -n "$SAT_HPC" ]; then + if [ $VERSION == "V9_6_0" ] && [ -n "$MPI_ROOT_DIR" ]; then + # following variable is automatically detected in environment after 9.6.0 + CMAKE_OPTIONS+=" -DMPI_HOME=${MPI_ROOT_DIR}" + fi + CMAKE_OPTIONS+=" -DMPI_ROOT_DIR=${MPI_ROOT_DIR}" + CMAKE_OPTIONS+=" -DSOLVERLAB_WITH_MPI=ON" + if [ -n "$MPI_ROOT_DIR" ]; then + CMAKE_OPTIONS+=" -DCMAKE_CXX_COMPILER:STRING=${MPI_CXX_COMPILER}" + CMAKE_OPTIONS+=" -DCMAKE_C_COMPILER:STRING=${MPI_C_COMPILER}" + fi + if [ -n "$MPI4PY_ROOT_DIR" ]; then + CMAKE_OPTIONS+=" -DMPI4PY_ROOT_DIR:PATH=${MPI4PY_ROOT_DIR}" + else + echo "WARNING: mpi4py environment variable not detected" + fi fi - if [ -n "$MPI4PY_ROOT_DIR" ]; then - CMAKE_OPTIONS+=" -DMPI4PY_ROOT_DIR:PATH=${MPI4PY_ROOT_DIR}" - else - echo "WARNING: mpi4py environment variable not detected" +else + CMAKE_OPTIONS+=" -DCOREFLOWS_WITH_GUI=OFF" + if [ -n "$SAT_HPC" ]; then + CMAKE_OPTIONS+=" -DMPI_ROOT_DIR=${MPI_ROOT_DIR}" + CMAKE_OPTIONS+=" -DSOLVERLAB_WITH_MPI=ON" + if [ -n "$MPI_ROOT_DIR" ]; then + CMAKE_OPTIONS+=" -DCMAKE_CXX_COMPILER:STRING=${MPI_CXX_COMPILER}" + CMAKE_OPTIONS+=" -DCMAKE_C_COMPILER:STRING=${MPI_C_COMPILER}" + fi + if [ -n "$MPI4PY_ROOT_DIR" ]; then + CMAKE_OPTIONS+=" -DMPI4PY_ROOT_DIR:PATH=${MPI4PY_ROOT_DIR}" + else + echo "WARNING: mpi4py environment variable not detected" + fi fi fi diff --git a/products/compil_scripts/packagespy.sh b/products/compil_scripts/packagespy.sh index 2edb32c..559facf 100755 --- a/products/compil_scripts/packagespy.sh +++ b/products/compil_scripts/packagespy.sh @@ -5,6 +5,9 @@ echo "packagespy" $VERSION echo "##########################################################################" # nothing to be done here, simply copy sources to installation directory +if [ ! -d $PRODUCT_INSTALL ]; then + mkdir -p $PRODUCT_INSTALL +fi cp -rf $SOURCE_DIR/packagespy $PRODUCT_INSTALL if [ $? -ne 0 ] then @@ -12,8 +15,19 @@ then exit 1 fi cd $PRODUCT_INSTALL/ +echo $PRODUCT_INSTALL +ls -ltr +# ensure that we are using our python PYTHON=${PYTHONBIN##*/} -grep -rl '#!/usr/bin/env python' . |xargs sed -i "s%#\!/usr/bin/env python/#\!/usr/bin/env ${PYTHON}/g" +echo "INFO: list of files which will be patched..." +for f in $(grep -rl '#!/usr/bin/env python' . ); do + echo INFO: patching file $f + sed -i "s%#\!/usr/bin/env python%#\!/usr/bin/env ${PYTHON}%g" $f + if [ $? -ne 0 ]; then + echo "ERROR: could not patch file: $f" + exit 2 + fi +done echo echo "########## END" diff --git a/products/env_scripts/SOLVERLAB.py b/products/env_scripts/SOLVERLAB.py index 54d2840..e84c7cb 100644 --- a/products/env_scripts/SOLVERLAB.py +++ b/products/env_scripts/SOLVERLAB.py @@ -23,7 +23,9 @@ def set_env(env, product_dir, version): env.prepend('PATH', os.path.join(root, 'include')) env.prepend('LD_LIBRARY_PATH', os.path.join(root, 'lib')) + env.prepend('PYTHONPATH', root) env.prepend('PYTHONPATH', os.path.join(root, 'lib')) + env.prepend('PYTHONPATH', os.path.join(root, 'bin')) env.prepend('PYTHONPATH', os.path.join(root, 'lib', 'coreflows')) env.prepend('PYTHONPATH', os.path.join(root, 'bin', 'coreflows')) env.prepend('PYTHONPATH', os.path.join(root, 'lib', 'cdmath')) diff --git a/products/env_scripts/SOLVERLABGUI.py b/products/env_scripts/SOLVERLABGUI.py new file mode 100644 index 0000000..8c71ff1 --- /dev/null +++ b/products/env_scripts/SOLVERLABGUI.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +import os.path +import platform + +def set_env(env, product_dir, version): + env.set('SOLVERLABGUI_ROOT_DIR', product_dir) + env.prepend('LD_LIBRARY_PATH', os.path.join(product_dir, 'lib')) + env.prepend('PYTHONPATH', product_dir) + env.prepend('PYTHONPATH', os.path.join(product_dir, 'solverlabpy')) + env.prepend('PYTHONPATH', os.path.join(product_dir, 'bin', 'salome')) + env.set('SOLVERLABGUI_WORKDIR', r'/tmp') + env.set('USERLOGIN', "$USER") + +def set_nativ_env(env): + pass diff --git a/products/env_scripts/packagespy.py b/products/env_scripts/packagespy.py index 73a4f78..bb5498c 100644 --- a/products/env_scripts/packagespy.py +++ b/products/env_scripts/packagespy.py @@ -3,10 +3,12 @@ import os import platform - +import os def set_env(env, prereq_dir, version): env.set("PACKAGESPY_ROOT_DIR",prereq_dir) - env.prepend('PYTHONPATH',prereq_dir) + env.set("WORKDIR4LOG",os.path.join('tmp', os.getlogin())) + env.prepend('PYTHONPATH',os.path.join(prereq_dir, 'packagespy')) + env.prepend('PATH',os.path.join(prereq_dir,'packagespy','bin')) def set_nativ_env(env): pass diff --git a/products/packagespy.pyconf b/products/packagespy.pyconf index f383b6b..9c87ac3 100644 --- a/products/packagespy.pyconf +++ b/products/packagespy.pyconf @@ -9,7 +9,7 @@ default : env_script : $name + ".py" } patches : [] - depend : ["python", "setuptools"] + depend : ["Python", "setuptools"] source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name install_dir : 'base' @@ -19,7 +19,7 @@ default : } } -version_9bb05ac : +version_74152cd : { - archive_info : {archive_name : "packagespy-9bb05ac.tar.gz"} + archive_info : {archive_name : "packagespy-74152cd.tar.gz"} }