Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ff5143d
Merge pull request #4 from mfem/v2.0
tzanio Dec 2, 2021
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
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
53 changes: 43 additions & 10 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 @@ -100,30 +113,50 @@ runs:
echo "--- Configure mfem ---"
cd ${{ inputs.mfem-dir }};
if [[ ${{ inputs.build-system }} == 'cmake' ]]; then
if [[ ${{ inputs.os }} == "windows-2022" ]]; then
toolchain_file="${VCPKG_INSTALLATION_ROOT}\\scripts\\buildsystems\\vcpkg.cmake"
vcpkg_triplet="x64-windows-static"
fi
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 \
${{ 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