Skip to content

Commit

Permalink
Merge branch 'master' into ci/update-docker-rocky-image
Browse files Browse the repository at this point in the history
  • Loading branch information
loumalouomega committed Dec 13, 2024
2 parents 965cde7 + 9817513 commit 9efea02
Show file tree
Hide file tree
Showing 136 changed files with 4,050 additions and 1,275 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -301,17 +301,17 @@ jobs:
python kratos/python_scripts/testing/run_python_tests.py -l nightly -c python
centos:
rocky:
runs-on: ubuntu-latest
needs: changed-files
env:
KRATOS_BUILD_TYPE: Custom
KRATOS_CI_CHANGED_FILES: ${{needs.changed-files.outputs.files}}
KRATOS_CI_APPLICATIONS: ".github/workflows/ci_apps_centos.json"
KRATOS_CI_APPLICATIONS: ".github/workflows/ci_apps_rocky.json"
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true

container:
image: kratosmultiphysics/kratos-image-ci-centos7:latest
image: kratosmultiphysics/kratos-image-ci-rockylinux-8:latest
options: --user 1001

steps:
Expand All @@ -327,8 +327,8 @@ jobs:
- name: Build
run: |
export KRATOS_CMAKE_CXX_FLAGS="-Werror -Wno-deprecated-declarations -Wignored-qualifiers"
cp .github/workflows/centos_configure.sh centos_configure.sh
bash centos_configure.sh
cp .github/workflows/rocky_configure.sh rocky_configure.sh
bash rocky_configure.sh
- name: Running C++ tests
run: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[
"FluidDynamicsApplication",
"MappingApplication",
"StructuralMechanicsApplication",
"MeshingApplication",
"LinearSolversApplication",
"ConstitutiveLawsApplication",
"CoSimulationApplication"
[
"FluidDynamicsApplication",
"MappingApplication",
"StructuralMechanicsApplication",
"MeshingApplication",
"LinearSolversApplication",
"ConstitutiveLawsApplication",
"CoSimulationApplication"
]
35 changes: 27 additions & 8 deletions .github/workflows/nightly_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- '.github/workflows/nightly_build.yml'
- '.github/workflows/configure.sh'
- '.github/workflows/configure.cmd'
- '.github/workflows/centos_configure.sh'
- '.github/workflows/rocky_configure.sh'

schedule:
- cron: '0 1 * * *'
Expand Down Expand Up @@ -131,13 +131,20 @@ jobs:
bash configure.sh
rm -r ${GITHUB_WORKSPACE}/build
- name: Running C++ tests
run: |
source /opt/intel/oneapi/setvars.sh
export PYTHONPATH=${PYTHONPATH}:${GITHUB_WORKSPACE}/bin/${KRATOS_BUILD_TYPE}
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GITHUB_WORKSPACE}/bin/${KRATOS_BUILD_TYPE}/libs
python3 kratos/python_scripts/testing/run_cpp_tests.py
- name: Running tests
shell: bash
run: |
source /opt/intel/oneapi/setvars.sh
export PYTHONPATH=${PYTHONPATH}:${GITHUB_WORKSPACE}/bin/${KRATOS_BUILD_TYPE}
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GITHUB_WORKSPACE}/bin/${KRATOS_BUILD_TYPE}/libs
python3 kratos/python_scripts/testing/run_tests.py -l nightly -c python3
python3 kratos/python_scripts/testing/run_python_tests.py -l nightly -c python3
- name: Running Python MPI tests (2 Cores)
shell: bash
Expand Down Expand Up @@ -201,20 +208,26 @@ jobs:
copy .\.github\workflows\configure.cmd
configure.cmd
- name: Running C++ tests
run: |
set PYTHONPATH=%PYTHONPATH%;%GITHUB_WORKSPACE%/bin/%KRATOS_BUILD_TYPE%
set PATH=%PATH%;%GITHUB_WORKSPACE%/bin/%KRATOS_BUILD_TYPE%/libs
python kratos/python_scripts/testing/run_cpp_tests.py
- name: Running nightly tests
shell: cmd
run: |
set PYTHONPATH=%PYTHONPATH%;%GITHUB_WORKSPACE%/bin/%KRATOS_BUILD_TYPE%
set PATH=%PATH%;%GITHUB_WORKSPACE%/bin/%KRATOS_BUILD_TYPE%/libs
python kratos/python_scripts/testing/run_tests.py -l nightly -c python
python kratos/python_scripts/testing/run_python_tests.py -l nightly -c python
centos-nightly:
rocky-nightly:
runs-on: ubuntu-latest
env:
KRATOS_BUILD_TYPE: Custom

container:
image: kratosmultiphysics/kratos-image-ci-centos7:latest
image: kratosmultiphysics/kratos-image-ci-rockylinux-8:latest
options: --user 1001

steps:
Expand All @@ -227,11 +240,17 @@ jobs:
- name: Build
run: |
cp .github/workflows/centos_configure.sh centos_configure.sh
bash centos_configure.sh
cp .github/workflows/rocky_configure.sh rocky_configure.sh
bash rocky_configure.sh
- name: Running C++ tests
run: |
export PYTHONPATH=${PYTHONPATH}:${GITHUB_WORKSPACE}/bin/Custom
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GITHUB_WORKSPACE}/bin/Custom/libs
python3.8 kratos/python_scripts/testing/run_cpp_tests.py
- name: Running nightly tests
run: |
export PYTHONPATH=${PYTHONPATH}:${GITHUB_WORKSPACE}/bin/Custom
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
python3.8 kratos/python_scripts/testing/run_python_tests.py -l nightly -c python3.8
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,27 @@ export KRATOS_APP_DIR="${KRATOS_SOURCE}/applications"
export PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE:-"/usr/bin/python3"}
export KRATOS_INSTALL_PYTHON_USING_LINKS=ON

# Boost setup
BOOST_VERSION="1.86.0"
BOOST_DIR_NAME="boost_1_86_0"
BOOST_TARBALL_URL="https://archives.boost.io/release/${BOOST_VERSION}/source/${BOOST_DIR_NAME}.tar.gz"
BOOST_DOWNLOAD_DIR="${KRATOS_SOURCE}/external_libraries"
BOOST_EXTRACT_DIR="${BOOST_DOWNLOAD_DIR}/${BOOST_DIR_NAME}"

# Download and extract Boost if not already done
mkdir -p "${BOOST_DOWNLOAD_DIR}"
if [ ! -d "${BOOST_EXTRACT_DIR}" ]; then
echo "Downloading Boost ${BOOST_VERSION}..."
curl -L "${BOOST_TARBALL_URL}" -o "${BOOST_DOWNLOAD_DIR}/${BOOST_DIR_NAME}.tar.gz"
echo "Extracting Boost..."
tar -xzf "${BOOST_DOWNLOAD_DIR}/${BOOST_DIR_NAME}.tar.gz" -C "${BOOST_DOWNLOAD_DIR}"
fi

# Define BOOST_ROOT
export BOOST_ROOT="${BOOST_EXTRACT_DIR}"
echo "BOOST_ROOT is set to ${BOOST_ROOT}"

# Add applications
add_app ${KRATOS_APP_DIR}/FluidDynamicsApplication;
add_app ${KRATOS_APP_DIR}/MappingApplication;
add_app ${KRATOS_APP_DIR}/StructuralMechanicsApplication;
Expand All @@ -35,14 +56,12 @@ rm -rf "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}/CMakeFiles"

echo "Kratos build type is ${KRATOS_BUILD_TYPE}"

# Enable devtoolset-8
source scl_source enable devtoolset-8

# Configure
cmake -H"${KRATOS_SOURCE}" -B"${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" \
${KRATOS_CMAKE_OPTIONS_FLAGS} \
-DUSE_MPI=OFF \
-DPYBIND11_PYTHON_VERSION="3.8" \
-DBOOST_ROOT="${BOOST_ROOT}" \
-DCMAKE_CXX_FLAGS="${KRATOS_CMAKE_CXX_FLAGS} -O0 -Wall" \
-DCMAKE_UNITY_BUILD=ON \

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ if(KRATOS_BUILD_TESTING MATCHES ON)
# retrieve a copy of the current directory's `COMPILE_OPTIONS`
get_directory_property(kratos_root_compile_options COMPILE_OPTIONS)

# Disable warnings (needed by centos. We should all love centos, it clearly needs some affection)
# Disable warnings (needed by Intel Compiler Legacy)
add_compile_options(-w)

FetchContent_Declare(
Expand Down
25 changes: 13 additions & 12 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
- [Specific Application Dependencies](#specific-application-dependencies)
- [Basic Configuration](#basic-configuration)
- [Configuration scripts examples](#configuration-scripts-examples)
- [Linux/WSL](#gnulinux)
- [GNU/Linux](#gnulinux)
- [Windows](#windows)
- [Visual Studio](#visual-studio)
- [Windows Visual Studio compilation configuration](#windows-visual-studio-compilation-configuration)
- [MinGW](#mingw)
- [MinGW](#mingw)
- [MacOS](#macos)
- [Adding Applications](#adding-applications)
- [Post Compilation](#post-compilation)
Expand Down Expand Up @@ -59,7 +59,7 @@ git clone https://github.com/KratosMultiphysics/Kratos Kratos

Additionaly, Visual Studio is required to compile in *Windows*.

- #### Linux/WSL installation
- #### GNU/Linux-WSL installation

The command below will install all the packages needed.

Expand Down Expand Up @@ -106,13 +106,13 @@ Additionaly, Visual Studio is required to compile in *Windows*.
Extract boost, and note the path as it will be needed in the configure stage to set the environmental variable `BOOST_ROOT`.
- #### MinGW
MingGw compilation details are hidden by default to avoid confusion, please click the button below to show them.
*MingGw* compilation details are hidden by default to avoid confusion, please click the button below to show them.
<details>
<summary>Show MinGW compilation details</summary>
*MinGW* means minimal GNU for *Windows*. There are different manners of installing, the simplest one using *MSYS2*.
- MSYS2
- *MSYS2*
First, we download *MSYS2* in the following [link](https://www.msys2.org/). This will install *MinGW*, which allows to easiy install packages *a la* Arch-Linux (Pacman package manager). We install it, and with it the first thing we do is to update as follows ([in the *MSYS2* bash](https://www.msys2.org/docs/terminals/)):
![](https://www.msys2.org/docs/mintty.png) ![](https://www.msys2.org/docs/launchers.png)
Expand Down Expand Up @@ -141,7 +141,7 @@ Additionaly, Visual Studio is required to compile in *Windows*.
You will need a series of packages with some *Kratos* dependencies. These include the compilers (*GCC*,*Clang/LLVM*), *CMake*, *Blas and Lapack* libraries and the *OpenMP* support. The command below will install all the packages needed. The command below will install all the packages needed.
```Shell
pacman -S mingw64/mingw-w64-x86_64-lapack mingw64/mingw-w64-x86_64-openblas mingw64/mingw-w64-x86_64-cmake mingw64/mingw-w64-x86_64-clang mingw64/mingw-w64-x86_64-gcc mingw64/mingw-w64-x86_64-gcc-fortran mingw-w64-x86_64-make mingw64/mingw-w64-x86_64-openmp mingw64/mingw-w64-x86_64-dlfcn
pacman -S mingw64/mingw-w64-x86_64-lapack mingw64/mingw-w64-x86_64-openblas mingw64/mingw-w64-x86_64-cmake mingw64/mingw-w64-x86_64-clang mingw64/mingw-w64-x86_64-gcc mingw64/mingw-w64-x86_64-gcc-fortran mingw-w64-x86_64-make mingw64/mingw-w64-x86_64-openmp mingw64/mingw-w64-x86_64-dlfcn mingw64/mingw-w64-x86_64-llvm-openmp
```
- Python
Expand All @@ -162,15 +162,17 @@ Additionaly, Visual Studio is required to compile in *Windows*.

##### Using UCRT64

UCRT (Universal C Runtime) is a newer version which is also used by Microsoft Visual Studio by default, see https://www.msys2.org/docs/environments/. It should work and behave as if the code was compiled with MSVC.
**⚠️NOTE:** Right now **UCRT64** is giving linking issues and therefore is not recommended to compile *Kratos*.

- Better compatibility with MSVC, both at build time and at run time.
- It only ships by default on Windows 10 and for older versions you have to provide it yourself or depend on the user having it installed.
**UCRT** (*Universal C Runtime*) is a newer version which is also used by Microsoft Visual Studio by default, see [*MSYS2*](https://www.msys2.org/docs/environments/). It should work and behave as if the code was compiled with **MSVC**.

If using UCRT64 the dependencies will be like:
- Better compatibility with **MSVC**, both at build time and at run time.
- It only ships by default on *Windows 10* and for older versions you have to provide it yourself or depend on the user having it installed.

If using **UCRT64** the dependencies will be like:

```Shell
pacman -S ucrt64/mingw-w64-ucrt-x86_64-lapack ucrt64/mingw-w64-ucrt-x86_64-openblas ucrt64/mingw-w64-ucrt-x86_64-cmake ucrt64/mingw-w64-ucrt-x86_64-clang ucrt64/mingw-w64-ucrt-x86_64-gcc ucrt64/mingw-w64-ucrt-x86_64-gcc-fortran mingw-w64-ucrt-x86_64-make ucrt64/mingw-w64-ucrt-x86_64-openmp ucrt64/mingw-w64-ucrt-x86_64-dlfcn ucrt64/mingw-w64-ucrt-x86_64-boost
pacman -S ucrt64/mingw-w64-ucrt-x86_64-lapack ucrt64/mingw-w64-ucrt-x86_64-openblas ucrt64/mingw-w64-ucrt-x86_64-cmake ucrt64/mingw-w64-ucrt-x86_64-clang ucrt64/mingw-w64-ucrt-x86_64-gcc ucrt64/mingw-w64-ucrt-x86_64-gcc-fortran mingw-w64-ucrt-x86_64-make ucrt64/mingw-w64-ucrt-x86_64-openmp ucrt64/mingw-w64-ucrt-x86_64-dlfcn ucrt64/mingw-w64-ucrt-x86_64-boost ucrt64/mingw-w64-ucrt-x86_64-llvm-openmp
```
</details>

Expand Down Expand Up @@ -409,7 +411,6 @@ cmake ..
-B"${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" \
-DUSE_MPI=OFF \
-DKRATOS_SHARED_MEMORY_PARALLELIZATION="${KRATOS_SHARED_MEMORY_PARALLELIZATION}" \
-DKRATOS_GENERATE_PYTHON_STUBS=ON \
-DUSE_EIGEN_MKL=OFF
# Buid
Expand Down
15 changes: 15 additions & 0 deletions applications/ConstitutiveLawsApplication/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,21 @@ add_library(KratosConstitutiveLawsCore SHARED ${KRATOS_CONSTITUTIVE_LAWS_APPLICA
target_link_libraries(KratosConstitutiveLawsCore PUBLIC KratosCore KratosStructuralMechanicsCore)
set_target_properties(KratosConstitutiveLawsCore PROPERTIES COMPILE_DEFINITIONS "CONSTITUTIVE_LAWS_APPLICATION=EXPORT,API")

## ConstitutiveLaws benchmark sources. Disabled by default
if(${KRATOS_BUILD_BENCHMARK} MATCHES ON)
file(GLOB_RECURSE KRATOS_BENCHMARK_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/*.cpp
)

foreach(file ${KRATOS_BENCHMARK_SOURCES})
get_filename_component(filename ${file} NAME_WE)
add_executable(${filename} ${file})
target_link_libraries(${filename} PUBLIC KratosConstitutiveLawsCore benchmark::benchmark)
set_target_properties(${filename} PROPERTIES COMPILE_DEFINITIONS "KRATOS_BENCHMARK=IMPORT,API")
install(TARGETS ${filename} DESTINATION benchmark)
endforeach(file ${KRATOS_BENCHMARK_SOURCES})
endif(${KRATOS_BUILD_BENCHMARK} MATCHES ON)

###############################################################
## define library Kratos which defines the basic python interface
pybind11_add_module(KratosConstitutiveLawsApplication MODULE THIN_LTO ${KRATOS_CONSTITUTIVE_LAWS_APPLICATION_PYTHON_INTERFACE})
Expand Down
15 changes: 15 additions & 0 deletions applications/ContactStructuralMechanicsApplication/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ add_library(KratosContactStructuralMechanicsCore SHARED ${KRATOS_CONTACT_STRUCTU
target_link_libraries(KratosContactStructuralMechanicsCore PUBLIC KratosCore KratosStructuralMechanicsCore)
set_target_properties(KratosContactStructuralMechanicsCore PROPERTIES COMPILE_DEFINITIONS "CONTACT_STRUCTURAL_MECHANICS_APPLICATION=EXPORT,API")

## ContactStructuralMechanics benchmark sources. Disabled by default
if(${KRATOS_BUILD_BENCHMARK} MATCHES ON)
file(GLOB_RECURSE KRATOS_BENCHMARK_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/*.cpp
)

foreach(file ${KRATOS_BENCHMARK_SOURCES})
get_filename_component(filename ${file} NAME_WE)
add_executable(${filename} ${file})
target_link_libraries(${filename} PUBLIC KratosContactStructuralMechanicsCore benchmark::benchmark)
set_target_properties(${filename} PROPERTIES COMPILE_DEFINITIONS "KRATOS_BENCHMARK=IMPORT,API")
install(TARGETS ${filename} DESTINATION benchmark)
endforeach(file ${KRATOS_BENCHMARK_SOURCES})
endif(${KRATOS_BUILD_BENCHMARK} MATCHES ON)

###############################################################
## define library Kratos which defines the basic python interface
pybind11_add_module(KratosContactStructuralMechanicsApplication MODULE THIN_LTO ${KRATOS_CONTACT_STRUCTURAL_MECHANICS_APPLICATION_PYTHON_INTERFACE})
Expand Down
Loading

0 comments on commit 9efea02

Please sign in to comment.