Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge V2.4 into master #12

Merged
merged 36 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
2b183dc
Adding -Wshadow to debug builds on MacOS
mlstowell Mar 8, 2022
d89e982
Use platform-agnostic cmake build command
publixsubfan Apr 14, 2022
c89b79a
Use vcpkg platform cmake file; trying to fix unit tests
publixsubfan Apr 14, 2022
81e7dd3
Disable unit test builds on windows
publixsubfan Apr 14, 2022
3982fa0
Fix for multi-config builds i.e. visual studio projects
publixsubfan Apr 19, 2022
f250b1a
Reenable unit tests for windows
publixsubfan Apr 20, 2022
7d1658e
Use Invoke-WebRequest on Windows runners to get hypre, metis
publixsubfan Apr 27, 2022
8f149a4
Add required shell specifiers
publixsubfan Apr 27, 2022
7cb7cc5
Don't use double-quotes in step conditional
publixsubfan Apr 27, 2022
c3d94ee
Fix remove directory for powershell
publixsubfan Apr 27, 2022
41e82ae
Use cmake to build hypre
publixsubfan Apr 27, 2022
c198d5b
Fix cmakelists path for hypre
publixsubfan Apr 27, 2022
e717ca7
Fix path for hypre in makefile build
publixsubfan Apr 27, 2022
b92c830
Try to use vcpkg-installed metis for metis 5
publixsubfan Apr 28, 2022
291d70a
Set target triplet for mfem+vcpkg builds
publixsubfan Apr 28, 2022
2730abe
Build all targets in cmake build
publixsubfan Apr 28, 2022
69a2ab8
Add miniapps to all-build
publixsubfan Apr 28, 2022
bcc3be3
Add a library-only build to save space
publixsubfan Apr 28, 2022
0daa4e8
Only build unit tests when library-only mode disabled
publixsubfan Apr 28, 2022
dfc3948
Revert hypre/metis changes
publixsubfan Apr 29, 2022
d62466b
Check if hypre directory exists before creating symlink
publixsubfan Apr 29, 2022
af01ff8
Add action input for extra config options
publixsubfan Apr 30, 2022
d4c73a7
Install hypre to a prefix
publixsubfan Apr 30, 2022
dae499a
Readd cmake build for windows only
publixsubfan Apr 30, 2022
00174fe
Add build system parameter to build-hypre action
publixsubfan May 6, 2022
7e93080
Update build-mfem/action.yml
publixsubfan May 17, 2022
c205ed5
Merge pull request #6 from kanye-quest/master
tzanio May 18, 2022
0cc02d8
Switch to windows-latest
tzanio Aug 20, 2022
dad7528
Replace inputs.os == windows-2022 with runner.os == Windows
tzanio Aug 23, 2022
4add2cb
mfem-build: for Ubuntu + CMake use the MPI wrapper to avoid
v-dobrev Feb 23, 2023
da66e57
Workaround for GPG issue in codecov action
pazner May 11, 2023
9a8c85d
Use -Wshadow for opt builds
pazner May 11, 2023
c54111f
Try ignoring lcov errors
pazner Jun 20, 2023
e0cbc63
Try lcov '--keep-going' instead of '--ignore-errors inconsistent'
pazner Jun 20, 2023
3032f77
Use --keep-going with lcov version >= 2.0
pazner Jun 20, 2023
c787153
Merge pull request #8 from mfem/lcov-ignore-errors
pazner Jun 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 53 additions & 6 deletions build-hypre/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,33 @@ inputs:
description: 'A key to identify the desired hypre config (int32, int64)'
required: false
default: int32
build-system:
description: 'identify the build system to use (make,cmake)'
required: false
default: make

runs:
using: "composite"
steps:
- name: Install Hypre
- name: Get Hypre (Windows)
if: runner.os == 'Windows'
run: |
$URI_HYPRE = "${{ inputs.url }}/${{ inputs.archive }}"
Invoke-WebRequest -Uri $URI_HYPRE -OutFile ${{ inputs.archive }}
Remove-Item ${{ inputs.dir }} -Force -Recurse -ErrorAction Ignore;
tar -xzf ${{ inputs.archive }};
shell: pwsh

- name: Get Hypre (Linux/macOS)
if: runner.os != 'Windows'
run: |
wget --no-verbose ${{ inputs.url }}/${{ inputs.archive }};
rm -rf ${{ inputs.dir }};
tar -xzf ${{ inputs.archive }};
shell: bash

- name: Install Hypre (make)
if: inputs.build-system == 'make'
run: |
echo "Map target to options"
if [[ "${{ inputs.target }}" == "int32" ]]
Expand All @@ -44,11 +66,36 @@ runs:
exit 1;
fi
echo "Installing Hypre"
wget --no-verbose ${{ inputs.url }}/${{ inputs.archive }};
rm -rf ${{ inputs.dir }};
tar -xzf ${{ inputs.archive }};
cd ${{ inputs.dir }}/src;
./configure ${hypre_options} CC=mpicc CXX=mpic++;
cd ${{ inputs.dir }};
install_prefix="$(pwd)/install";
cd src;
./configure --prefix=${install_prefix} ${hypre_options} CC=mpicc CXX=mpic++;
make -j3;
make install;
cd ../..;
shell: bash

- name: Install Hypre (cmake)
if: inputs.build-system == 'cmake'
run: |
echo "Map target to options"
if [[ "${{ inputs.target }}" == "int32" ]]
then
export hypre_options="";
elif [[ "${{ inputs.target }}" == "int64" ]]
then
export hypre_options="-DHYPRE_ENABLE_BIGINT=ON";
else
echo "Hypre target not recognized";
exit 1;
fi
echo "Installing Hypre"
cd ${{ inputs.dir }};
cmake -Hsrc -Bbuild \
${hypre_options} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=install
cmake --build build --config Release --parallel 3
cmake --install build --config Release
cd ../..;
shell: bash
62 changes: 51 additions & 11 deletions build-mfem/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ inputs:
description: 'identify the build system to use (make,cmake)'
required: false
default: make
library-only:
description: 'only build the mfem library, without examples/tests/miniapps'
required: false
default: 'false'
config-options:
description: 'extra options to pass to build configuration'
required: false
default: ''

runs:
using: "composite"
Expand All @@ -73,10 +81,15 @@ runs:
MPI="NO"
if [[ ${{ inputs.mpi }} == 'par' ]]; then
MPI="YES"
echo "[INFO] Hypre symlink: hypre -> ${{ inputs.hypre-dir }}"
ln -s -f ${{ inputs.hypre-dir }} hypre;
echo "[INFO] Metis symlink: metis -> ${{ inputs.metis-dir }}"
ln -s -f ${{ inputs.metis-dir }} metis-4.0;
# If the directory does not exist, we assume it was installed elsewhere and don’t create the link
if [[ -d ${{ inputs.hypre-dir }} ]]; then
ln -s -f ${{ inputs.hypre-dir }} hypre;
echo "[INFO] Hypre symlink: hypre -> ${{ inputs.hypre-dir }}"
fi
if [[ -d ${{ inputs.metis-dir }} ]]; then
ln -s -f ${{ inputs.metis-dir }} metis-4.0;
echo "[INFO] Metis symlink: metis -> ${{ inputs.metis-dir }}"
fi
fi
echo "[STATUS] MPI: ${MPI}"
CPPFLAGS=""
Expand All @@ -90,6 +103,9 @@ runs:
${{ inputs.target }} == 'dbg' ]]; then
CPPFLAGS+=" -pedantic -Wall -Werror";
fi
if [[ ${{ runner.os }} != 'Linux' ]]; then
CPPFLAGS+=" -Wshadow";
fi
echo "[STATUS] DEBUG: ${DEBUG}"
echo "[STATUS] BUILD_TYPE: ${BUILD_TYPE}"
if [[ ${{ inputs.codecov }} == 'YES' ]]; then
Expand All @@ -100,30 +116,54 @@ runs:
echo "--- Configure mfem ---"
cd ${{ inputs.mfem-dir }};
if [[ ${{ inputs.build-system }} == 'cmake' ]]; then
if [[ ${{ runner.os }} == "Windows" ]]; then
toolchain_file="${VCPKG_INSTALLATION_ROOT}\\scripts\\buildsystems\\vcpkg.cmake"
vcpkg_triplet="x64-windows-static"
fi
# Use the MPI wrapper on Ubuntu (at least on v22.04) to avoid slow
# linking times due to LTO compile flags.
USE_MPI_WRAPPER="-DMPICXX=mpicxx"
[[ ${{ runner.os }} != 'Linux' ]] && USE_MPI_WRAPPER=""
mkdir build && cd build;
cmake \
-D CMAKE_TOOLCHAIN_FILE:STRING=${toolchain_file} \
-D VCPKG_TARGET_TRIPLET=${vcpkg_triplet} \
-D CMAKE_BUILD_TYPE=${BUILD_TYPE} \
-D MFEM_USE_MPI=${MPI} \
-D MFEM_MPI_NP=2 \
-D HYPRE_DIR=../../hypre/src/hypre \
-D HYPRE_DIR=../../hypre/install \
${USE_MPI_WRAPPER} \
${{ inputs.config-options }} \
..
else
make config MFEM_USE_MPI=${MPI} MFEM_MPI_NP=2 MFEM_DEBUG=${DEBUG} CPPFLAGS="${CPPFLAGS}";
make config \
MFEM_USE_MPI=${MPI} \
MFEM_MPI_NP=2 \
MFEM_DEBUG=${DEBUG} \
CPPFLAGS="${CPPFLAGS}" \
HYPRE_DIR=@MFEM_DIR@/../hypre/install \
${{ inputs.config-options }}
fi
shell: bash

- name: build mfem
run: |
echo "------------------"
echo "--- Build mfem ---"
BUILD_TYPE="Release"
[[ ${{ inputs.target }} == 'dbg' ]] && BUILD_TYPE="Debug";
cd ${{ inputs.mfem-dir }}
if [[ ${{ inputs.build-system }} == 'cmake' ]]; then
CMAKE_TARGET="exec"
[[ ${{ inputs.library-only }} == 'true' ]] && CMAKE_TARGET="mfem";
cd build
make -j3 mfem examples
cd tests/unit
make -j3
cmake --build . --parallel 3 --target ${CMAKE_TARGET} --config "${BUILD_TYPE}"
if [[ ${{ inputs.library-only }} == 'false' ]]; then
cmake --build tests/unit --parallel 3 --config "${BUILD_TYPE}"
fi
else
make all -j3
MAKE_TARGET="all"
[[ ${{ inputs.library-only }} == 'true' ]] && MAKE_TARGET="";
make ${MAKE_TARGET} -j3
fi
shell: bash

17 changes: 13 additions & 4 deletions upload-coverage/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,29 @@ runs:
- run: |
cd ${{ inputs.project_dir }}
# Restrict search to directories listed, if any.
directory_list="${{ inputs.directories }}";
dirs_opts="";
directory_list="${{ inputs.directories }}"
dirs_opts=""
if [[ -n "${directory_list}" ]]; then
for dir in ${directory_list}; do dirs_opts+=" --directory=${dir}"; done
fi
keep_going_flag=""
if [[ "$(lcov --version)" =~ "lcov: LCOV version 2" ]]; then
keep_going_flag="--keep-going"
fi
# Generate the coverage report.
lcov --no-external --gcov-tool gcov ${dirs_opts} --capture --output-file lcov.info;
lcov ${keep_going_flag} --no-external --gcov-tool gcov ${dirs_opts} --capture --output-file lcov.info
# The variable $RUNNER_OS should be either "Linux" or "macOS"
os_lowercase=$(echo $RUNNER_OS | awk '{print tolower($0)}')
# The prefix will end with "linux" or "macos" depending on the runner OS
prefix="https://uploader.codecov.io/latest/$os_lowercase"
curl -Os "$prefix/codecov"
# Workaround for GPG issue: need to create the GNUPGHOME (with proper
# permissions) otherwise the trustedkeys file is not created.
export GNUPGHOME="$HOME/gnupg"
mkdir "$GNUPGHOME"
chmod 700 "$GNUPGHOME"
# Check integrity of the binary uploader (cf. https://docs.codecov.com/docs/codecov-uploader#integrity-checking-the-uploader)
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import # One-time step
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.kbx --import # One-time step
curl -Os "$prefix/codecov.SHA256SUM"
curl -Os "$prefix/codecov.SHA256SUM.sig"
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
Expand Down