From 527524f8cde0e4dc10b5a963d3182f69fd8ed2b1 Mon Sep 17 00:00:00 2001 From: Guytri KASTANE Date: Thu, 28 Sep 2023 10:12:45 +0200 Subject: [PATCH] update petsc compil script and add SOLVERLABGUI compil scrpit --- products/SOLVERLABGUI.pyconf | 8 ++-- products/compil_scripts/SOLVERLABGUI.sh | 61 +++++++++++++++++++++++++ products/compil_scripts/petsc-3.19.4.sh | 24 ++++++++-- 3 files changed, 86 insertions(+), 7 deletions(-) create mode 100755 products/compil_scripts/SOLVERLABGUI.sh diff --git a/products/SOLVERLABGUI.pyconf b/products/SOLVERLABGUI.pyconf index 6ec27a0..7531f55 100644 --- a/products/SOLVERLABGUI.pyconf +++ b/products/SOLVERLABGUI.pyconf @@ -1,8 +1,8 @@ default : { name : "SOLVERLABGUI" - build_source : "cmake" - build_command : "-DPython_ROOT_DIR=${PYTHON_ROOT_DIR} -DPython_EXECUTABLE=${PYTHONBIN} -DPACKAGESPY_ROOT_DIR=${PACKAGESPY_ROOT_DIR}" + build_source : "script" + compil_script : $name + ".sh" get_source : "dir" dir_info : { @@ -19,9 +19,11 @@ default : 'GUI', 'SOLVERLAB', 'MEDCOUPLING', - 'packagespy' + 'packagespy', + "qt" ] build_depend : ["cmake", "swig", "doxygen", "graphviz","cppunit"] + opt_depend : ['openmpi'] 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 diff --git a/products/compil_scripts/SOLVERLABGUI.sh b/products/compil_scripts/SOLVERLABGUI.sh new file mode 100755 index 0000000..8edaa7f --- /dev/null +++ b/products/compil_scripts/SOLVERLABGUI.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +echo "##########################################################################" +echo "SOLVERLABGUI" $VERSION +echo "##########################################################################" + +rm -rf $BUILD_DIR +mkdir $BUILD_DIR +cd $BUILD_DIR + +echo " MPI_C_FOUND >>>>>>>>>> ${MPI_C_FOUND}" + +CMAKE_OPTIONS= +CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE=Release" +#CMAKE_OPTIONS+=" -DPython_ROOT_DIR=${PYTHON_ROOT_DIR}" +#CMAKE_OPTIONS+=" -DPython_EXECUTABLE=${PYTHONBIN}" +CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX=${PRODUCT_INSTALL}" +CMAKE_OPTIONS+=" -DMPI_C_LIBRARIES=${MPI_C_FOUND}" +#CMAKE_OPTIONS+=" -DPACKAGESPY_ROOT_DIR=${PACKAGESPY_ROOT_DIR}" +#CMAKE_OPTIONS+=" -DMPI_HOME=${MPI_ROOT_DIR}" +#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 + +echo +echo "*** cmake "$CMAKE_OPTIONS $SOURCE_DIR +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 install" +make install +if [ $? -ne 0 ]; then + echo "ERROR on make install" + exit 3 +fi + +echo +echo "########## END" diff --git a/products/compil_scripts/petsc-3.19.4.sh b/products/compil_scripts/petsc-3.19.4.sh index dcb5769..5058dad 100755 --- a/products/compil_scripts/petsc-3.19.4.sh +++ b/products/compil_scripts/petsc-3.19.4.sh @@ -4,13 +4,26 @@ echo "########################################################################## echo "Petsc" $VERSION echo "##########################################################################" +NATIVE_PATH="/usr" +LINUX_DISTRIBUTION="$DIST_NAME$DIST_VERSION" +echo "WARNING: " +case $LINUX_DISTRIBUTION in + UB*|DB*) + NATIVE_PATH="/usr/lib/x86_64-linux-gnu" + ;; + *) + ;; +esac + cp -r $SOURCE_DIR/* . CONFIGURE_FLAGS= CONFIGURE_FLAGS+=" --download-slepc=ext/slepc-3.19.2.tar.gz" -if [ -f "${LAPACK_ROOT_DIR}/liblapack.a" ] && [ "${SAT_lapack_IS_NATIVE}" == "1" ]; then - CONFIGURE_FLAGS+=" --with-blaslapack-dir=${LAPACK_ROOT_DIR}" +if [ -f "${NATIVE_PATH}/liblapack.a" ] && [ "${SAT_lapack_IS_NATIVE}" == "1" ]; then + CONFIGURE_FLAGS+=" --with-blaslapack-dir=${NATIVE_PATH}" +elif [ -n "${LAPACK_ROOT_DIR}" ] && [ "${SAT_lapack_IS_NATIVE}" != "1" ]; then + CONFIGURE_FLAGS+=" --with-blaslapack-dir=${LAPACK_ROOT_DIR}" else CONFIGURE_FLAGS+=" --download-f2cblaslapack=ext/f2cblaslapack-3.8.0.q2.tar.gz" fi @@ -18,15 +31,19 @@ fi CONFIGURE_FLAGS+=" --with-python-dir=${PYTHON_ROOT_DIR}" CONFIGURE_FLAGS+=" --with-hdf5-dir=${HDF5_ROOT_DIR}" -if [ -f "${FFTW_ROOT_DIR}/libfftw3.a" ] && [ ${SAT_fftw_IS_NATIVE} == "1" ]; then +if [ -f "${NATIVE_PATH}/libfftw3.a" ] && [ ${SAT_fftw_IS_NATIVE} == "1" ]; then + CONFIGURE_FLAGS+=" --with-fftw-dir=${NATIVE_PATH}" +elif [ -n "${FFTW_ROOT_DIR}" ] && [ ${SAT_fftw_IS_NATIVE} != "1" ]; then CONFIGURE_FLAGS+=" --with-fftw-dir=${FFTW_ROOT_DIR}" else CONFIGURE_FLAGS+=" --download-fftw=ext/fftw-3.3.10.tar.gz" fi + CONFIGURE_FLAGS+=" --with-cuda=0" # 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 " + echo if [ -n "${SAT_HPC}" ] then @@ -43,7 +60,6 @@ then echo "*** configure --prefix=${PRODUCT_INSTALL} --with-mpi-dir=${MPI_ROOT_DIR} ${CONFIGURE_FLAGS}" ./configure --prefix=${PRODUCT_INSTALL} --with-mpi-dir=${MPI_ROOT_DIR} ${CONFIGURE_FLAGS} else - #CONFIGURE_FLAGS+=" --with-metis-dir=${METIS_ROOT_DIR}" CONFIGURE_FLAGS+=" --download-metis=ext/metis-5.1.0-p11.tar.gz" echo "*** configure --prefix=${PRODUCT_INSTALL} --with-mpi=0 ${CONFIGURE_FLAGS}" ./configure --prefix=${PRODUCT_INSTALL} --with-mpi=0 ${CONFIGURE_FLAGS} -- 2.39.2