Skip to content

Commit

Permalink
attempt to fix macos ci
Browse files Browse the repository at this point in the history
  • Loading branch information
matekelemen committed Aug 6, 2024
1 parent 248fedc commit 02d259a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 23 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ jobs:
run: |
export cxx="$(brew --prefix llvm)/bin/clang++"
if [ "${{ matrix.sanitizer }}" = "none" ]; then
zsh build.sh -t "${{ matrix.type }}"
./build.sh -t "${{ matrix.type }}"
else
zsh build.sh -t "${{ matrix.type }}" -o "-DCMAKE_CXX_FLAGS=-fsanitize=${{ matrix.sanitizer }}"
./build.sh -t "${{ matrix.type }}" -o "-DCMAKE_CXX_FLAGS=-fsanitize=${{ matrix.sanitizer }}"
fi
- name: Run tests
run: |
git lfs install
git lfs pull
zsh test/testrunner.sh
./test/testrunner.sh
generate-docs:
runs-on: ubuntu-latest
Expand Down
37 changes: 22 additions & 15 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,25 +70,32 @@ while getopts ":h p t: j: b: i: o:" arg; do
done

case "$(uname -s)" in
Linux*)
;;
Darwin*)
# Set clang from homebrew
if ! command -v brew &> /dev/null; then
echo "Error: $scriptName requires Homebrew"
exit 1
if [ -z "$jobCount" ]; then
jobCount=$(sysctl -n machdep.cpu.thread_count)
fi

if ! brew list llvm >/dev/null 2>&1; then
echo "Error: missing dependency: llvm"
echo "Consider running 'brew install llvm'"
exit 1
fi
if [ -z "$cxx" ]; then
# Set clang from homebrew
if ! command -v brew &> /dev/null; then
echo "Error: $scriptName requires Homebrew"
exit 1
fi

jobCount=$(sysctl -n machdep.cpu.thread_count)
toolchainRoot="$(brew --prefix llvm)"
toolchainBin="${toolchainRoot}/bin"
toolchainLib="${toolchainRoot}/lib"
toolchainInclude="${toolchainRoot}/include"
export cxx="$toolchainBin/clang++"
if ! brew list llvm >/dev/null 2>&1; then
echo "Error: missing dependency: llvm"
echo "Consider running 'brew install llvm'"
exit 1
fi

toolchainRoot="$(brew --prefix llvm)"
toolchainBin="${toolchainRoot}/bin"
toolchainLib="${toolchainRoot}/lib"
toolchainInclude="${toolchainRoot}/include"
export cxx="$toolchainBin/clang++"
fi
;;
\?)
echo "Error: unsupported OS $(uname -s)"
Expand Down
10 changes: 5 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ Typical workflow
- construct and adaptor for $A$ (see [mcgs::CSRAdaptor](structmcgs_1_1CSRAdaptor.html))
- compute a coloring of $A$ (see [mcgs::color](namespacemcgs.html#ad660f970843b8c8edea18c6e9291f6e5))
- construct a partition of $A$ with respect to the coloring (see [mcgs::makePartition](namespacemcgs.html#adbeb4189f3eadcb713e803cf94aa38cf))
- reorder the system with respect to the coloring ([mcgs::reorder](namespacemcgs.html#a036dc0fa0b11d8adb71427d78ac7b7ad))
- perform Gauss-Seidel iterations **using the reordered partition** ([mcgs::solve](namespacemcgs.html#ae862fac411e001950f012872f6ac7e0c))
- *optional: restore the original order of your system* ([mcgs::revertReorder](namespacemcgs.html#aa1175b9934a8890204c6be445ea4407e))
- deallocate partitions ([destroyPartition](namespacemcgs.html#ad619ded9f67d8a9f379ad7e4b759d854))
- reorder the system with respect to the coloring (see [mcgs::reorder](namespacemcgs.html#a036dc0fa0b11d8adb71427d78ac7b7ad))
- perform Gauss-Seidel iterations **using the reordered partition** (see [mcgs::solve](namespacemcgs.html#ae862fac411e001950f012872f6ac7e0c))
- *optional: restore the original order of your system* (see [mcgs::revertReorder](namespacemcgs.html#aa1175b9934a8890204c6be445ea4407e))
- deallocate partitions (see [mcgs::destroyPartition](namespacemcgs.html#ad619ded9f67d8a9f379ad7e4b759d854))


### C++ Example Snippet
Expand Down Expand Up @@ -60,7 +60,7 @@ auto pReorderedPartition = mcgs::reorder(A.rows(), A.cols(), A.nonZeros(),
A.outerIndexPtr(), A.innerIndexPtr(), A.innerNonZeroPtr(),
b.data());

// Do Gauss-Seidel 10 iterations.
// Do 10 Gauss-Seidel iterations.
std::vector<double> x(adaptor.columnCount);
mcgs::SolveSettings</*index type=*/int, /*value type=*/double> settings;
settings.maxIterations = 10;
Expand Down

0 comments on commit 02d259a

Please sign in to comment.