#!/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
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
+++ /dev/null
-#!/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"