From af67b7261b3266613e5104326c2a587510b60031 Mon Sep 17 00:00:00 2001 From: Christian Van Wambeke Date: Fri, 8 Dec 2023 17:18:49 +0100 Subject: [PATCH] better SOLVERLAB.sh SOLVERLAB.pyconf for hpc mandatory --- products/SOLVERLAB.pyconf | 5 +- products/compil_scripts/SOLVERLAB.sh | 134 +++++++++++++----------- products/compil_scripts/SOLVERLAB_cv.sh | 67 ------------ products/compil_scripts/petsc-3.16.0.sh | 5 +- 4 files changed, 78 insertions(+), 133 deletions(-) delete mode 100755 products/compil_scripts/SOLVERLAB_cv.sh diff --git a/products/SOLVERLAB.pyconf b/products/SOLVERLAB.pyconf index 4c43dfa..14b4e9c 100644 --- a/products/SOLVERLAB.pyconf +++ b/products/SOLVERLAB.pyconf @@ -44,6 +44,8 @@ default_MPI : { depend : [ + 'openmpi', + 'mpi4py', 'hdf5', 'matplotlib', 'medfile', @@ -54,9 +56,8 @@ default_MPI : 'KERNEL', 'GUI', 'MEDCOUPLING', - 'openmpi' ] - opt_depend : ['mpi4py'] + # opt_depend : ['mpi4py'] } version_V9_10_0 : diff --git a/products/compil_scripts/SOLVERLAB.sh b/products/compil_scripts/SOLVERLAB.sh index fa08db5..1a33809 100755 --- a/products/compil_scripts/SOLVERLAB.sh +++ b/products/compil_scripts/SOLVERLAB.sh @@ -1,74 +1,71 @@ #!/bin/bash -echo "##########################################################################" -echo "SOLVERLAB" $VERSION -echo "##########################################################################" rm -rf $BUILD_DIR mkdir $BUILD_DIR cd $BUILD_DIR +[ "${USER}" == "xxxxwambeke" ] && envs # wambeke pretty print environ + + +function f_ancestor_locate() { + local tmp=$(tail -1 locate.tmp) # last one could be not pertinent + cd $(dirname ${tmp}) + local n=${1:-1} + for ((; n != 0; n--)); do + cd $(dirname ${PWD}) + done + pwd +} + +function f_get_MPI4PY_ROOT_DIR { + # get where pip3 install mpi4py + # because compilation needs mpi4py.i + + # oops returns INSTALL/ParaView/lib/python3.9/site-packages/openmpi/mpi4py, no mpi4py.i included + # python -c "import os, mpi4py ; OPD=os.path.dirname ; print(OPD(OPD(mpi4py.__file__)))" + + # other way compilation needs mpi4py.i + # example /usr/lib64/python3.9/site-packages/openmpi/mpi4py/include/mpi4py/mpi4py.i + locate mpi4py.i > locate.tmp # get some... last one could be not pertinent + f_ancestor_locate 3 +} + +MPI4PY_ROOT_DIR=$(f_get_MPI4PY_ROOT_DIR) # example native /usr/lib64/python3.9/site-packages/openmpi (.../mpi4py!) + +set -x + +# cat locate.tmp # mpi4py.i see some... last one could be not pertinent + +SVL_TYPE="GNU" +SVL_BUILD_TYPE="Release" +SOLVERLAB_WITH_MPI="ON" # because we want ${SAT_HPC} mode mandatory +SOLVERLAB_WITH_DOCUMENTATION="ON" # could be set OFF for faster compilation +# MPI_HOME="/usr/lib64/openmpi" # useless, given from SAT +CMAKE_CXX_COMPILER=${MPI_CXX_COMPILER} # ${MPI_HOME}/bin/mpic++ ?mpicxx? +CMAKE_C_COMPILER=${MPI_C_COMPILER} # ${MPI_HOME}/bin/mpicc + CMAKE_OPTIONS= CMAKE_OPTIONS+=" -DPython_ROOT_DIR=${PYTHON_ROOT_DIR}" CMAKE_OPTIONS+=" -DPython_EXECUTABLE=${PYTHONBIN}" CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX=${PRODUCT_INSTALL}" +CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE=${SVL_BUILD_TYPE}" -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 - 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 -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 +CMAKE_OPTIONS+=" -DPETSC_DIR=${PETSC_ROOT_DIR}" + +CMAKE_OPTIONS+=" -DSOLVERLAB_WITH_MPI=${SOLVERLAB_WITH_MPI}" +CMAKE_OPTIONS+=" -DMPI_ROOT_DIR=${MPI_ROOT_DIR}" +CMAKE_OPTIONS+=" -DMPI4PY_ROOT_DIR:PATH=${MPI4PY_ROOT_DIR}" + +CMAKE_OPTIONS+=" -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}" +CMAKE_OPTIONS+=" -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}" +CMAKE_OPTIONS+=" -DSOLVERLAB_WITH_DOCUMENTATION=${SOLVERLAB_WITH_DOCUMENTATION}" + +set +x +echo "##########################################################################" +echo "SOLVERLAB HPC=1" +echo "##########################################################################" echo echo "*** cmake "$CMAKE_OPTIONS cmake $CMAKE_OPTIONS $SOURCE_DIR @@ -77,22 +74,33 @@ if [ $? -ne 0 ]; then exit 1 fi - echo echo "*** make" $MAKE_OPTIONS +# VERBOSE=1 make $MAKE_OPTIONS # for debug make $MAKE_OPTIONS if [ $? -ne 0 ]; then echo "ERROR on make" exit 2 fi +if [ "${SOLVERLAB_WITH_DOCUMENTATION}" == "ON" ]; then + echo + echo "*** make doc" + make docCDMATH docCoreFlows + if [ $? -ne 0 ]; then + echo "ERROR on make doc" + exit 3 + fi +fi + echo -echo "*** make doc install" -make docCDMATH docCoreFlows install +echo "*** make install" +make install if [ $? -ne 0 ]; then echo "ERROR on make install" - exit 3 + exit 4 fi echo -echo "########## END" +echo "########## END SOLVERLAB compilation" +exit 0 diff --git a/products/compil_scripts/SOLVERLAB_cv.sh b/products/compil_scripts/SOLVERLAB_cv.sh deleted file mode 100755 index 4c343f7..0000000 --- a/products/compil_scripts/SOLVERLAB_cv.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash - -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}" -CMAKE_OPTIONS+=" -DSOLVERLAB_WITH_TRACE=OFF" -CMAKE_OPTIONS+=" -DSOLVERLAB_WITH_TRACE_COLORED=OFF" -CMAKE_OPTIONS+=" -DSOLVERLAB_WITH_DOCUMENTATION=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" - CMAKE_OPTIONS+=" -DMPI4PY_ROOT_DIR:PATH=/home/catA/wambeke/.local/lib/python3.9/site-packages" - # "/export/home/catA/wambeke/SALOME_9_11/SALOME-9.11.0-native-FD34/INSTALL/ParaView/lib/python3.9/site-packages/mpi4py" - fi - #fi - -export MPI4PY_ROOT_DIR="/home/catA/wambeke/.local/lib/python3.9/site-packages" - -echo -echo "*** cmake "$CMAKE_OPTIONS -cmake $CMAKE_OPTIONS $SOURCE_DIR -if [ $? -ne 0 ]; then - echo "ERROR on cmake" - exit 1 -fi - - -echo -echo "*** make" $MAKE_OPTIONS -make $MAKE_OPTIONS -if [ $? -ne 0 ]; then - echo "ERROR on make" - exit 2 -fi - -echo -echo "*** make doc install" -make docCDMATH docCoreFlows install -if [ $? -ne 0 ]; then - echo "ERROR on make install" - exit 3 -fi - -echo -echo "########## END" diff --git a/products/compil_scripts/petsc-3.16.0.sh b/products/compil_scripts/petsc-3.16.0.sh index 6d066cb..72b451d 100755 --- a/products/compil_scripts/petsc-3.16.0.sh +++ b/products/compil_scripts/petsc-3.16.0.sh @@ -1,7 +1,7 @@ #!/bin/bash echo "##########################################################################" -echo "Petsc" $VERSION +echo "Petsc ${VERSION} HPC=${SAT_HPC}" echo "##########################################################################" cp -r $SOURCE_DIR/* . @@ -14,6 +14,9 @@ CONFIGURE_FLAGS+=" --download-metis=ext/metis-5.1.0-p10.tar.gz" CONFIGURE_FLAGS+=" --with-debugging=0" # by default Petsc is build in debug mode CONFIGURE_FLAGS+=" --with-petsc4py=yes" CONFIGURE_FLAGS+=" --download-slepc-configure-arguments=--with-slepc4py=yes " + +# CONFIGURE_FLAGS+=" --with-med=yes --download-med=ext/" # TODO cvw + echo if [ -n "${SAT_HPC}" ] then -- 2.39.2