Skip to content

Commit

Permalink
Merge pull request #739 from MFraters/add_linux_clang_tester
Browse files Browse the repository at this point in the history
Add linux clang tester.
  • Loading branch information
MFraters authored Jun 14, 2024
2 parents 500171c + 39be0cc commit 0ddeefd
Show file tree
Hide file tree
Showing 45 changed files with 488 additions and 363 deletions.
122 changes: 122 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,128 @@ jobs:
run: ctest -VV -C ${{ matrix.build_type }}



linux-clang_flang_mpi:
needs: [test_indentation]
strategy:
fail-fast: false
matrix:
os: ['ubuntu-24.04']
build_type: ['Debug']

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2

- name: Install optional dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt update;
sudo apt install clang flang swig python3-setuptools openmpi-bin libopenmpi-dev;
else
echo "$RUNNER_OS not supported"
exit 1
fi
shell: bash

- name: CMake version
run: cmake --version

- name: clang version
run: clang --version

- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build

- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: |
export CC=/usr/bin/clang;
export CXX=/usr/bin/clang++;
export FORTRAN=/usr/bin/flang;
export OMPI_CC=clang;
export OMPI_CXX=clang++;
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_FLAGS=-Werror;
cat ${{github.workspace}}/build/CMakeFiles/CMakeError.log ||:;
- name: Build gwb
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config ${{ matrix.build_type }}

- name: Install gwb Linux and macOS
working-directory: ${{github.workspace}}/build
shell: bash
run: sudo cmake --install . --config ${{ matrix.build_type }}

- name: Test gwb
working-directory: ${{github.workspace}}/build
shell: bash
run: ctest -VV -C ${{ matrix.build_type }}


linux-clang_gfortran_mpi:
needs: [test_indentation,coverage]
strategy:
fail-fast: false
matrix:
os: ['ubuntu-24.04']
build_type: ['Debug']

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2

- name: Install optional dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt update;
sudo apt install clang swig python3-setuptools openmpi-bin libopenmpi-dev;
else
echo "$RUNNER_OS not supported"
exit 1
fi
shell: bash

- name: CMake version
run: cmake --version

- name: clang version
run: clang --version

- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build

- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: |
export CC=/usr/bin/clang;
export CXX=/usr/bin/clang++;
export FORTRAN=/usr/bin/flang;
export OMPI_CC=clang;
export OMPI_CXX=clang++;
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_FLAGS=-Werror;
cat ${{github.workspace}}/build/CMakeFiles/CMakeError.log ||:;
- name: Build gwb
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config ${{ matrix.build_type }}

- name: Install gwb Linux and macOS
working-directory: ${{github.workspace}}/build
shell: bash
run: sudo cmake --install . --config ${{ matrix.build_type }}

- name: Test gwb
working-directory: ${{github.workspace}}/build
shell: bash
run: ctest -VV -C ${{ matrix.build_type }}


linux-gcc_no_apps:
needs: [test_indentation,coverage]
Expand Down
17 changes: 9 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ else()
endif()

if(USE_MPI)
message(STATUS "Using MPI.")
message(STATUS "Using MPI found in: ${MPI_INCLUDE_PATH}")
include_directories(${MPI_INCLUDE_PATH})
else()
message(STATUS "Not using MPI.")
Expand Down Expand Up @@ -371,16 +371,16 @@ if (NOT MSVC AND NOT APPLE)
# cmake vesrion 3.12.0 introduces COMPILE_LANGUAGE:FORTRAN, otherwise this would be >=2.8.12
if(NOT ${CMAKE_VERSION} VERSION_LESS "3.9.0")
SET(WB_COMPILER_OPTIONS_PRIVATE -pedantic -Wall -Wextra
$<$<COMPILE_LANGUAGE:CXX>:-Wmost -Wconversion -Wunreachable-code -Wuninitialized -Wmissing-braces -Wunused-parameter -Wold-style-cast -Wshadow -Wfloat-equal -Wpointer-arith -Wwrite-strings
$<$<COMPILE_LANGUAGE:CXX>:-Wmost -Wunreachable-code -Wuninitialized -Wmissing-braces -Wunused-parameter -Wold-style-cast -Wshadow -Wfloat-equal -Wpointer-arith -Wwrite-strings
-Wsynth -Wsign-compare -Woverloaded-virtual -Wliteral-range -Wparentheses -Wunused-local-typedefs -Wcast-qual -fstrict-aliasing -Werror=uninitialized -Wundef
-Wcast-align -Wmissing-declarations -Wredundant-decls -Wdiv-by-zero -Wdisabled-optimization -Wswitch-default -Wunused>)

if (${FORCE_COLORED_OUTPUT})
SET(WB_COMPILER_OPTIONS_PRIVATE -fcolor-diagnostics ${WB_COMPILER_OPTIONS_PRIVATE})
SET(WB_COMPILER_OPTIONS_PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-fcolor-diagnostics> ${WB_COMPILER_OPTIONS_PRIVATE})
endif ()

else()
SET(WB_COMPILER_OPTIONS_PRIVATE "-pedantic -Wall -Wextra -Wmost -Wconversion -Wunreachable-code -Wuninitialized -Wmissing-braces -Wunused-parameter -Wold-style-cast -Wshadow -Wfloat-equal -Wpointer-arith -Wwrite-strings -Wsynth -Wsign-compare -Woverloaded-virtual -Wliteral-range -Wparentheses -Wunused-local-typedefs -Wcast-qual -fstrict-aliasing -Werror=uninitialized -Wundef -Wcast-align -Wmissing-declarations -Wredundant-decls -Wdiv-by-zero -Wdisabled-optimization -Wswitch-default -Wunused")
SET(WB_COMPILER_OPTIONS_PRIVATE "-pedantic -Wall -Wextra -Wmost -Wunreachable-code -Wuninitialized -Wmissing-braces -Wunused-parameter -Wold-style-cast -Wshadow -Wfloat-equal -Wpointer-arith -Wwrite-strings -Wsynth -Wsign-compare -Woverloaded-virtual -Wliteral-range -Wparentheses -Wunused-local-typedefs -Wcast-qual -fstrict-aliasing -Werror=uninitialized -Wundef -Wcast-align -Wmissing-declarations -Wredundant-decls -Wdiv-by-zero -Wdisabled-optimization -Wswitch-default -Wunused")

if (${FORCE_COLORED_OUTPUT})
SET(WB_COMPILER_OPTIONS_PRIVATE "-fcolor-diagnostics ${WB_COMPILER_OPTIONS_PRIVATE}")
Expand All @@ -396,15 +396,16 @@ if (NOT MSVC AND NOT APPLE)

# Preventing issues with older cmake compilers (<3.7) which do not support VERSION_GREATER_EQUAL
# cmake vesrion 3.12.0 introduces COMPILE_LANGUAGE:FORTRAN, otherwise this would be >=2.8.12
# -Warith-conversion was added in gcc 10, add back in when the minimum becomes gcc 10.
if(NOT ${CMAKE_VERSION} VERSION_LESS "3.9.0")
SET(WB_COMPILER_OPTIONS_PRIVATE -pedantic -Wall -Wextra $<$<COMPILE_LANGUAGE:CXX>:-Wunused-variable -Wmissing-braces -Wunused-parameter -Wpointer-arith -Wwrite-strings -Wsynth -Wsign-compare -Woverloaded-virtual -Wno-placement-new -Wno-literal-suffix -Wno-parentheses -Wno-unused-local-typedefs -Wcast-qual -fstrict-aliasing -Wmaybe-uninitialized -Werror=maybe-uninitialized -Wparentheses -Wfloat-equal -Wundef -Wcast-align -Wlogical-op -Wmissing-declarations -Wredundant-decls -Wdiv-by-zero -Wdisabled-optimization -Wswitch-default -Wno-unused>)
SET(WB_COMPILER_OPTIONS_PRIVATE -pedantic -Wall -Wextra $<$<COMPILE_LANGUAGE:CXX>:-Wunused-variable -Wold-style-cast -Wconversion -Wsign-conversion -Wmissing-braces -Wunused-parameter -Wpointer-arith -Wwrite-strings -Wsynth -Wsign-compare -Woverloaded-virtual -Wno-placement-new -Wno-literal-suffix -Wno-parentheses -Wno-unused-local-typedefs -Wcast-qual -fstrict-aliasing -Wmaybe-uninitialized -Werror=maybe-uninitialized -Wparentheses -Wfloat-equal -Wundef -Wcast-align -Wlogical-op -Wmissing-declarations -Wredundant-decls -Wdiv-by-zero -Wdisabled-optimization -Wswitch-default -Wno-unused>)

if (${FORCE_COLORED_OUTPUT})
SET(WB_COMPILER_OPTIONS_PRIVATE -fdiagnostics-color=always ${WB_COMPILER_OPTIONS_PRIVATE})
endif()

else()
SET(WB_COMPILER_OPTIONS_PRIVATE "-pedantic -Wall -Wextra -Wunused-variable -Wmissing-braces -Wunused-parameter -Wpointer-arith -Wwrite-strings -Wsynth -Wsign-compare -Woverloaded-virtual -Wno-placement-new -Wno-literal-suffix -Wno-parentheses -Wno-unused-local-typedefs -Wcast-qual -fstrict-aliasing -Wmaybe-uninitialized -Werror=maybe-uninitialized -Wparentheses -Wfloat-equal -Wundef -Wcast-align -Wlogical-op -Wmissing-declarations -Wredundant-decls -Wdiv-by-zero -Wdisabled-optimization -Wswitch-default -Wno-unused>")
SET(WB_COMPILER_OPTIONS_PRIVATE "-pedantic -Wall -Wextra -Wold-style-cast -Wconversion -Wsign-conversion -Wunused-variable -Wmissing-braces -Wunused-parameter -Wpointer-arith -Wwrite-strings -Wsynth -Wsign-compare -Woverloaded-virtual -Wno-placement-new -Wno-literal-suffix -Wno-parentheses -Wno-unused-local-typedefs -Wcast-qual -fstrict-aliasing -Wmaybe-uninitialized -Werror=maybe-uninitialized -Wparentheses -Wfloat-equal -Wundef -Wcast-align -Wlogical-op -Wmissing-declarations -Wredundant-decls -Wdiv-by-zero -Wdisabled-optimization -Wswitch-default -Wno-unused>")

if (${FORCE_COLORED_OUTPUT})
SET(WB_COMPILER_OPTIONS_PRIVATE "-fdiagnostics-color=always ${WB_COMPILER_OPTIONS_PRIVATE}")
Expand Down Expand Up @@ -496,7 +497,7 @@ else()
endif()

if(${USE_MPI})
target_link_libraries (${WB_TARGET} PUBLIC MPI::MPI_CXX)
target_link_libraries (${WB_TARGET} PUBLIC MPI::MPI_CXX MPI::MPI_C)
endif()

if(WB_ENABLE_APPS)
Expand All @@ -506,7 +507,7 @@ if(WB_ENABLE_APPS)
set(_libs ${_libs} ${ZLIB_LIBRARIES})
endif()
if (USE_MPI)
set(_mpi_dep "PUBLIC MPI::MPI_CXX")
set(_mpi_dep "PUBLIC MPI::MPI_CXX MPI::MPI_C")
else()
set(_mpi_dep "")
endif()
Expand Down
32 changes: 16 additions & 16 deletions include/world_builder/bounding_box.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ namespace WorldBuilder
*
* @note The majority of this class is copied from the deal.II library.
*/
template <int spacedim>
template <unsigned int spacedim>
class BoundingBox
{
public:
Expand Down Expand Up @@ -270,7 +270,7 @@ namespace WorldBuilder



template <int spacedim>
template <unsigned int spacedim>
inline BoundingBox<spacedim>::BoundingBox(
const std::pair<Point<spacedim>, Point<spacedim>>
&boundary_points_)
Expand All @@ -286,7 +286,7 @@ namespace WorldBuilder



template <int spacedim>
template <unsigned int spacedim>
template <class Container>
inline BoundingBox<spacedim>::BoundingBox(const Container &points)
{
Expand Down Expand Up @@ -314,23 +314,23 @@ namespace WorldBuilder



template <int spacedim>
template <unsigned int spacedim>
inline std::pair<Point<spacedim>, Point<spacedim>> &BoundingBox<spacedim>::get_boundary_points()
{
return this->boundary_points;
}



template <int spacedim>
template <unsigned int spacedim>
inline const std::pair<Point<spacedim>, Point<spacedim>> &BoundingBox<spacedim>::get_boundary_points() const
{
return this->boundary_points;
}



template <int spacedim>
template <unsigned int spacedim>
inline bool
BoundingBox<spacedim>::
operator==(const BoundingBox<spacedim> &box) const
Expand All @@ -340,7 +340,7 @@ namespace WorldBuilder



template <int spacedim>
template <unsigned int spacedim>
inline bool
BoundingBox<spacedim>::
operator!=(const BoundingBox<spacedim> &box) const
Expand All @@ -350,7 +350,7 @@ namespace WorldBuilder



template <int spacedim>
template <unsigned int spacedim>
inline void
BoundingBox<spacedim>::extend(const double amount)
{
Expand All @@ -365,7 +365,7 @@ namespace WorldBuilder
}


template <int spacedim>
template <unsigned int spacedim>
inline
bool
BoundingBox<spacedim>::point_inside(const Point<spacedim> &point,
Expand Down Expand Up @@ -397,7 +397,7 @@ namespace WorldBuilder

}

template <int spacedim>
template <unsigned int spacedim>
inline
bool
BoundingBox<spacedim>::point_inside_implementation(const Point<spacedim> &p,
Expand Down Expand Up @@ -426,7 +426,7 @@ namespace WorldBuilder



template <int spacedim>
template <unsigned int spacedim>
inline
void
BoundingBox<spacedim>::merge_with(
Expand All @@ -445,7 +445,7 @@ namespace WorldBuilder



template <int spacedim>
template <unsigned int spacedim>
double
BoundingBox<spacedim>::volume() const
{
Expand All @@ -457,7 +457,7 @@ namespace WorldBuilder



template <int spacedim>
template <unsigned int spacedim>
inline
double
BoundingBox<spacedim>::lower_bound(const unsigned int direction) const
Expand All @@ -469,7 +469,7 @@ namespace WorldBuilder



template <int spacedim>
template <unsigned int spacedim>
inline
double
BoundingBox<spacedim>::upper_bound(const unsigned int direction) const
Expand All @@ -481,7 +481,7 @@ namespace WorldBuilder



template <int spacedim>
template <unsigned int spacedim>
Point<spacedim>
BoundingBox<spacedim>::center() const
{
Expand All @@ -494,7 +494,7 @@ namespace WorldBuilder



template <int spacedim>
template <unsigned int spacedim>
inline
double
BoundingBox<spacedim>::side_length(const unsigned int direction) const
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace WorldBuilder
{
class World;
class Parameters;
template <int dim> class Point;
template <unsigned int dim> class Point;

/**
* This class is an interface for the specific plate tectonic feature classes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace WorldBuilder
{
class World;
class Parameters;
template <int dim> class Point;
template <unsigned int dim> class Point;

/**
* This class is an interface for the specific plate tectonic feature classes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace WorldBuilder
{
class World;
class Parameters;
template <int dim> class Point;
template <unsigned int dim> class Point;

/**
* This class is an interface for the specific plate tectonic feature classes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace WorldBuilder
{
class World;
class Parameters;
template <int dim> class Point;
template <unsigned int dim> class Point;

/**
* This class is an interface for the specific plate tectonic feature classes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace WorldBuilder
{
class World;
class Parameters;
template <int dim> class Point;
template <unsigned int dim> class Point;

/**
* This class is an interface for the specific plate tectonic feature classes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace WorldBuilder
{
class World;
class Parameters;
template <int dim> class Point;
template <unsigned int dim> class Point;

/**
* This class is an interface for the specific plate tectonic feature classes,
Expand Down
Loading

0 comments on commit 0ddeefd

Please sign in to comment.