Skip to content

Commit

Permalink
Merge pull request #20 from DARMA-tasking/19-update-spack-to-look-for…
Browse files Browse the repository at this point in the history
…-magistrate

#19: Update spack to look for magistrate
  • Loading branch information
lifflander authored Jul 16, 2024
2 parents 8aa89a2 + e57e8ac commit b167719
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 76 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/test_spack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test spack package

on: pull_request

jobs:
run-script:
runs-on: ubuntu-latest
container:
image: lifflander1/vt:amd64-ubuntu-20.04-gcc-10-gcc-10-openmpi-cpp
env:
VT_LB_ENABLED: 0
VT_TRACE_ENABLED: 0
VT_BUILD_TRACE_ONLY: 1
VT_DOXYGEN_ENABLED: 0
VT_MIMALLOC_ENABLED: 0
VT_DOCS_ENABLED: 0
VT_ASAN_ENABLED: 0
VT_WERROR_ENABLED: 1
VT_POOL_ENABLED: 1
VT_ZOLTAN_ENABLED: 0
VT_MPI_GUARD_ENABLED: 0
VT_DIAGNOSTICS_ENABLED: 1
VT_DIAGNOSTICS_RUNTIME_ENABLED: 0
VT_UNITY_BUILD_ENABLED: 1
VT_FCONTEXT_ENABLED: 0

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run test script
run: |
chmod +x ci/test_spack.sh
ci/test_spack.sh ${{ github.head_ref }}
61 changes: 61 additions & 0 deletions ci/test_spack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/usr/bin/env bash

cur_path=$(pwd)
spack_path="$cur_path/spack"
vt_spack_package="$cur_path/spack-package"

branch_name=${1:-master}
git clone https://github.com/spack/spack.git
git clone -b "$branch_name" https://github.com/DARMA-tasking/spack-package.git

cd "$spack_path" || exit 1
git checkout v0.16.3
cd "$cur_path" || exit 1

declare -A variables_map
variables_map["lb_enabled"]="${VT_LB_ENABLED:-0}"
variables_map["trace_enabled"]="${VT_TRACE_ENABLED:-0}"
variables_map["trace_only"]="${VT_BUILD_TRACE_ONLY:-0}"
variables_map["doxygen_enabled"]="${VT_DOXYGEN_ENABLED:-0}"
variables_map["mimalloc_enabled"]="${VT_MIMALLOC_ENABLED:-0}"
variables_map["asan_enabled"]="${VT_ASAN_ENABLED:-0}"
variables_map["werror_enabled"]="${VT_WERROR_ENABLED:-0}"
variables_map["pool_enabled"]="${VT_POOL_ENABLED:-0}"
variables_map["zoltan_enabled"]="${VT_ZOLTAN_ENABLED:-0}"
variables_map["mpi_guards"]="${VT_MPI_GUARD_ENABLED:-0}"
variables_map["diagnostics_enabled"]="${VT_DIAGNOSTICS_ENABLED:-0}"
variables_map["diagnostics_runtime_enabled"]="${VT_DIAGNOSTICS_RUNTIME_ENABLED:-0}"
variables_map["unity_build_enabled"]="${VT_UNITY_BUILD_ENABLED:-0}"
variables_map["fcontext_enabled"]="${VT_FCONTEXT_ENABLED:-0}"

cmd_vars=()
for flag in "${!variables_map[@]}"
do
flag_var=${variables_map[${flag}]}
if test "$flag_var" -eq 0
then
cmd_vars+=("-$flag")
else
cmd_vars+=("+$flag")
fi
done

install_cmd=$(printf " %s" "${cmd_vars[@]}")
install_cmd="$spack_path/bin/spack install darma-vt@develop build_type=Release ${install_cmd:1}"

"$spack_path"/bin/spack repo add "$vt_spack_package"
"$spack_path"/bin/spack external find
$install_cmd

git clone https://github.com/DARMA-tasking/vt-sample-project
mkdir -p vt-sample-project/build
cd vt-sample-project/build || exit 1
vt_DIR=$("$spack_path"/bin/spack location --install-dir darma-vt)
export vt_DIR
cmake -G "${CMAKE_GENERATOR:-Ninja}" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER="${CXX:-c++}" \
-DCMAKE_C_COMPILER="${CC:-cc}" \
-Dbuild_with_libs=1 \
..
cmake --build .
60 changes: 0 additions & 60 deletions packages/darma-detector/package.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,15 @@
from spack import *


class DarmaCheckpoint(CMakePackage):
class DarmaMagistrate(CMakePackage):
"""Serialization and checkpointing library"""

homepage = "https://github.com/DARMA-tasking/checkpoint"
git = "https://github.com/DARMA-tasking/checkpoint.git"
homepage = "https://github.com/DARMA-tasking/magistrate"
git = "https://github.com/DARMA-tasking/magistrate.git"

version("develop", branch="develop")

depends_on("darma-detector")

sanity_check_is_dir = ["include/checkpoint"]
sanity_check_is_file = ["cmake/checkpointConfig.cmake"]
sanity_check_is_file = ["cmake/checkpointTargets.cmake"]
sanity_check_is_file = ["lib/libcheckpoint.a"]

def cmake_args(self):
args = ["-Ddetector_DIR={}".format(self.spec["darma-detector"].prefix)]
return args
sanity_check_is_file = ["cmake/magistrateConfig.cmake"]
sanity_check_is_file = ["cmake/magistrateTargets.cmake"]
sanity_check_is_file = ["lib/libmagistrate.a"]
6 changes: 2 additions & 4 deletions packages/darma-vt/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,14 @@ class DarmaVt(CMakePackage):
variant("build_examples", default=False, description="Build all VT examples")

depends_on("mpi")
depends_on("darma-detector")
depends_on("darma-checkpoint")
depends_on("darma-magistrate")

sanity_check_is_dir = ["include/vt"]
sanity_check_is_file = ["cmake/vtConfig.cmake", "cmake/vtTargets.cmake"]

def cmake_args(self):
args = [
"-Ddetector_DIR={}".format(self.spec["darma-detector"].prefix),
"-Dcheckpoint_DIR={}".format(self.spec["darma-checkpoint"].prefix),
"-Dmagistrate_ROOT={}".format(self.spec["darma-magistrate"].prefix),
"-Dvt_lb_enabled={}".format(int(self.spec.variants["lb_enabled"].value)),
"-Dvt_trace_enabled={}".format(
int(self.spec.variants["trace_enabled"].value)
Expand Down

0 comments on commit b167719

Please sign in to comment.