diff --git a/.github/workflows/ci-dummy.yml b/.github/workflows/ci-dummy.yml deleted file mode 100644 index 1aac7891554e..000000000000 --- a/.github/workflows/ci-dummy.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: CI - -# this is required to satisfy the required checks by replacing them with dummy checks -# see https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks - -on: - pull_request: - merge_group: - branches: - - master - paths: # This must be the same as .github/workflows/ci.yml - "paths-ignore" ! - - '**.md' - - 'documents/**' - - 'scripts/**' - - '.github/workflows/ci-dummy.yml' - - '.github/workflows/build_docker_image*.yml' - - '.github/workflows/nightly_build.yml' - - 'kratos/templates/**' - - 'kratos/python_scripts/application_generator/**' - - 'docs/**' - - '.github/workflows/jekyll-gh-pages.yml' - -permissions: - contents: read - -jobs: - ubuntu: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - build-type: [Custom, FullDebug] - compiler: [gcc, clang] - steps: - - run: 'echo "Dummy build, no checks executed ..."' - - windows: - runs-on: ubuntu-latest # ubuntu is faster than Win, hence no point using Win here - - steps: - - run: 'echo "Dummy build, no checks executed ..."' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe1216361a7a..5fc947c9df65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,20 +2,8 @@ name: CI on: pull_request: - merge_group: branches: - master - paths-ignore: # This must be the same as .github/workflows/ci_dummy.yml - "paths" ! - - '**.md' - - 'documents/**' - - 'scripts/**' # Docker builds will be triggered by `build_docker_image_****.yml` workflows. - - '.github/workflows/ci-dummy.yml' - - '.github/workflows/build_docker_image*.yml' - - '.github/workflows/nightly_build.yml' - - 'kratos/templates/**' - - 'kratos/python_scripts/application_generator/**' - - 'docs/**' - - '.github/workflows/jekyll-gh-pages.yml' workflow_dispatch: @@ -56,8 +44,9 @@ jobs: KRATOS_BUILD_TYPE: ${{ matrix.build-type }} KRATOS_CI_CHANGED_FILES: ${{needs.changed-files.outputs.files}} KRATOS_CI_APPLICATIONS: ".github/workflows/ci_apps_linux.json" - OMPI_MCA_rmaps_base_oversubscribe: 1 # Allow oversubscription for MPI (needed for OpenMPI >= 3.0) - OMPI_MCA_btl_vader_single_copy_mechanism: none # suppressing some annoying OpenMPI messages + KRATOS_CI_CORES: 4 # Current limits are 4 CPU and 16 GB Ram + OMPI_MCA_rmaps_base_oversubscribe: 1 # Allow oversubscription for MPI (needed for OpenMPI >= 3.0) + OMPI_MCA_btl_vader_single_copy_mechanism: none # Suppressing some annoying OpenMPI messages container: image: kratosmultiphysics/kratos-image-ci-ubuntu-22-04:latest @@ -79,21 +68,88 @@ jobs: if [ ${{ matrix.compiler }} = gcc ]; then export CC=/usr/bin/gcc-12 export CXX=/usr/bin/g++-12 - export KRATOS_CMAKE_OPTIONS_FLAGS="-DUSE_EIGEN_MKL=ON -DUSE_EIGEN_FEAST=ON -DTRILINOS_EXCLUDE_AMESOS2_SOLVER=OFF -DMMG_ROOT=/external_libraries/mmg/mmg_5_5_1/ -DPMMG_ROOT=/external_libraries/ParMmg_5ffc6ad -DINCLUDE_PMMG=ON" + export KRATOS_CMAKE_OPTIONS_FLAGS="-DUSE_EIGEN_MKL=ON -DUSE_EIGEN_FEAST=ON -DTRILINOS_EXCLUDE_AMESOS2_SOLVER=OFF" export KRATOS_CMAKE_CXX_FLAGS="-Werror -Wno-deprecated-declarations -Wignored-qualifiers" elif [ ${{ matrix.compiler }} = clang ]; then export CC=/usr/bin/clang-14 export CXX=/usr/bin/clang++-14 export KRATOS_CMAKE_CXX_FLAGS="-Werror -Wno-deprecated-declarations" - export KRATOS_CMAKE_OPTIONS_FLAGS="-DTRILINOS_EXCLUDE_AMESOS2_SOLVER=OFF -DMMG_ROOT=/external_libraries/mmg/mmg_5_5_1/" + export KRATOS_CMAKE_OPTIONS_FLAGS="-DTRILINOS_EXCLUDE_AMESOS2_SOLVER=OFF" else echo 'Unsupported compiler: ${{ matrix.compiler }}' exit 1 fi source /opt/intel/oneapi/setvars.sh - cp .github/workflows/configure.sh configure.sh + cp .github/workflows/configure_core.sh configure.sh python3 kratos/python_scripts/testing/ci_utilities.py bash configure.sh + rm -r ${GITHUB_WORKSPACE}/build + + - name: Build Dependencies + shell: bash + run: | + if [ ${{ matrix.compiler }} = gcc ]; then + export CC=/usr/bin/gcc-12 + export CXX=/usr/bin/g++-12 + export KRATOS_CMAKE_OPTIONS_FLAGS="-DMMG_ROOT=/external_libraries/mmg/mmg_5_5_1/ -DPMMG_ROOT=/external_libraries/ParMmg_5ffc6ad -DINCLUDE_PMMG=ON" + export KRATOS_CMAKE_CXX_FLAGS="-Werror -Wno-deprecated-declarations -Wignored-qualifiers" + elif [ ${{ matrix.compiler }} = clang ]; then + export CC=/usr/bin/clang-14 + export CXX=/usr/bin/clang++-14 + export KRATOS_CMAKE_CXX_FLAGS="-Werror -Wno-deprecated-declarations" + export KRATOS_CMAKE_OPTIONS_FLAGS="-DMMG_ROOT=/external_libraries/mmg/mmg_5_5_1/" + else + echo 'Unsupported compiler: ${{ matrix.compiler }}' + exit 1 + fi + source /opt/intel/oneapi/setvars.sh + cp .github/workflows/configure_dependencies.sh configure.sh + bash configure.sh + rm -r ${GITHUB_WORKSPACE}/build + + - name: Build Core Apps + shell: bash + run: | + if [ ${{ matrix.compiler }} = gcc ]; then + export CC=/usr/bin/gcc-12 + export CXX=/usr/bin/g++-12 + export KRATOS_CMAKE_OPTIONS_FLAGS="" + export KRATOS_CMAKE_CXX_FLAGS="-Werror -Wno-deprecated-declarations -Wignored-qualifiers" + elif [ ${{ matrix.compiler }} = clang ]; then + export CC=/usr/bin/clang-14 + export CXX=/usr/bin/clang++-14 + export KRATOS_CMAKE_CXX_FLAGS="-Werror -Wno-deprecated-declarations" + export KRATOS_CMAKE_OPTIONS_FLAGS="" + else + echo 'Unsupported compiler: ${{ matrix.compiler }}' + exit 1 + fi + source /opt/intel/oneapi/setvars.sh + cp .github/workflows/configure_core_applications.sh configure.sh + bash configure.sh + rm -r ${GITHUB_WORKSPACE}/build + + - name: Build Research Apps + shell: bash + run: | + if [ ${{ matrix.compiler }} = gcc ]; then + export CC=/usr/bin/gcc-12 + export CXX=/usr/bin/g++-12 + export KRATOS_CMAKE_OPTIONS_FLAGS="" + export KRATOS_CMAKE_CXX_FLAGS="-Werror -Wno-deprecated-declarations -Wignored-qualifiers" + elif [ ${{ matrix.compiler }} = clang ]; then + export CC=/usr/bin/clang-14 + export CXX=/usr/bin/clang++-14 + export KRATOS_CMAKE_CXX_FLAGS="-Werror -Wno-deprecated-declarations" + export KRATOS_CMAKE_OPTIONS_FLAGS="" + else + echo 'Unsupported compiler: ${{ matrix.compiler }}' + exit 1 + fi + source /opt/intel/oneapi/setvars.sh + cp .github/workflows/configure_research_applications.sh configure.sh + bash configure.sh + rm -r ${GITHUB_WORKSPACE}/build - name: Running python tests shell: bash @@ -244,7 +300,6 @@ jobs: export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GITHUB_WORKSPACE}/bin/Custom/libs python3.8 kratos/python_scripts/testing/run_tests.py -l nightly -c python3.8 - ubuntu-core-without-unity: runs-on: ubuntu-latest needs: changed-files @@ -257,12 +312,6 @@ jobs: container: image: kratosmultiphysics/kratos-image-ci-ubuntu-22-04:latest options: --user 1001 - env: - CCACHE_SLOPPINESS: pch_defines,time_macros - CCACHE_COMPILERCHECK: content - CCACHE_COMPRESS: true - CCACHE_NODISABLE: true - CCACHE_MAXSIZE: 500M steps: - uses: actions/checkout@v4 @@ -271,24 +320,16 @@ jobs: shell: bash run: python3 kratos/python_scripts/testing/ci_utilities.py - - name: Cache Build - id: cache-build - uses: actions/cache@v4 - with: - path: ~/.ccache - key: ${{ runner.os }}-no-unity-ccache-${{ github.sha }} - restore-keys: ${{ runner.os }}-no-unity-ccache- - - name: Build shell: bash run: | - export CC=/usr/lib/ccache/clang-14 - export CXX=/usr/lib/ccache/clang++-14 + export CC=/usr/bin/clang-14 + export CXX=/usr/bin/clang++-14 export KRATOS_SOURCE="${KRATOS_SOURCE:-${PWD}}" export KRATOS_BUILD="${KRATOS_SOURCE}/build" export KRATOS_APP_DIR="${KRATOS_SOURCE}/applications" - export PYTHON_EXECUTABLE="/usr/bin/python3.10" + export PYTHON_EXECUTABLE="/usr/bin/python3" export KRATOS_INSTALL_PYTHON_USING_LINKS=ON add_app () { @@ -310,10 +351,9 @@ jobs: -DKRATOS_USE_PCH=ON # Build + # Please do not use more than 2 cores or it will produce an out of heap memory error cmake --build "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" --target install -- -j2 - ccache -s - - name: Running python tests shell: bash run: | diff --git a/.github/workflows/configure_core.sh b/.github/workflows/configure_core.sh new file mode 100644 index 000000000000..260c604fc000 --- /dev/null +++ b/.github/workflows/configure_core.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# You can use your interpreter of choice (bash, sh, zsh, ...) + +# For any question please contact with us in: +# - https://github.com/KratosMultiphysics/Kratos + +# Optional parameters: +# You can find a list with all the compilation options in INSTALL.md or here: +# - https://github.com/KratosMultiphysics/Kratos/wiki/Compilation-options + +add_app () { + export KRATOS_APPLICATIONS="${KRATOS_APPLICATIONS}$1;" +} + +# Set variables +export KRATOS_SOURCE="${KRATOS_SOURCE:-${PWD}}" +export KRATOS_BUILD="${KRATOS_SOURCE}/build" +export KRATOS_APP_DIR="${KRATOS_SOURCE}/applications" +export PYTHON_EXECUTABLE="/usr/bin/python3.10" +export KRATOS_INSTALL_PYTHON_USING_LINKS=ON + +# Set applications to compile +add_app ${KRATOS_APP_DIR}/LinearSolversApplication; +add_app ${KRATOS_APP_DIR}/MetisApplication; +add_app ${KRATOS_APP_DIR}/TrilinosApplication; + +# Clean +clear +rm -rf "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}/cmake_install.cmake" +rm -rf "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}/CMakeCache.txt" +rm -rf "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}/CMakeFiles" + +echo "Kratos build type is ${KRATOS_BUILD_TYPE}" + +# Configure +cmake -H"${KRATOS_SOURCE}" -B"${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" \ +${KRATOS_CMAKE_OPTIONS_FLAGS} \ +-DUSE_MPI=ON \ +-DCMAKE_CXX_FLAGS="${KRATOS_CMAKE_CXX_FLAGS} -O0 -Wall" \ +-DTRILINOS_INCLUDE_DIR="/usr/include/trilinos" \ +-DTRILINOS_LIBRARY_DIR="/usr/lib/x86_64-linux-gnu" \ +-DTRILINOS_LIBRARY_PREFIX="trilinos_" \ +-DCMAKE_UNITY_BUILD=ON + +# Build +cmake --build "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" --target install -- -j${KRATOS_CI_CORES} diff --git a/.github/workflows/configure_core_applications.sh b/.github/workflows/configure_core_applications.sh new file mode 100644 index 000000000000..103e22eeaa35 --- /dev/null +++ b/.github/workflows/configure_core_applications.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# You can use your interpreter of choice (bash, sh, zsh, ...) + +# For any question please contact with us in: +# - https://github.com/KratosMultiphysics/Kratos + +# Optional parameters: +# You can find a list with all the compilation options in INSTALL.md or here: +# - https://github.com/KratosMultiphysics/Kratos/wiki/Compilation-options + +add_app () { + export KRATOS_APPLICATIONS="${KRATOS_APPLICATIONS}$1;" +} + +# Set variables +export KRATOS_SOURCE="${KRATOS_SOURCE:-${PWD}}" +export KRATOS_BUILD="${KRATOS_SOURCE}/build" +export KRATOS_APP_DIR="${KRATOS_SOURCE}/applications" +export PYTHON_EXECUTABLE="/usr/bin/python3.10" +export KRATOS_INSTALL_PYTHON_USING_LINKS=ON + +# Set applications to compile +add_app ${KRATOS_APP_DIR}/FluidDynamicsApplication; +add_app ${KRATOS_APP_DIR}/StructuralMechanicsApplication; +add_app ${KRATOS_APP_DIR}/ConstitutiveLawsApplication; +add_app ${KRATOS_APP_DIR}/GeoMechanicsApplication; +add_app ${KRATOS_APP_DIR}/ConvectionDiffusionApplication; +add_app ${KRATOS_APP_DIR}/RomApplication; + +# Clean +clear +rm -rf "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}/cmake_install.cmake" +rm -rf "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}/CMakeCache.txt" +rm -rf "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}/CMakeFiles" + +echo "Kratos build type is ${KRATOS_BUILD_TYPE}" + +# Configure +cmake -H"${KRATOS_SOURCE}" -B"${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" \ +${KRATOS_CMAKE_OPTIONS_FLAGS} \ +-DUSE_MPI=ON \ +-DEXCLUDE_KRATOS_CORE=ON \ +-DEXCLUDE_AUTOMATIC_DEPENDENCIES=ON \ +-DREMOVE_INSTALL_DIRECTORIES=OFF \ +-DCMAKE_CXX_FLAGS="${KRATOS_CMAKE_CXX_FLAGS} -O0 -Wall" \ +-DTRILINOS_INCLUDE_DIR="/usr/include/trilinos" \ +-DTRILINOS_LIBRARY_DIR="/usr/lib/x86_64-linux-gnu" \ +-DTRILINOS_LIBRARY_PREFIX="trilinos_" \ +-DCMAKE_UNITY_BUILD=ON + +# Build +cmake --build "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" --target install -- -j${KRATOS_CI_CORES} diff --git a/.github/workflows/configure_dependencies.sh b/.github/workflows/configure_dependencies.sh new file mode 100644 index 000000000000..59df81268b7e --- /dev/null +++ b/.github/workflows/configure_dependencies.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# You can use your interpreter of choice (bash, sh, zsh, ...) + +# For any question please contact with us in: +# - https://github.com/KratosMultiphysics/Kratos + +# Optional parameters: +# You can find a list with all the compilation options in INSTALL.md or here: +# - https://github.com/KratosMultiphysics/Kratos/wiki/Compilation-options + +add_app () { + export KRATOS_APPLICATIONS="${KRATOS_APPLICATIONS}$1;" +} + +# Set variables +export KRATOS_SOURCE="${KRATOS_SOURCE:-${PWD}}" +export KRATOS_BUILD="${KRATOS_SOURCE}/build" +export KRATOS_APP_DIR="${KRATOS_SOURCE}/applications" +export PYTHON_EXECUTABLE="/usr/bin/python3.10" +export KRATOS_INSTALL_PYTHON_USING_LINKS=ON + +# Set applications to compile +add_app ${KRATOS_APP_DIR}/HDF5Application; +add_app ${KRATOS_APP_DIR}/MedApplication; +add_app ${KRATOS_APP_DIR}/MappingApplication; +add_app ${KRATOS_APP_DIR}/MeshMovingApplication; +add_app ${KRATOS_APP_DIR}/MeshingApplication; +add_app ${KRATOS_APP_DIR}/StatisticsApplication; + + +# Clean +clear +rm -rf "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}/cmake_install.cmake" +rm -rf "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}/CMakeCache.txt" +rm -rf "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}/CMakeFiles" + +echo "Kratos build type is ${KRATOS_BUILD_TYPE}" + +# Configure +cmake -H"${KRATOS_SOURCE}" -B"${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" \ +${KRATOS_CMAKE_OPTIONS_FLAGS} \ +-DUSE_MPI=ON \ +-DEXCLUDE_KRATOS_CORE=ON \ +-DEXCLUDE_AUTOMATIC_DEPENDENCIES=ON \ +-DREMOVE_INSTALL_DIRECTORIES=OFF \ +-DCMAKE_CXX_FLAGS="${KRATOS_CMAKE_CXX_FLAGS} -O0 -Wall" \ +-DTRILINOS_INCLUDE_DIR="/usr/include/trilinos" \ +-DTRILINOS_LIBRARY_DIR="/usr/lib/x86_64-linux-gnu" \ +-DTRILINOS_LIBRARY_PREFIX="trilinos_" \ +-DCMAKE_UNITY_BUILD=ON \ +-DINCLUDE_MMG=ON \ + +# Build +cmake --build "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" --target install -- -j${KRATOS_CI_CORES} diff --git a/.github/workflows/configure.sh b/.github/workflows/configure_research_applications.sh similarity index 65% rename from .github/workflows/configure.sh rename to .github/workflows/configure_research_applications.sh index f221e50ba60f..298b1c83846e 100644 --- a/.github/workflows/configure.sh +++ b/.github/workflows/configure_research_applications.sh @@ -16,44 +16,30 @@ add_app () { export KRATOS_SOURCE="${KRATOS_SOURCE:-${PWD}}" export KRATOS_BUILD="${KRATOS_SOURCE}/build" export KRATOS_APP_DIR="${KRATOS_SOURCE}/applications" -export PYTHON_EXECUTABLE="/usr/bin/python3.8" +export PYTHON_EXECUTABLE="/usr/bin/python3.10" export KRATOS_INSTALL_PYTHON_USING_LINKS=ON # Set applications to compile -add_app ${KRATOS_APP_DIR}/ConvectionDiffusionApplication; -add_app ${KRATOS_APP_DIR}/LinearSolversApplication; -add_app ${KRATOS_APP_DIR}/StructuralMechanicsApplication; -add_app ${KRATOS_APP_DIR}/FluidDynamicsApplication; -add_app ${KRATOS_APP_DIR}/FluidDynamicsBiomedicalApplication; -add_app ${KRATOS_APP_DIR}/FluidDynamicsHydraulicsApplication; -add_app ${KRATOS_APP_DIR}/MeshMovingApplication; -add_app ${KRATOS_APP_DIR}/DEMApplication; add_app ${KRATOS_APP_DIR}/CSharpWrapperApplication; -add_app ${KRATOS_APP_DIR}/MetisApplication; -add_app ${KRATOS_APP_DIR}/TrilinosApplication; -add_app ${KRATOS_APP_DIR}/ShapeOptimizationApplication; -add_app ${KRATOS_APP_DIR}/CoSimulationApplication; add_app ${KRATOS_APP_DIR}/CableNetApplication; -add_app ${KRATOS_APP_DIR}/RANSApplication; -add_app ${KRATOS_APP_DIR}/MappingApplication; -add_app ${KRATOS_APP_DIR}/FSIApplication; -add_app ${KRATOS_APP_DIR}/MeshingApplication; +add_app ${KRATOS_APP_DIR}/ChimeraApplication; +add_app ${KRATOS_APP_DIR}/CoSimulationApplication; add_app ${KRATOS_APP_DIR}/CompressiblePotentialFlowApplication; -add_app ${KRATOS_APP_DIR}/HDF5Application; add_app ${KRATOS_APP_DIR}/ContactStructuralMechanicsApplication; +add_app ${KRATOS_APP_DIR}/ConvectionDiffusionApplication; +add_app ${KRATOS_APP_DIR}/DEMApplication; +add_app ${KRATOS_APP_DIR}/DamApplication; +add_app ${KRATOS_APP_DIR}/FSIApplication; +add_app ${KRATOS_APP_DIR}/FluidDynamicsBiomedicalApplication; +add_app ${KRATOS_APP_DIR}/FluidDynamicsHydraulicsApplication; add_app ${KRATOS_APP_DIR}/IgaApplication; add_app ${KRATOS_APP_DIR}/MPMApplication; -add_app ${KRATOS_APP_DIR}/ChimeraApplication; -add_app ${KRATOS_APP_DIR}/StatisticsApplication; -add_app ${KRATOS_APP_DIR}/SwimmingDEMApplication; -add_app ${KRATOS_APP_DIR}/ConstitutiveLawsApplication; -add_app ${KRATOS_APP_DIR}/RomApplication; -add_app ${KRATOS_APP_DIR}/ShallowWaterApplication; -add_app ${KRATOS_APP_DIR}/GeoMechanicsApplication; -add_app ${KRATOS_APP_DIR}/DamApplication; -add_app ${KRATOS_APP_DIR}/PoromechanicsApplication; add_app ${KRATOS_APP_DIR}/OptimizationApplication; -add_app ${KRATOS_APP_DIR}/MedApplication; +add_app ${KRATOS_APP_DIR}/PoromechanicsApplication; +add_app ${KRATOS_APP_DIR}/RANSApplication; +add_app ${KRATOS_APP_DIR}/ShallowWaterApplication; +add_app ${KRATOS_APP_DIR}/ShapeOptimizationApplication; +add_app ${KRATOS_APP_DIR}/SwimmingDEMApplication; # Clean clear @@ -65,15 +51,16 @@ echo "Kratos build type is ${KRATOS_BUILD_TYPE}" # Configure cmake -H"${KRATOS_SOURCE}" -B"${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" \ -${KRATOS_CMAKE_OPTIONS_FLAGS} \ --DUSE_MPI=ON \ --DPYTHON_EXECUTABLE="/usr/bin/python3.10" \ --DCMAKE_CXX_FLAGS="${KRATOS_CMAKE_CXX_FLAGS} -O0 -Wall" \ --DTRILINOS_INCLUDE_DIR="/usr/include/trilinos" \ --DTRILINOS_LIBRARY_DIR="/usr/lib/x86_64-linux-gnu" \ --DTRILINOS_LIBRARY_PREFIX="trilinos_" \ --DCMAKE_UNITY_BUILD=ON \ --DINCLUDE_MMG=ON \ +${KRATOS_CMAKE_OPTIONS_FLAGS} \ +-DUSE_MPI=ON \ +-DEXCLUDE_KRATOS_CORE=ON \ +-DEXCLUDE_AUTOMATIC_DEPENDENCIES=ON \ +-DREMOVE_INSTALL_DIRECTORIES=OFF \ +-DCMAKE_CXX_FLAGS="${KRATOS_CMAKE_CXX_FLAGS} -O0 -Wall" \ +-DTRILINOS_INCLUDE_DIR="/usr/include/trilinos" \ +-DTRILINOS_LIBRARY_DIR="/usr/lib/x86_64-linux-gnu" \ +-DTRILINOS_LIBRARY_PREFIX="trilinos_" \ +-DCMAKE_UNITY_BUILD=ON # Build -cmake --build "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" --target install -- -j2 +cmake --build "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" --target install -- -j${KRATOS_CI_CORES} diff --git a/.github/workflows/nightly_build.yml b/.github/workflows/nightly_build.yml index 5a3e59e7a93b..ad3cc160309e 100644 --- a/.github/workflows/nightly_build.yml +++ b/.github/workflows/nightly_build.yml @@ -31,8 +31,9 @@ jobs: compiler: [gcc, clang] env: KRATOS_BUILD_TYPE: Release - OMPI_MCA_rmaps_base_oversubscribe: 1 # Allow oversubscription for MPI (needed for OpenMPI >= 3.0) - OMPI_MCA_btl_vader_single_copy_mechanism: none # suppressing some annoying OpenMPI messages + KRATOS_CI_CORES: 4 # Current limits are 4 CPU and 16 GB Ram + OMPI_MCA_rmaps_base_oversubscribe: 1 # Allow oversubscription for MPI (needed for OpenMPI >= 3.0) + OMPI_MCA_btl_vader_single_copy_mechanism: none # suppressing some annoying OpenMPI messages container: image: kratosmultiphysics/kratos-image-ci-ubuntu-22-04:latest @@ -52,19 +53,83 @@ jobs: if [ ${{ matrix.compiler }} = gcc ]; then export CC=/usr/bin/gcc-12 export CXX=/usr/bin/g++-12 - export KRATOS_CMAKE_OPTIONS_FLAGS="-DUSE_EIGEN_MKL=ON -DUSE_EIGEN_FEAST=ON -DTRILINOS_EXCLUDE_AMESOS2_SOLVER=OFF -DMMG_ROOT=/external_libraries/mmg/mmg_5_5_1/ -DPMMG_ROOT=/external_libraries/ParMmg_5ffc6ad -DINCLUDE_PMMG=ON" + export KRATOS_CMAKE_OPTIONS_FLAGS="-DTRILINOS_EXCLUDE_AMESOS2_SOLVER=OFF" export KRATOS_CMAKE_CXX_FLAGS="-Wignored-qualifiers" elif [ ${{ matrix.compiler }} = clang ]; then export CC=/usr/bin/clang-14 export CXX=/usr/bin/clang++-14 - export KRATOS_CMAKE_OPTIONS_FLAGS="-DTRILINOS_EXCLUDE_AMESOS2_SOLVER=OFF -DMMG_ROOT=/external_libraries/mmg/mmg_5_5_1/" + export KRATOS_CMAKE_OPTIONS_FLAGS="-DTRILINOS_EXCLUDE_AMESOS2_SOLVER=OFF" else echo 'Unsupported compiler: ${{ matrix.compiler }}' exit 1 fi source /opt/intel/oneapi/setvars.sh - cp .github/workflows/configure.sh configure.sh # maybe use different configure script in the future + cp .github/workflows/configure_core.sh configure.sh bash configure.sh + rm -r ${GITHUB_WORKSPACE}/build + + - name: Build Dependencies + shell: bash + run: | + if [ ${{ matrix.compiler }} = gcc ]; then + export CC=/usr/bin/gcc-12 + export CXX=/usr/bin/g++-12 + export KRATOS_CMAKE_OPTIONS_FLAGS="-DUSE_EIGEN_MKL=ON -DUSE_EIGEN_FEAST=ON -DMMG_ROOT=/external_libraries/mmg/mmg_5_5_1/ -DPMMG_ROOT=/external_libraries/ParMmg_5ffc6ad -DINCLUDE_PMMG=ON" + export KRATOS_CMAKE_CXX_FLAGS="-Wignored-qualifiers" + elif [ ${{ matrix.compiler }} = clang ]; then + export CC=/usr/bin/clang-14 + export CXX=/usr/bin/clang++-14 + export KRATOS_CMAKE_OPTIONS_FLAGS="-DMMG_ROOT=/external_libraries/mmg/mmg_5_5_1/" + else + echo 'Unsupported compiler: ${{ matrix.compiler }}' + exit 1 + fi + source /opt/intel/oneapi/setvars.sh + cp .github/workflows/configure_dependencies.sh configure.sh + bash configure.sh + rm -r ${GITHUB_WORKSPACE}/build + + - name: Build Core Apps + shell: bash + run: | + if [ ${{ matrix.compiler }} = gcc ]; then + export CC=/usr/bin/gcc-12 + export CXX=/usr/bin/g++-12 + export KRATOS_CMAKE_OPTIONS_FLAGS="" + export KRATOS_CMAKE_CXX_FLAGS="-Wignored-qualifiers" + elif [ ${{ matrix.compiler }} = clang ]; then + export CC=/usr/bin/clang-14 + export CXX=/usr/bin/clang++-14 + export KRATOS_CMAKE_OPTIONS_FLAGS="" + else + echo 'Unsupported compiler: ${{ matrix.compiler }}' + exit 1 + fi + source /opt/intel/oneapi/setvars.sh + cp .github/workflows/configure_core_applications.sh configure.sh + bash configure.sh + rm -r ${GITHUB_WORKSPACE}/build + + - name: Build Research Apps + shell: bash + run: | + if [ ${{ matrix.compiler }} = gcc ]; then + export CC=/usr/bin/gcc-12 + export CXX=/usr/bin/g++-12 + export KRATOS_CMAKE_OPTIONS_FLAGS="" + export KRATOS_CMAKE_CXX_FLAGS="-Wignored-qualifiers" + elif [ ${{ matrix.compiler }} = clang ]; then + export CC=/usr/bin/clang-14 + export CXX=/usr/bin/clang++-14 + export KRATOS_CMAKE_OPTIONS_FLAGS="" + else + echo 'Unsupported compiler: ${{ matrix.compiler }}' + exit 1 + fi + source /opt/intel/oneapi/setvars.sh + cp .github/workflows/configure_research_applications.sh configure.sh + bash configure.sh + rm -r ${GITHUB_WORKSPACE}/build - name: Running tests shell: bash diff --git a/CMakeLists.txt b/CMakeLists.txt index 25e652c499a4..d1ebfb600705 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,6 @@ endif(NOT DEFINED KRATOS_BINARY_DIR) option(REMOVE_INSTALL_DIRECTORIES "Remove the install directories to achieve a clean compilation" ON) - # Link on install if(NOT DEFINED ENV{KRATOS_INSTALL_PYTHON_USING_LINKS}) message("-- No KRATOS_INSTALL_PYTHON_USING_LINKS is defined, setting to OFF") @@ -554,9 +553,25 @@ if (${KRATOS_ENABLE_PROFILING} MATCHES ON) add_compile_definitions(KRATOS_ENABLE_PROFILING) endif() -# include subdirectories -add_subdirectory(external_libraries/gidpost) -add_subdirectory(kratos) +# Build exclusions and linking dirs. +# The intended usage of this flags is to allow a defered/incremental compilation of core/applications. +# Please do not use this options for regular development and never use this with REMOVE_INSTALL_DIRECTORIES=ON +OPTION ( EXCLUDE_KRATOS_CORE "Force exclusion of the core" OFF ) +OPTION ( EXCLUDE_AUTOMATIC_DEPENDENCIES "Force exclusion of automatically added app dependencies" OFF ) + +if(${REMOVE_INSTALL_DIRECTORIES} MATCHES ON AND (${EXCLUDE_KRATOS_CORE} MATCHES ON OR ${EXCLUDE_AUTOMATIC_DEPENDENCIES} MATCHES ON)) + message(FATAL_ERROR "REMOVE_INSTALL_DIRECTORIES cannot be enabled with EXCLUDE_KRATOS_CORE or EXCLUDE_AUTOMATIC_DEPENDENCIES") +endif() + +if(${EXCLUDE_KRATOS_CORE} MATCHES ON OR ${EXCLUDE_AUTOMATIC_DEPENDENCIES} MATCHES ON) + link_directories( ${CMAKE_INSTALL_PREFIX}/libs ) +endif() + +# Compile Kratos Core +if(${EXCLUDE_KRATOS_CORE} MATCHES OFF) + add_subdirectory(external_libraries/gidpost) + add_subdirectory(kratos) +endif() # Configure kratos applications message(STATUS "Configuring applications (ENV):") diff --git a/applications/FluidDynamicsApplication/trilinos_extension/CMakeLists.txt b/applications/FluidDynamicsApplication/trilinos_extension/CMakeLists.txt index 9cde01b6bb78..cfdb4ba97f1b 100644 --- a/applications/FluidDynamicsApplication/trilinos_extension/CMakeLists.txt +++ b/applications/FluidDynamicsApplication/trilinos_extension/CMakeLists.txt @@ -15,6 +15,7 @@ file( ## Python module pybind11_add_module( KratosFluidDynamicsTrilinosExtension MODULE THIN_LTO ${KRATOS_FLUID_DYNAMICS_TRILINOS_EXTENSION_PYTHON_INTERFACE_SOURCES} ) +target_include_directories(KratosFluidDynamicsTrilinosExtension SYSTEM PUBLIC ${TRILINOS_INCLUDE_DIR}) target_link_libraries( KratosFluidDynamicsTrilinosExtension PRIVATE KratosFluidDynamicsCore KratosTrilinosCore KratosMPICore ) set_target_properties( KratosFluidDynamicsTrilinosExtension PROPERTIES PREFIX "") diff --git a/applications/GeoMechanicsApplication/custom_elements/U_Pw_small_strain_interface_element.cpp b/applications/GeoMechanicsApplication/custom_elements/U_Pw_small_strain_interface_element.cpp index b9f2b22f75a7..b54f8b009d28 100644 --- a/applications/GeoMechanicsApplication/custom_elements/U_Pw_small_strain_interface_element.cpp +++ b/applications/GeoMechanicsApplication/custom_elements/U_Pw_small_strain_interface_element.cpp @@ -2483,4 +2483,12 @@ template class UPwSmallStrainInterfaceElement<2, 4>; template class UPwSmallStrainInterfaceElement<3, 6>; template class UPwSmallStrainInterfaceElement<3, 8>; +template void UPwSmallStrainInterfaceElement<2, 4>::InterpolateOutputValues>(std::vector>& rOutput, const std::vector>& GPValues); +template void UPwSmallStrainInterfaceElement<3, 6>::InterpolateOutputValues>(std::vector>& rOutput, const std::vector>& GPValues); +template void UPwSmallStrainInterfaceElement<3, 8>::InterpolateOutputValues>(std::vector>& rOutput, const std::vector>& GPValues); + +template void UPwSmallStrainInterfaceElement<2, 4>::InterpolateOutputValues(std::vector& rOutput, const std::vector& GPValues); +template void UPwSmallStrainInterfaceElement<3, 6>::InterpolateOutputValues(std::vector& rOutput, const std::vector& GPValues); +template void UPwSmallStrainInterfaceElement<3, 8>::InterpolateOutputValues(std::vector& rOutput, const std::vector& GPValues); + } // namespace Kratos \ No newline at end of file diff --git a/applications/MappingApplication/mpi_extension/CMakeLists.txt b/applications/MappingApplication/mpi_extension/CMakeLists.txt index b3ca494461af..75b160598020 100644 --- a/applications/MappingApplication/mpi_extension/CMakeLists.txt +++ b/applications/MappingApplication/mpi_extension/CMakeLists.txt @@ -15,6 +15,7 @@ file( ## Python module pybind11_add_module( KratosMappingMPIExtension MODULE THIN_LTO ${KRATOS_MAPPING_MPI_EXTENSION_PYTHON_INTERFACE_SOURCES} ) +target_include_directories(KratosMappingMPIExtension SYSTEM PUBLIC ${TRILINOS_INCLUDE_DIR}) target_link_libraries( KratosMappingMPIExtension PRIVATE KratosMappingCore KratosTrilinosCore KratosMPICore ) set_target_properties( KratosMappingMPIExtension PROPERTIES PREFIX "") diff --git a/applications/MeshMovingApplication/trilinos_extension/CMakeLists.txt b/applications/MeshMovingApplication/trilinos_extension/CMakeLists.txt index 3977bfccc5fc..92f07afd7820 100644 --- a/applications/MeshMovingApplication/trilinos_extension/CMakeLists.txt +++ b/applications/MeshMovingApplication/trilinos_extension/CMakeLists.txt @@ -15,6 +15,7 @@ file( ## Python module pybind11_add_module( KratosMeshMovingTrilinosExtension MODULE THIN_LTO ${KRATOS_MESH_MOVING_TRILINOS_EXTENSION_PYTHON_INTERFACE_SOURCES} ) +target_include_directories(KratosMeshMovingTrilinosExtension SYSTEM PUBLIC ${TRILINOS_INCLUDE_DIR}) target_link_libraries( KratosMeshMovingTrilinosExtension PRIVATE KratosMeshMovingCore KratosTrilinosCore KratosMPICore ) set_target_properties( KratosMeshMovingTrilinosExtension PROPERTIES PREFIX "") diff --git a/applications/MeshingApplication/CMakeLists.txt b/applications/MeshingApplication/CMakeLists.txt index 05595a319e84..01d12785cf6d 100644 --- a/applications/MeshingApplication/CMakeLists.txt +++ b/applications/MeshingApplication/CMakeLists.txt @@ -152,7 +152,7 @@ if(${INCLUDE_PMMG} MATCHES ON) ENDIF (PMMG_ROOT) include_directories(${PMMG_INCLUDE_DIR}) - set(KRATOS_MESHING_APPLICATION_EXTRA_LIBS ${KRATOS_MESHING_APPLICATION_EXTRA_LIBS} KratosMPICore ${PMMG_LIBRARY}) + set(KRATOS_MESHING_APPLICATION_EXTRA_LIBS ${KRATOS_MESHING_APPLICATION_EXTRA_LIBS} KratosMPICore ${MPI_LIBRARIES} ${PMMG_LIBRARY}) set(ALL_PMMG_LIBRARIES ${PMMG_LIBRARY}) FOREACH (FILE ${ALL_PMMG_LIBRARIES}) GET_FILENAME_COMPONENT(RESOLVED_FILE_LIB "${FILE}" REALPATH) diff --git a/applications/RANSApplication/trilinos_extension/CMakeLists.txt b/applications/RANSApplication/trilinos_extension/CMakeLists.txt index 7adaf788d094..3278194b4102 100644 --- a/applications/RANSApplication/trilinos_extension/CMakeLists.txt +++ b/applications/RANSApplication/trilinos_extension/CMakeLists.txt @@ -15,6 +15,8 @@ file( ## Python module pybind11_add_module( KratosRANSTrilinosExtension MODULE THIN_LTO ${KRATOS_RANS_TRILINOS_EXTENSION_PYTHON_INTERFACE_SOURCES} ) + +target_include_directories(KratosRANSTrilinosExtension SYSTEM PUBLIC ${TRILINOS_INCLUDE_DIR}) target_link_libraries( KratosRANSTrilinosExtension PRIVATE KratosRANSCore KratosTrilinosCore KratosMPICore ) set_target_properties( KratosRANSTrilinosExtension PROPERTIES PREFIX "") diff --git a/applications/RomApplication/CMakeLists.txt b/applications/RomApplication/CMakeLists.txt index d97ed2dc5e57..e584f7fa8e91 100644 --- a/applications/RomApplication/CMakeLists.txt +++ b/applications/RomApplication/CMakeLists.txt @@ -7,7 +7,14 @@ include(pybind11Tools) kratos_add_dependency(${KRATOS_SOURCE_DIR}/applications/LinearSolversApplication) +set(KRATOS_LINEAR_SOLVERS_APPLICATION_LIB_INC + "${KRATOS_SOURCE_DIR}/applications/LinearSolversApplication/external_libraries/eigen3" + "${KRATOS_SOURCE_DIR}/applications/LinearSolversApplication/external_libraries/spectra1/include" +) + include_directories( ${KRATOS_SOURCE_DIR}/kratos ) +include_directories( ${KRATOS_SOURCE_DIR}/applications/LinearSolversApplication ) +include_directories( ${KRATOS_LINEAR_SOLVERS_APPLICATION_LIB_INC} ) ## RomApplication Core sources file(GLOB_RECURSE KRATOS_ROM_APPLICATION_CORE diff --git a/applications/SwimmingDEMApplication/tests/SmallTests.py b/applications/SwimmingDEMApplication/tests/SmallTests.py index 60de162a7458..263319ec4b33 100644 --- a/applications/SwimmingDEMApplication/tests/SmallTests.py +++ b/applications/SwimmingDEMApplication/tests/SmallTests.py @@ -100,11 +100,11 @@ class porosity_field_conservation_test(PorosityTF.PorosityConservationTestFactor file_name = "porosity_tests/porosity_conservation/Test_porosityFluid" file_parameters = "porosity_tests/porosity_conservation/ProjectParameters.json" -class chien_drag_test(DragTF.TestFactory): - from drag_tests.chien_law.chien_drag_test_analysis import ChienDragAnalysis - analysis_stage_to_be_launched = ChienDragAnalysis - file_name = "drag_tests/chien_law/chien_drag_test" - file_parameters = "drag_tests/chien_law/ProjectParameters.json" +# class chien_drag_test(DragTF.TestFactory): +# from drag_tests.chien_law.chien_drag_test_analysis import ChienDragAnalysis +# analysis_stage_to_be_launched = ChienDragAnalysis +# file_name = "drag_tests/chien_law/chien_drag_test" +# file_parameters = "drag_tests/chien_law/ProjectParameters.json" available_tests = [] available_tests += [test_class for test_class in InterpolationTF.TestFactory.__subclasses__()] diff --git a/cmake_modules/FindTRILINOS.cmake b/cmake_modules/FindTRILINOS.cmake index 7398f13d4f4a..a372b908b670 100644 --- a/cmake_modules/FindTRILINOS.cmake +++ b/cmake_modules/FindTRILINOS.cmake @@ -12,248 +12,244 @@ # - Epetra, Teuchos # -# Only find if TrilinosApplication is in the list of applications -STRING(FIND "$ENV{KRATOS_APPLICATIONS}" "TrilinosApplication" index) -IF (${index} GREATER -1) - SET(ERROR_NOT_FOUND_MESSAGE "Could not find Trilinos or one of its packages. Please set the CMake var TRILINOS_ROOT or the environment vars TRILINOS_INCLUDE_DIR and TRILINOS_LIBRARY_DIR, note also that if in your system the library have a prefix, like \"libtrilinos_epetra.so\" instead of \"libepetra.so\" you can specify the prefix by the variable -DTRILINOS_LIBRARY_PREFIX=\"trilinos_\".\nAn alternative is using Spack and load Trilinos, this will be automatically detected as well.") - IF (TRILINOS_LIBRARY_DIR OR TRILINOS_INCLUDE_DIR OR TRILINOS_ROOT) - # Manual setting if the TRILINOS_ROOT is set - IF (TRILINOS_ROOT) - SET(TRILINOS_INCLUDE_DIR "${TRILINOS_ROOT}/include") - SET(TRILINOS_LIBRARY_DIR "${TRILINOS_ROOT}/lib") - ENDIF (TRILINOS_ROOT) - ELSE (TRILINOS_LIBRARY_DIR OR TRILINOS_INCLUDE_DIR OR TRILINOS_ROOT) - # First we try to find using the interface provided by CMake and Trilinos - FIND_PACKAGE(Trilinos) - - # If found - IF (Trilinos_FOUND) - LIST(FIND Trilinos_PACKAGE_LIST Epetra package_index) - IF (${package_index} EQUAL -1) - MESSAGE(FATAL_ERROR "Epetra package is required by TrilinosApplication") - ENDIF (${package_index} EQUAL -1) - - LIST(FIND Trilinos_PACKAGE_LIST Teuchos package_index) - IF (${package_index} EQUAL -1) - MESSAGE(FATAL_ERROR "Teuchos package is required by TrilinosApplication") - ENDIF (${package_index} EQUAL -1) - - SET(TRILINOS_INCLUDE_DIR ${Trilinos_INCLUDE_DIRS}) - GET_FILENAME_COMPONENT(TRILINOS_ROOT "${Trilinos_INCLUDE_DIRS}" DIRECTORY) - SET(TRILINOS_LIBRARY_DIR "${TRILINOS_ROOT}/lib") - ELSE (Trilinos_FOUND) # Not found. This will raise an error - MESSAGE(FATAL_ERROR ${ERROR_NOT_FOUND_MESSAGE}) - ENDIF (Trilinos_FOUND) - ENDIF (TRILINOS_LIBRARY_DIR OR TRILINOS_INCLUDE_DIR OR TRILINOS_ROOT) - - # You can specify your own version of the library - # by specifying the variables TRILINOS_LIB_SEARCH_PATH and - # TRILINOS_INCLUDE_SEARCH_PATH. - - # Library directory - IF (TRILINOS_LIBRARY_DIR) - SET(TRILINOS_LIB_SEARCH_PATH ${TRILINOS_LIBRARY_DIR}) - ELSE (TRILINOS_LIBRARY_DIR) - SET(TRILINOS_LIB_SEARCH_PATH - /usr/lib64 - /usr/lib - /usr/local/lib/ - /usr/lib/x86_64-linux-gnu/ - ) - ENDIF (TRILINOS_LIBRARY_DIR) - # Include directory - IF (TRILINOS_INCLUDE_DIR) - SET(TRILINOS_INCLUDE_SEARCH_PATH ${TRILINOS_INCLUDE_DIR}) - ELSE (TRILINOS_INCLUDE_DIR) - SET(TRILINOS_INCLUDE_SEARCH_PATH - /usr/include - /usr/local/include/ - /usr/include/trilinos/ - ) - ENDIF (TRILINOS_INCLUDE_DIR) - - FIND_PATH(AMESOS_INCLUDE_PATH Amesos.h ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) - FIND_PATH(AMESOS2_INCLUDE_PATH Amesos2.hpp ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) - FIND_PATH(AZTECOO_INCLUDE_PATH AztecOO.h ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) - FIND_PATH(EPETRA_INCLUDE_PATH Epetra_Object.h ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) - FIND_PATH(IFPACK_INCLUDE_PATH Ifpack.h ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) - FIND_PATH(LOCA_INCLUDE_PATH LOCA.H ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) - FIND_PATH(ML_INCLUDE_PATH MLAPI.h ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) - FIND_PATH(NOX_INCLUDE_PATH NOX.H ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) - FIND_PATH(TEUCHOS_INCLUDE_PATH Teuchos_Object.hpp ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) - FIND_PATH(TRIUTILS_INCLUDE_PATH Triutils_config.h ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) - - FIND_PATH(LOCA_EPETRA_INCLUDE_PATH LOCA_Epetra.H ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) - FIND_PATH(NOX_EPETRA_INCLUDE_PATH NOX_Epetra.H ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) - FIND_PATH(EPETRAEXT_INCLUDE_PATH EpetraExt_Version.h ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) - - FIND_LIBRARY(AMESOS_LIBRARY "${TRILINOS_LIBRARY_PREFIX}amesos" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - FIND_LIBRARY(AMESOS2_LIBRARY "${TRILINOS_LIBRARY_PREFIX}amesos2" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - FIND_LIBRARY(AZTECOO_LIBRARY "${TRILINOS_LIBRARY_PREFIX}aztecoo" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - FIND_LIBRARY(EPETRA_LIBRARY "${TRILINOS_LIBRARY_PREFIX}epetra" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - IF(NOT EPETRA_LIBRARY) - FIND_LIBRARY(EPETRA_LIBRARY "${TRILINOS_LIBRARY_PREFIX}epetra.so" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - ENDIF(NOT EPETRA_LIBRARY) - FIND_LIBRARY(IFPACK_LIBRARY "${TRILINOS_LIBRARY_PREFIX}ifpack" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - FIND_LIBRARY(LOCA_LIBRARY "${TRILINOS_LIBRARY_PREFIX}loca" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - FIND_LIBRARY(ML_LIBRARY "${TRILINOS_LIBRARY_PREFIX}ml" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - FIND_LIBRARY(NOX_LIBRARY "${TRILINOS_LIBRARY_PREFIX}nox" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - FIND_LIBRARY(TEUCHOS_LIBRARY "${TRILINOS_LIBRARY_PREFIX}teuchos" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - IF(NOT TEUCHOS_LIBRARY) - FIND_LIBRARY(TEUCHOSCOMM_LIBRARY "${TRILINOS_LIBRARY_PREFIX}teuchoscomm" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - IF(NOT TEUCHOSCOMM_LIBRARY) - FIND_LIBRARY(TEUCHOSCOMM_LIBRARY "${TRILINOS_LIBRARY_PREFIX}teuchoscomm.so" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - ENDIF(NOT TEUCHOSCOMM_LIBRARY) - FIND_LIBRARY(TEUCHOSCORE_LIBRARY "${TRILINOS_LIBRARY_PREFIX}teuchoscore" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - IF(NOT TEUCHOSCORE_LIBRARY) - FIND_LIBRARY(TEUCHOSCORE_LIBRARY "${TRILINOS_LIBRARY_PREFIX}teuchoscore.so" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - ENDIF(NOT TEUCHOSCORE_LIBRARY) - FIND_LIBRARY(TEUCHOSNUMERICS_LIBRARY "${TRILINOS_LIBRARY_PREFIX}teuchosnumerics" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - IF(NOT TEUCHOSNUMERICS_LIBRARY) - FIND_LIBRARY(TEUCHOSNUMERICS_LIBRARY "${TRILINOS_LIBRARY_PREFIX}teuchosnumerics.so" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - ENDIF(NOT TEUCHOSNUMERICS_LIBRARY) - FIND_LIBRARY(TEUCHOSPARAMETERLIST_LIBRARY "${TRILINOS_LIBRARY_PREFIX}teuchosparameterlist" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - IF(NOT TEUCHOSPARAMETERLIST_LIBRARY) - FIND_LIBRARY(TEUCHOSPARAMETERLIST_LIBRARY "${TRILINOS_LIBRARY_PREFIX}teuchosparameterlist.so" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - ENDIF(NOT TEUCHOSPARAMETERLIST_LIBRARY) - FIND_LIBRARY(TEUCHOSREMAINDER_LIBRARY "${TRILINOS_LIBRARY_PREFIX}teuchosremainder" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - IF(NOT TEUCHOSREMAINDER_LIBRARY) - FIND_LIBRARY(TEUCHOSREMAINDER_LIBRARY "${TRILINOS_LIBRARY_PREFIX}teuchosremainder.so" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - ENDIF(NOT TEUCHOSREMAINDER_LIBRARY) - ENDIF(NOT TEUCHOS_LIBRARY) - - FIND_LIBRARY(TRIUTILS_LIBRARY "${TRILINOS_LIBRARY_PREFIX}triutils" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - IF(NOT TRIUTILS_LIBRARY) - FIND_LIBRARY(TRIUTILS_LIBRARY "${TRILINOS_LIBRARY_PREFIX}triutils.so" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - ENDIF(NOT TRIUTILS_LIBRARY) - - FIND_LIBRARY(LOCA_EPETRA_LIBRARY "${TRILINOS_LIBRARY_PREFIX}locaepetra" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - FIND_LIBRARY(NOX_EPETRA_LIBRARY "${TRILINOS_LIBRARY_PREFIX}noxepetra" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - FIND_LIBRARY(EPETRAEXT_LIBRARY "${TRILINOS_LIBRARY_PREFIX}epetraext" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - - IF(TEUCHOS_LIBRARY) - SET(TEUCHOS_LIBRARIES "${TEUCHOS_LIBRARY}") - ELSEIF(TEUCHOSCOMM_LIBRARY AND TEUCHOSCORE_LIBRARY AND TEUCHOSNUMERICS_LIBRARY AND TEUCHOSPARAMETERLIST_LIBRARY AND TEUCHOSREMAINDER_LIBRARY) - SET(TEUCHOS_LIBRARIES ${TEUCHOSCOMM_LIBRARY} ${TEUCHOSCORE_LIBRARY} ${TEUCHOSNUMERICS_LIBRARY} ${TEUCHOSPARAMETERLIST_LIBRARY} ${TEUCHOSREMAINDER_LIBRARY}) - ELSE(TEUCHOS_LIBRARY) - SET(TEUCHOS_LIBRARIES "") - ENDIF(TEUCHOS_LIBRARY) - - FIND_PATH(ZOLTAN_INCLUDE_PATH zoltan.h ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) - FIND_LIBRARY(ZOLTAN_LIBRARY "${TRILINOS_LIBRARY_PREFIX}zoltan" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) - - INCLUDE(FindPackageHandleStandardArgs) - - MESSAGE("EPETRA_INCLUDE_PATH: " ${EPETRA_INCLUDE_PATH}) - MESSAGE("EPETRA_LIBRARY: " ${EPETRA_LIBRARY}) - - IF(EPETRA_INCLUDE_PATH AND EPETRA_LIBRARY) - SET(TRILINOS_INCLUDE_DIR ${TRILINOS_INCLUDE_DIR} ${EPETRA_INCLUDE_PATH}) - SET(TRILINOS_LIBRARIES ${TRILINOS_LIBRARIES} ${EPETRA_LIBRARY}) - SET(HAVE_EPETRA YES) - ENDIF(EPETRA_INCLUDE_PATH AND EPETRA_LIBRARY) - find_package_handle_standard_args(EPETRA DEFAULT_MSG EPETRA_LIBRARY) - - MESSAGE("TEUCHOS_INCLUDE_PATH: " ${TEUCHOS_INCLUDE_PATH}) - MESSAGE("TEUCHOS_LIBRARIES: " ${TEUCHOS_LIBRARIES}) - IF(TEUCHOS_INCLUDE_PATH AND TEUCHOS_LIBRARIES) - SET(TRILINOS_INCLUDE_DIR ${TRILINOS_INCLUDE_DIR} ${TEUCHOS_INCLUDE_PATH}) - SET(TRILINOS_LIBRARIES ${TRILINOS_LIBRARIES} ${TEUCHOS_LIBRARIES}) - SET(HAVE_TEUCHOS YES) - ENDIF(TEUCHOS_INCLUDE_PATH AND TEUCHOS_LIBRARIES) - - IF(TEUCHOS_LIBRARY) - find_package_handle_standard_args(TEUCHOS DEFAULT_MSG TEUCHOS_LIBRARY) - ELSEIF(TEUCHOSCOMM_LIBRARY AND TEUCHOSCORE_LIBRARY AND TEUCHOSNUMERICS_LIBRARY AND TEUCHOSPARAMETERLIST_LIBRARY AND TEUCHOSREMAINDER_LIBRARY) - find_package_handle_standard_args(TEUCHOS DEFAULT_MSG TEUCHOSCOMM_LIBRARY TEUCHOSCORE_LIBRARY TEUCHOSNUMERICS_LIBRARY TEUCHOSPARAMETERLIST_LIBRARY TEUCHOSREMAINDER_LIBRARY) - ENDIF() - - IF(TRIUTILS_INCLUDE_PATH AND TRIUTILS_LIBRARY) - SET(TRILINOS_INCLUDE_DIR ${TRILINOS_INCLUDE_DIR} ${TRIUTILS_INCLUDE_PATH}) - SET(TRILINOS_LIBRARIES ${TRILINOS_LIBRARIES} ${TRIUTILS_LIBRARY}) - SET(HAVE_TRIUTILS YES) - ENDIF(TRIUTILS_INCLUDE_PATH AND TRIUTILS_LIBRARY) - find_package_handle_standard_args(TRIUTILS DEFAULT_MSG TRIUTILS_LIBRARY) - - IF(AMESOS_INCLUDE_PATH AND AMESOS_LIBRARY) - SET(TRILINOS_INCLUDE_DIR ${TRILINOS_INCLUDE_DIR} ${AMESOS_INCLUDE_PATH}) - SET(TRILINOS_LIBRARIES ${TRILINOS_LIBRARIES} ${AMESOS_LIBRARY}) - SET(HAVE_AMESOS YES) - find_package_handle_standard_args(AMESOS DEFAULT_MSG AMESOS_LIBRARY) - ENDIF(AMESOS_INCLUDE_PATH AND AMESOS_LIBRARY) - - IF(AMESOS2_INCLUDE_PATH AND AMESOS2_LIBRARY) - SET(TRILINOS_INCLUDE_DIR ${TRILINOS_INCLUDE_DIR} ${AMESOS2_INCLUDE_PATH}) - SET(TRILINOS_LIBRARIES ${TRILINOS_LIBRARIES} ${AMESOS2_LIBRARY}) - SET(HAVE_AMESOS2 YES) - find_package_handle_standard_args(AMESOS2 DEFAULT_MSG AMESOS2_LIBRARY) - ENDIF(AMESOS2_INCLUDE_PATH AND AMESOS2_LIBRARY) - - IF(AZTECOO_INCLUDE_PATH AND AZTECOO_LIBRARY) - SET(TRILINOS_INCLUDE_DIR ${TRILINOS_INCLUDE_DIR} ${AZTECOO_INCLUDE_PATH}) - SET(TRILINOS_LIBRARIES ${TRILINOS_LIBRARIES} ${AZTECOO_LIBRARY}) - SET(HAVE_AZTECOO YES) - find_package_handle_standard_args(AZTECOO DEFAULT_MSG AZTECOO_LIBRARY) - ENDIF(AZTECOO_INCLUDE_PATH AND AZTECOO_LIBRARY) - - IF(IFPACK_INCLUDE_PATH AND IFPACK_LIBRARY) - SET(TRILINOS_INCLUDE_DIR ${TRILINOS_INCLUDE_DIR} ${IFPACK_INCLUDE_PATH}) - SET(TRILINOS_LIBRARIES ${TRILINOS_LIBRARIES} ${IFPACK_LIBRARY}) - SET(HAVE_IFPACK YES) - find_package_handle_standard_args(IFPACK DEFAULT_MSG IFPACK_LIBRARY) - ENDIF(IFPACK_INCLUDE_PATH AND IFPACK_LIBRARY) - - IF(LOCA_INCLUDE_PATH AND LOCA_LIBRARY) - SET(TRILINOS_INCLUDE_DIR ${TRILINOS_INCLUDE_DIR} ${LOCA_INCLUDE_PATH}) - SET(TRILINOS_LIBRARIES ${TRILINOS_LIBRARIES} ${LOCA_LIBRARY}) - SET(HAVE_LOCA YES) - find_package_handle_standard_args(LOCA DEFAULT_MSG LOCA_LIBRARY) - ENDIF(LOCA_INCLUDE_PATH AND LOCA_LIBRARY) - - IF(ML_INCLUDE_PATH AND ML_LIBRARY) - SET(TRILINOS_INCLUDE_DIR ${TRILINOS_INCLUDE_DIR} ${ML_INCLUDE_PATH}) - SET(TRILINOS_LIBRARIES ${TRILINOS_LIBRARIES} ${ML_LIBRARY}) - SET(HAVE_ML YES) - find_package_handle_standard_args(ML DEFAULT_MSG ML_LIBRARY) - ENDIF(ML_INCLUDE_PATH AND ML_LIBRARY) - - IF(NOX_INCLUDE_PATH AND NOX_LIBRARY AND NOX_EPETRA_INCLUDE_PATH AND NOX_EPETRA_LIBRARY) - SET(TRILINOS_INCLUDE_DIR ${TRILINOS_INCLUDE_DIR} ${NOX_INCLUDE_PATH} ${NOX_EPETRA_INCLUDE_PATH}) - SET(TRILINOS_LIBRARIES ${TRILINOS_LIBRARIES} ${NOX_LIBRARY} ${NOX_EPETRA_LIBRARY}) - SET(HAVE_NOX YES) - find_package_handle_standard_args(NOX DEFAULT_MSG NOX_LIBRARY) - ENDIF(NOX_INCLUDE_PATH AND NOX_LIBRARY AND NOX_EPETRA_INCLUDE_PATH AND NOX_EPETRA_LIBRARY) - - IF(EPETRAEXT_INCLUDE_PATH AND EPETRAEXT_LIBRARY) - SET(TRILINOS_INCLUDE_DIR ${TRILINOS_INCLUDE_DIR} ${EPETRAEXT_INCLUDE_PATH}) - SET(TRILINOS_LIBRARIES ${TRILINOS_LIBRARIES} ${EPETRAEXT_LIBRARY}) - SET(HAVE_EPETRAEXT YES) - find_package_handle_standard_args(EPETRAEXT DEFAULT_MSG EPETRAEXT_LIBRARY) - ENDIF(EPETRAEXT_INCLUDE_PATH AND EPETRAEXT_LIBRARY) - - LIST(LENGTH TRILINOS_INCLUDE_DIR LEN) - IF(LEN GREATER 1) - LIST(REMOVE_DUPLICATES TRILINOS_INCLUDE_DIR) - ENDIF(LEN GREATER 1) - - IF(EPETRA_FOUND AND TEUCHOS_FOUND) - SET(TRILINOS_FOUND TRUE) - ELSE(EPETRA_FOUND AND TEUCHOS_FOUND) # Not found. This will raise an error - SET(TRILINOS_FOUND FALSE) - ENDIF(EPETRA_FOUND AND TEUCHOS_FOUND) - - IF(ZOLTAN_INCLUDE_PATH AND ZOLTAN_LIBRARY) - SET(TRILINOS_INCLUDE_DIR ${TRILINOS_INCLUDE_DIR} ${ZOLTAN_INCLUDE_PATH}) - SET(TRILINOS_LIBRARIES ${TRILINOS_LIBRARIES} ${ZOLTAN_LIBRARY}) - SET(HAVE_ZOLTAN YES) - find_package_handle_standard_args(ZOLTAN DEFAULT_MSG ZOLTAN_LIBRARY) - ENDIF(ZOLTAN_INCLUDE_PATH AND ZOLTAN_LIBRARY) - - IF(TRILINOS_FOUND) - MESSAGE(STATUS "Trilinos packages found.") - MESSAGE(STATUS "TRILINOS_INCLUDE_DIR: ${TRILINOS_INCLUDE_DIR}") - MESSAGE(STATUS "TRILINOS_LIBRARIES: ${TRILINOS_LIBRARIES}") - ELSE (TRILINOS_FOUND) +SET(ERROR_NOT_FOUND_MESSAGE "Could not find Trilinos or one of its packages. Please set the CMake var TRILINOS_ROOT or the environment vars TRILINOS_INCLUDE_DIR and TRILINOS_LIBRARY_DIR, note also that if in your system the library have a prefix, like \"libtrilinos_epetra.so\" instead of \"libepetra.so\" you can specify the prefix by the variable -DTRILINOS_LIBRARY_PREFIX=\"trilinos_\".\nAn alternative is using Spack and load Trilinos, this will be automatically detected as well.") +IF (TRILINOS_LIBRARY_DIR OR TRILINOS_INCLUDE_DIR OR TRILINOS_ROOT) + # Manual setting if the TRILINOS_ROOT is set + IF (TRILINOS_ROOT) + SET(TRILINOS_INCLUDE_DIR "${TRILINOS_ROOT}/include") + SET(TRILINOS_LIBRARY_DIR "${TRILINOS_ROOT}/lib") + ENDIF (TRILINOS_ROOT) +ELSE (TRILINOS_LIBRARY_DIR OR TRILINOS_INCLUDE_DIR OR TRILINOS_ROOT) + # First we try to find using the interface provided by CMake and Trilinos + FIND_PACKAGE(Trilinos) + + # If found + IF (Trilinos_FOUND) + LIST(FIND Trilinos_PACKAGE_LIST Epetra package_index) + IF (${package_index} EQUAL -1) + MESSAGE(FATAL_ERROR "Epetra package is required by TrilinosApplication") + ENDIF (${package_index} EQUAL -1) + + LIST(FIND Trilinos_PACKAGE_LIST Teuchos package_index) + IF (${package_index} EQUAL -1) + MESSAGE(FATAL_ERROR "Teuchos package is required by TrilinosApplication") + ENDIF (${package_index} EQUAL -1) + + SET(TRILINOS_INCLUDE_DIR ${Trilinos_INCLUDE_DIRS}) + GET_FILENAME_COMPONENT(TRILINOS_ROOT "${Trilinos_INCLUDE_DIRS}" DIRECTORY) + SET(TRILINOS_LIBRARY_DIR "${TRILINOS_ROOT}/lib") + ELSE (Trilinos_FOUND) # Not found. This will raise an error MESSAGE(FATAL_ERROR ${ERROR_NOT_FOUND_MESSAGE}) - ENDIF(TRILINOS_FOUND) -ENDIF (${index} GREATER -1) + ENDIF (Trilinos_FOUND) +ENDIF (TRILINOS_LIBRARY_DIR OR TRILINOS_INCLUDE_DIR OR TRILINOS_ROOT) + +# You can specify your own version of the library +# by specifying the variables TRILINOS_LIB_SEARCH_PATH and +# TRILINOS_INCLUDE_SEARCH_PATH. + +# Library directory +IF (TRILINOS_LIBRARY_DIR) + SET(TRILINOS_LIB_SEARCH_PATH ${TRILINOS_LIBRARY_DIR}) +ELSE (TRILINOS_LIBRARY_DIR) + SET(TRILINOS_LIB_SEARCH_PATH + /usr/lib64 + /usr/lib + /usr/local/lib/ + /usr/lib/x86_64-linux-gnu/ + ) +ENDIF (TRILINOS_LIBRARY_DIR) +# Include directory +IF (TRILINOS_INCLUDE_DIR) + SET(TRILINOS_INCLUDE_SEARCH_PATH ${TRILINOS_INCLUDE_DIR}) +ELSE (TRILINOS_INCLUDE_DIR) + SET(TRILINOS_INCLUDE_SEARCH_PATH + /usr/include + /usr/local/include/ + /usr/include/trilinos/ + ) +ENDIF (TRILINOS_INCLUDE_DIR) + +FIND_PATH(AMESOS_INCLUDE_PATH Amesos.h ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) +FIND_PATH(AMESOS2_INCLUDE_PATH Amesos2.hpp ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) +FIND_PATH(AZTECOO_INCLUDE_PATH AztecOO.h ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) +FIND_PATH(EPETRA_INCLUDE_PATH Epetra_Object.h ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) +FIND_PATH(IFPACK_INCLUDE_PATH Ifpack.h ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) +FIND_PATH(LOCA_INCLUDE_PATH LOCA.H ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) +FIND_PATH(ML_INCLUDE_PATH MLAPI.h ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) +FIND_PATH(NOX_INCLUDE_PATH NOX.H ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) +FIND_PATH(TEUCHOS_INCLUDE_PATH Teuchos_Object.hpp ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) +FIND_PATH(TRIUTILS_INCLUDE_PATH Triutils_config.h ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) + +FIND_PATH(LOCA_EPETRA_INCLUDE_PATH LOCA_Epetra.H ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) +FIND_PATH(NOX_EPETRA_INCLUDE_PATH NOX_Epetra.H ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) +FIND_PATH(EPETRAEXT_INCLUDE_PATH EpetraExt_Version.h ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) + +FIND_LIBRARY(AMESOS_LIBRARY "${TRILINOS_LIBRARY_PREFIX}amesos" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) +FIND_LIBRARY(AMESOS2_LIBRARY "${TRILINOS_LIBRARY_PREFIX}amesos2" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) +FIND_LIBRARY(AZTECOO_LIBRARY "${TRILINOS_LIBRARY_PREFIX}aztecoo" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) +FIND_LIBRARY(EPETRA_LIBRARY "${TRILINOS_LIBRARY_PREFIX}epetra" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) +IF(NOT EPETRA_LIBRARY) + FIND_LIBRARY(EPETRA_LIBRARY "${TRILINOS_LIBRARY_PREFIX}epetra.so" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) +ENDIF(NOT EPETRA_LIBRARY) +FIND_LIBRARY(IFPACK_LIBRARY "${TRILINOS_LIBRARY_PREFIX}ifpack" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) +FIND_LIBRARY(LOCA_LIBRARY "${TRILINOS_LIBRARY_PREFIX}loca" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) +FIND_LIBRARY(ML_LIBRARY "${TRILINOS_LIBRARY_PREFIX}ml" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) +FIND_LIBRARY(NOX_LIBRARY "${TRILINOS_LIBRARY_PREFIX}nox" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) +FIND_LIBRARY(TEUCHOS_LIBRARY "${TRILINOS_LIBRARY_PREFIX}teuchos" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) +IF(NOT TEUCHOS_LIBRARY) + FIND_LIBRARY(TEUCHOSCOMM_LIBRARY "${TRILINOS_LIBRARY_PREFIX}teuchoscomm" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) + IF(NOT TEUCHOSCOMM_LIBRARY) + FIND_LIBRARY(TEUCHOSCOMM_LIBRARY "${TRILINOS_LIBRARY_PREFIX}teuchoscomm.so" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) + ENDIF(NOT TEUCHOSCOMM_LIBRARY) + FIND_LIBRARY(TEUCHOSCORE_LIBRARY "${TRILINOS_LIBRARY_PREFIX}teuchoscore" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) + IF(NOT TEUCHOSCORE_LIBRARY) + FIND_LIBRARY(TEUCHOSCORE_LIBRARY "${TRILINOS_LIBRARY_PREFIX}teuchoscore.so" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) + ENDIF(NOT TEUCHOSCORE_LIBRARY) + FIND_LIBRARY(TEUCHOSNUMERICS_LIBRARY "${TRILINOS_LIBRARY_PREFIX}teuchosnumerics" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) + IF(NOT TEUCHOSNUMERICS_LIBRARY) + FIND_LIBRARY(TEUCHOSNUMERICS_LIBRARY "${TRILINOS_LIBRARY_PREFIX}teuchosnumerics.so" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) + ENDIF(NOT TEUCHOSNUMERICS_LIBRARY) + FIND_LIBRARY(TEUCHOSPARAMETERLIST_LIBRARY "${TRILINOS_LIBRARY_PREFIX}teuchosparameterlist" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) + IF(NOT TEUCHOSPARAMETERLIST_LIBRARY) + FIND_LIBRARY(TEUCHOSPARAMETERLIST_LIBRARY "${TRILINOS_LIBRARY_PREFIX}teuchosparameterlist.so" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) + ENDIF(NOT TEUCHOSPARAMETERLIST_LIBRARY) + FIND_LIBRARY(TEUCHOSREMAINDER_LIBRARY "${TRILINOS_LIBRARY_PREFIX}teuchosremainder" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) + IF(NOT TEUCHOSREMAINDER_LIBRARY) + FIND_LIBRARY(TEUCHOSREMAINDER_LIBRARY "${TRILINOS_LIBRARY_PREFIX}teuchosremainder.so" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) + ENDIF(NOT TEUCHOSREMAINDER_LIBRARY) +ENDIF(NOT TEUCHOS_LIBRARY) + +FIND_LIBRARY(TRIUTILS_LIBRARY "${TRILINOS_LIBRARY_PREFIX}triutils" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) +IF(NOT TRIUTILS_LIBRARY) + FIND_LIBRARY(TRIUTILS_LIBRARY "${TRILINOS_LIBRARY_PREFIX}triutils.so" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) +ENDIF(NOT TRIUTILS_LIBRARY) + +FIND_LIBRARY(LOCA_EPETRA_LIBRARY "${TRILINOS_LIBRARY_PREFIX}locaepetra" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) +FIND_LIBRARY(NOX_EPETRA_LIBRARY "${TRILINOS_LIBRARY_PREFIX}noxepetra" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) +FIND_LIBRARY(EPETRAEXT_LIBRARY "${TRILINOS_LIBRARY_PREFIX}epetraext" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) + +IF(TEUCHOS_LIBRARY) + SET(TEUCHOS_LIBRARIES "${TEUCHOS_LIBRARY}") +ELSEIF(TEUCHOSCOMM_LIBRARY AND TEUCHOSCORE_LIBRARY AND TEUCHOSNUMERICS_LIBRARY AND TEUCHOSPARAMETERLIST_LIBRARY AND TEUCHOSREMAINDER_LIBRARY) + SET(TEUCHOS_LIBRARIES ${TEUCHOSCOMM_LIBRARY} ${TEUCHOSCORE_LIBRARY} ${TEUCHOSNUMERICS_LIBRARY} ${TEUCHOSPARAMETERLIST_LIBRARY} ${TEUCHOSREMAINDER_LIBRARY}) +ELSE(TEUCHOS_LIBRARY) + SET(TEUCHOS_LIBRARIES "") +ENDIF(TEUCHOS_LIBRARY) + +FIND_PATH(ZOLTAN_INCLUDE_PATH zoltan.h ${TRILINOS_INCLUDE_SEARCH_PATH} NO_DEFAULT_PATH) +FIND_LIBRARY(ZOLTAN_LIBRARY "${TRILINOS_LIBRARY_PREFIX}zoltan" ${TRILINOS_LIB_SEARCH_PATH} NO_DEFAULT_PATH) + +INCLUDE(FindPackageHandleStandardArgs) + +MESSAGE("EPETRA_INCLUDE_PATH: " ${EPETRA_INCLUDE_PATH}) +MESSAGE("EPETRA_LIBRARY: " ${EPETRA_LIBRARY}) + +IF(EPETRA_INCLUDE_PATH AND EPETRA_LIBRARY) + SET(TRILINOS_INCLUDE_DIR ${TRILINOS_INCLUDE_DIR} ${EPETRA_INCLUDE_PATH}) + SET(TRILINOS_LIBRARIES ${TRILINOS_LIBRARIES} ${EPETRA_LIBRARY}) + SET(HAVE_EPETRA YES) +ENDIF(EPETRA_INCLUDE_PATH AND EPETRA_LIBRARY) +find_package_handle_standard_args(EPETRA DEFAULT_MSG EPETRA_LIBRARY) + +MESSAGE("TEUCHOS_INCLUDE_PATH: " ${TEUCHOS_INCLUDE_PATH}) +MESSAGE("TEUCHOS_LIBRARIES: " ${TEUCHOS_LIBRARIES}) +IF(TEUCHOS_INCLUDE_PATH AND TEUCHOS_LIBRARIES) + SET(TRILINOS_INCLUDE_DIR ${TRILINOS_INCLUDE_DIR} ${TEUCHOS_INCLUDE_PATH}) + SET(TRILINOS_LIBRARIES ${TRILINOS_LIBRARIES} ${TEUCHOS_LIBRARIES}) + SET(HAVE_TEUCHOS YES) +ENDIF(TEUCHOS_INCLUDE_PATH AND TEUCHOS_LIBRARIES) + +IF(TEUCHOS_LIBRARY) + find_package_handle_standard_args(TEUCHOS DEFAULT_MSG TEUCHOS_LIBRARY) +ELSEIF(TEUCHOSCOMM_LIBRARY AND TEUCHOSCORE_LIBRARY AND TEUCHOSNUMERICS_LIBRARY AND TEUCHOSPARAMETERLIST_LIBRARY AND TEUCHOSREMAINDER_LIBRARY) + find_package_handle_standard_args(TEUCHOS DEFAULT_MSG TEUCHOSCOMM_LIBRARY TEUCHOSCORE_LIBRARY TEUCHOSNUMERICS_LIBRARY TEUCHOSPARAMETERLIST_LIBRARY TEUCHOSREMAINDER_LIBRARY) +ENDIF() + +IF(TRIUTILS_INCLUDE_PATH AND TRIUTILS_LIBRARY) + SET(TRILINOS_INCLUDE_DIR ${TRILINOS_INCLUDE_DIR} ${TRIUTILS_INCLUDE_PATH}) + SET(TRILINOS_LIBRARIES ${TRILINOS_LIBRARIES} ${TRIUTILS_LIBRARY}) + SET(HAVE_TRIUTILS YES) +ENDIF(TRIUTILS_INCLUDE_PATH AND TRIUTILS_LIBRARY) +find_package_handle_standard_args(TRIUTILS DEFAULT_MSG TRIUTILS_LIBRARY) + +IF(AMESOS_INCLUDE_PATH AND AMESOS_LIBRARY) + SET(TRILINOS_INCLUDE_DIR ${TRILINOS_INCLUDE_DIR} ${AMESOS_INCLUDE_PATH}) + SET(TRILINOS_LIBRARIES ${TRILINOS_LIBRARIES} ${AMESOS_LIBRARY}) + SET(HAVE_AMESOS YES) + find_package_handle_standard_args(AMESOS DEFAULT_MSG AMESOS_LIBRARY) +ENDIF(AMESOS_INCLUDE_PATH AND AMESOS_LIBRARY) + +IF(AMESOS2_INCLUDE_PATH AND AMESOS2_LIBRARY) + SET(TRILINOS_INCLUDE_DIR ${TRILINOS_INCLUDE_DIR} ${AMESOS2_INCLUDE_PATH}) + SET(TRILINOS_LIBRARIES ${TRILINOS_LIBRARIES} ${AMESOS2_LIBRARY}) + SET(HAVE_AMESOS2 YES) + find_package_handle_standard_args(AMESOS2 DEFAULT_MSG AMESOS2_LIBRARY) +ENDIF(AMESOS2_INCLUDE_PATH AND AMESOS2_LIBRARY) + +IF(AZTECOO_INCLUDE_PATH AND AZTECOO_LIBRARY) + SET(TRILINOS_INCLUDE_DIR ${TRILINOS_INCLUDE_DIR} ${AZTECOO_INCLUDE_PATH}) + SET(TRILINOS_LIBRARIES ${TRILINOS_LIBRARIES} ${AZTECOO_LIBRARY}) + SET(HAVE_AZTECOO YES) + find_package_handle_standard_args(AZTECOO DEFAULT_MSG AZTECOO_LIBRARY) +ENDIF(AZTECOO_INCLUDE_PATH AND AZTECOO_LIBRARY) + +IF(IFPACK_INCLUDE_PATH AND IFPACK_LIBRARY) + SET(TRILINOS_INCLUDE_DIR ${TRILINOS_INCLUDE_DIR} ${IFPACK_INCLUDE_PATH}) + SET(TRILINOS_LIBRARIES ${TRILINOS_LIBRARIES} ${IFPACK_LIBRARY}) + SET(HAVE_IFPACK YES) + find_package_handle_standard_args(IFPACK DEFAULT_MSG IFPACK_LIBRARY) +ENDIF(IFPACK_INCLUDE_PATH AND IFPACK_LIBRARY) + +IF(LOCA_INCLUDE_PATH AND LOCA_LIBRARY) + SET(TRILINOS_INCLUDE_DIR ${TRILINOS_INCLUDE_DIR} ${LOCA_INCLUDE_PATH}) + SET(TRILINOS_LIBRARIES ${TRILINOS_LIBRARIES} ${LOCA_LIBRARY}) + SET(HAVE_LOCA YES) + find_package_handle_standard_args(LOCA DEFAULT_MSG LOCA_LIBRARY) +ENDIF(LOCA_INCLUDE_PATH AND LOCA_LIBRARY) + +IF(ML_INCLUDE_PATH AND ML_LIBRARY) + SET(TRILINOS_INCLUDE_DIR ${TRILINOS_INCLUDE_DIR} ${ML_INCLUDE_PATH}) + SET(TRILINOS_LIBRARIES ${TRILINOS_LIBRARIES} ${ML_LIBRARY}) + SET(HAVE_ML YES) + find_package_handle_standard_args(ML DEFAULT_MSG ML_LIBRARY) +ENDIF(ML_INCLUDE_PATH AND ML_LIBRARY) + +IF(NOX_INCLUDE_PATH AND NOX_LIBRARY AND NOX_EPETRA_INCLUDE_PATH AND NOX_EPETRA_LIBRARY) + SET(TRILINOS_INCLUDE_DIR ${TRILINOS_INCLUDE_DIR} ${NOX_INCLUDE_PATH} ${NOX_EPETRA_INCLUDE_PATH}) + SET(TRILINOS_LIBRARIES ${TRILINOS_LIBRARIES} ${NOX_LIBRARY} ${NOX_EPETRA_LIBRARY}) + SET(HAVE_NOX YES) + find_package_handle_standard_args(NOX DEFAULT_MSG NOX_LIBRARY) +ENDIF(NOX_INCLUDE_PATH AND NOX_LIBRARY AND NOX_EPETRA_INCLUDE_PATH AND NOX_EPETRA_LIBRARY) + +IF(EPETRAEXT_INCLUDE_PATH AND EPETRAEXT_LIBRARY) + SET(TRILINOS_INCLUDE_DIR ${TRILINOS_INCLUDE_DIR} ${EPETRAEXT_INCLUDE_PATH}) + SET(TRILINOS_LIBRARIES ${TRILINOS_LIBRARIES} ${EPETRAEXT_LIBRARY}) + SET(HAVE_EPETRAEXT YES) + find_package_handle_standard_args(EPETRAEXT DEFAULT_MSG EPETRAEXT_LIBRARY) +ENDIF(EPETRAEXT_INCLUDE_PATH AND EPETRAEXT_LIBRARY) + +LIST(LENGTH TRILINOS_INCLUDE_DIR LEN) +IF(LEN GREATER 1) + LIST(REMOVE_DUPLICATES TRILINOS_INCLUDE_DIR) +ENDIF(LEN GREATER 1) + +IF(EPETRA_FOUND AND TEUCHOS_FOUND) + SET(TRILINOS_FOUND TRUE) +ELSE(EPETRA_FOUND AND TEUCHOS_FOUND) # Not found. This will raise an error + SET(TRILINOS_FOUND FALSE) +ENDIF(EPETRA_FOUND AND TEUCHOS_FOUND) + +IF(ZOLTAN_INCLUDE_PATH AND ZOLTAN_LIBRARY) + SET(TRILINOS_INCLUDE_DIR ${TRILINOS_INCLUDE_DIR} ${ZOLTAN_INCLUDE_PATH}) + SET(TRILINOS_LIBRARIES ${TRILINOS_LIBRARIES} ${ZOLTAN_LIBRARY}) + SET(HAVE_ZOLTAN YES) + find_package_handle_standard_args(ZOLTAN DEFAULT_MSG ZOLTAN_LIBRARY) +ENDIF(ZOLTAN_INCLUDE_PATH AND ZOLTAN_LIBRARY) + +IF(TRILINOS_FOUND) + MESSAGE(STATUS "Trilinos packages found.") + MESSAGE(STATUS "TRILINOS_INCLUDE_DIR: ${TRILINOS_INCLUDE_DIR}") + MESSAGE(STATUS "TRILINOS_LIBRARIES: ${TRILINOS_LIBRARIES}") +ELSE (TRILINOS_FOUND) + MESSAGE(FATAL_ERROR ${ERROR_NOT_FOUND_MESSAGE}) +ENDIF(TRILINOS_FOUND) diff --git a/cmake_modules/KratosDependencies.cmake b/cmake_modules/KratosDependencies.cmake index 9aacf564c17c..107c90f0c6d6 100644 --- a/cmake_modules/KratosDependencies.cmake +++ b/cmake_modules/KratosDependencies.cmake @@ -1,7 +1,7 @@ # This function manages application dependencies macro(kratos_add_dependency application_path) get_filename_component(application_name ${application_path} NAME ) - IF(NOT TARGET Kratos${application_name}) + IF(NOT TARGET Kratos${application_name} AND ${EXCLUDE_AUTOMATIC_DEPENDENCIES} MATCHES OFF) message("-- [Info] Adding dependency ${application_name}") add_subdirectory(${application_path} ${CMAKE_BINARY_DIR}/applications/${application_name} ) @@ -9,5 +9,5 @@ macro(kratos_add_dependency application_path) list(APPEND tmp ${application_name}) set_property(GLOBAL PROPERTY LIST_OF_APPLICATIONS_ADDED_THROUGH_DEPENDENCIES ${tmp}) - endif(NOT TARGET Kratos${application_name}) + endif() endmacro(kratos_add_dependency) diff --git a/kratos/python_scripts/testing/ci_utilities.py b/kratos/python_scripts/testing/ci_utilities.py index ac30a2f30b9a..b04255f52ffa 100644 --- a/kratos/python_scripts/testing/ci_utilities.py +++ b/kratos/python_scripts/testing/ci_utilities.py @@ -72,4 +72,7 @@ def print_ci_information() -> None: if __name__ == "__main__": - print_ci_information() + try: + print_ci_information() + except Exception as e: + print("Unable to detect application changes in this configuration") diff --git a/scripts/docker_files/docker_file_ci_ubuntu_20_04/DockerFile b/scripts/docker_files/docker_file_ci_ubuntu_20_04/DockerFile index 3ceb578f4261..22d7a7718360 100644 --- a/scripts/docker_files/docker_file_ci_ubuntu_20_04/DockerFile +++ b/scripts/docker_files/docker_file_ci_ubuntu_20_04/DockerFile @@ -15,7 +15,6 @@ RUN apt-get update -y && apt-get upgrade -y && \ apt-get -y update && \ apt-get install -y --no-install-recommends \ build-essential \ - ccache \ clang \ libomp-10-dev \ cmake \ @@ -46,8 +45,6 @@ RUN apt-get update -y && apt-get upgrade -y && \ python3-dev \ python3-h5py \ python3-pip && \ - /usr/sbin/update-ccache-symlinks && \ - echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a ~/.bashrc && \ python3 -m pip install --upgrade pip && \ pip3 install \ numpy \ diff --git a/scripts/docker_files/docker_file_ci_ubuntu_22_04/DockerFile b/scripts/docker_files/docker_file_ci_ubuntu_22_04/DockerFile index 71b7c761fff3..ad5253142adb 100644 --- a/scripts/docker_files/docker_file_ci_ubuntu_22_04/DockerFile +++ b/scripts/docker_files/docker_file_ci_ubuntu_22_04/DockerFile @@ -16,7 +16,6 @@ RUN apt-get update -y && apt-get upgrade -y && \ apt-get install -y --no-install-recommends \ sudo \ build-essential \ - ccache \ g++-12 \ gfortran-12 \ clang-14 \ @@ -49,8 +48,6 @@ RUN apt-get update -y && apt-get upgrade -y && \ python3-dev \ python3-h5py \ python3-pip && \ - /usr/sbin/update-ccache-symlinks && \ - echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a ~/.bashrc && \ python3 -m pip install --upgrade pip && \ pip3 install \ numpy \ diff --git a/scripts/docker_files/docker_file_ci_ubuntu_bionic/DockerFile b/scripts/docker_files/docker_file_ci_ubuntu_bionic/DockerFile index 96d14c93aa9a..44aea85deba0 100644 --- a/scripts/docker_files/docker_file_ci_ubuntu_bionic/DockerFile +++ b/scripts/docker_files/docker_file_ci_ubuntu_bionic/DockerFile @@ -15,7 +15,6 @@ RUN apt-get update -y && apt-get upgrade -y && \ apt-get -y update && \ apt-get install -y \ build-essential \ - ccache \ clang-9 \ cmake \ gfortran-7 \ @@ -41,8 +40,6 @@ RUN apt-get update -y && apt-get upgrade -y && \ python3-h5py \ python3-pip \ valgrind && \ - /usr/sbin/update-ccache-symlinks && \ - echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a ~/.bashrc && \ python3 -m pip install --upgrade pip && \ pip3 install \ numpy \