Hello @KratosMultiphysics/technical-committee ,
I want to compile Kratos in MPI and I got the following error:
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- No KRATOS_SOURCE_DIR is defined, using: /home/ipouplana/Kratos
-- No KRATOS_BINARY_DIR is defined, using: /home/ipouplana/Kratos/build/Release
-- No INSTALL_RUNKRATOS is defined, setting to ON
-- No CMAKE_INSTALL_MESSAGE is defined. Setting to NEVER
-- Found Git: /usr/bin/git (found version "2.17.1")
-- additional default options were set for gcc
-- CMAKE_CXX_FLAGS = -funroll-loops -Wall -std=c++11 -Wsuggest-override
-- CMAKE_C_FLAGS = -funroll-loops -Wall
-- CMAKE_SYSTEM_NAME = Linux
-- Found PythonInterp: /usr/bin/python3 (found version "3.6.9")
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.6m.so
-- Standard install dir /home/ipouplana/Kratos/bin/Release
-- OpenMP included
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- Boost version: 1.67.0
-- Boost Include: /home/ipouplana/boost_1_67_0
-- Boost Linkdir:
-- Could NOT find MPI_C (missing: MPI_C_LIB_NAMES MPI_C_HEADER_DIR MPI_C_WORKS)
-- Could NOT find MPI_CXX (missing: MPI_CXX_LIB_NAMES MPI_CXX_HEADER_DIR MPI_CXX_WORKS)
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND)
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.10/Modules/FindMPI.cmake:1444 (find_package_handle_standard_args)
CMakeLists.txt:339 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/ipouplana/Kratos/build/Release/CMakeFiles/CMakeOutput.log".
-- No KRATOS_SOURCE_DIR is defined, using: /home/ipouplana/Kratos
-- No KRATOS_BINARY_DIR is defined, using: /home/ipouplana/Kratos/build/Release
-- No INSTALL_RUNKRATOS is defined, setting to ON
-- No CMAKE_INSTALL_MESSAGE is defined. Setting to NEVER
-- additional default options were set for gcc
-- CMAKE_CXX_FLAGS = -funroll-loops -Wall -std=c++11 -Wsuggest-override
-- CMAKE_C_FLAGS = -funroll-loops -Wall
-- CMAKE_SYSTEM_NAME = Linux
-- User defined install dir /home/ipouplana/Kratos/bin/Release
-- OpenMP included
-- Found OpenMP_C: -fopenmp
-- Found OpenMP_CXX: -fopenmp
-- Found OpenMP: TRUE
-- Boost version: 1.67.0
-- Boost Include: /home/ipouplana/boost_1_67_0
-- Boost Linkdir:
-- Could NOT find MPI_C (missing: MPI_C_LIB_NAMES MPI_C_HEADER_DIR MPI_C_WORKS)
-- Could NOT find MPI_CXX (missing: MPI_CXX_LIB_NAMES MPI_CXX_HEADER_DIR MPI_CXX_WORKS)
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND)
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.10/Modules/FindMPI.cmake:1444 (find_package_handle_standard_args)
CMakeLists.txt:339 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/ipouplana/Kratos/build/Release/CMakeFiles/CMakeOutput.log".
Makefile:840: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
I am working in Ubuntu 18.04.4 LTS and I installed the following packages:
And my configure.sh looks like follows:
#!/bin/bash
# Please do not modify this script
# 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 will all the compiation options in INSTALL.md or here:
# - https://github.com/KratosMultiphysics/Kratos/wiki/Compilation-options
# Function to add apps
add_app () {
export KRATOS_APPLICATIONS="${KRATOS_APPLICATIONS}$1;"
}
# Set compiler
export CC=gcc
export CXX=g++
# Set variables
export KRATOS_SOURCE="${KRATOS_SOURCE:-"$( cd "$(dirname "$0")" ; pwd -P )"/..}"
export KRATOS_BUILD="${KRATOS_SOURCE}/build"
export KRATOS_APP_DIR="${KRATOS_SOURCE}/applications"
export KRATOS_INSTALL_PYTHON_USING_LINKS=ON
# Set basic configuration
export KRATOS_BUILD_TYPE=${KRATOS_BUILD_TYPE:-"Release"}
export PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE:-"/usr/bin/python3"}
export BOOST_ROOT=${BOOST_ROOT:-"/home/ipouplana/boost_1_67_0"}
# Set applications to compile
export KRATOS_APPLICATIONS=
add_app ${KRATOS_APP_DIR}/ExternalSolversApplication
add_app ${KRATOS_APP_DIR}/StructuralMechanicsApplication
add_app ${KRATOS_APP_DIR}/FluidDynamicsApplication
add_app ${KRATOS_APP_DIR}/DEMApplication
add_app ${KRATOS_APP_DIR}/DemStructuresCouplingApplication
add_app ${KRATOS_APP_DIR}/ConvectionDiffusionApplication
add_app ${KRATOS_APP_DIR}/PoromechanicsApplication
add_app ${KRATOS_APP_DIR}/FluidTransportApplication
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"
# Configure
cmake -H"${KRATOS_SOURCE}" -B"${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" \
-DUSE_METIS_5=ON \
-DUSE_MPI=ON \
-DMETIS_INCLUDE_DIR="/usr/include/" \
-DPARMETIS_ROOT_DIR="/usr/lib/" \
-DTRILINOS_LIBRARY_DIR="/usr/lib/x86_64-linux-gnu/" \
-DTRILINOS_INCLUDE_DIR="/usr/include/trilinos/" \
-DTRILINOS_LIBRARY_PREFIX="trilinos_" \
-DADD_DEPENDENT_APPLICATIONS=ON \
-DINCLUDE_SUPERLU=ON \
-DINSTALL_EMBEDDED_PYTHON=ON \
-DKRATOS_BUILD_TESTING=OFF \
# Buid
cmake --build "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" --target install -- -j6
I've looked into the Linux Build wiki page, but I think it is not updated with the current configuration changes. Has anybody recently compiled Kratos in MPI ? Do you have a configure.sh that can be used as an example ?
Thanks in advance!
The linux-CI compiles Kratos with MPI: https://github.com/KratosMultiphysics/Kratos/blob/master/.github/workflows/configure.sh
I also checked my own configure script, it looks pretty similar to yours
Did you install MPI? In the CI this is done here:
https://github.com/KratosMultiphysics/Kratos/blob/master/scripts/docker_files/docker_file_ci_ubuntu_bionic/DockerFile#L39
and here:
https://github.com/KratosMultiphysics/Kratos/blob/master/scripts/docker_files/docker_file_ci_ubuntu_bionic/DockerFile#L30
what is the output when you run which mpicxx?
Thanks for the quick answer @philbucher .
I have no output for which mpicxx, so I guess I did not install MPI ^_^' ...
I'll try to do it tomorrow and I'll tell you.
@ipouplana once you have the MPI please consider #6555 (there was a small but relevant error in the Wiki manual).
Thanks @rubenzorrilla ! I'll try it later today ;)
Ok, now I have some compilation errors in the PoromechanicsApp., but at least some applications are compiling ok :)
I managed to compile everything without problems! I close this issue.