Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
openmpi-bin \
libboost-dev \
libboost-test-dev \
libhwloc-dev \
libmsgpack-cxx-dev \
libopenmpi-dev \
&& apt-get autoremove -y \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Install dependencies from APT
run: |
sudo apt-get update
sudo apt-get install -y just libopenmpi-dev openmpi-bin libboost-dev libboost-test-dev libmsgpack-cxx-dev
sudo apt-get install -y just libopenmpi-dev openmpi-bin libboost-dev libboost-test-dev libmsgpack-cxx-dev libhwloc-dev

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v9.0.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docpages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Install dependencies from APT
run: |
sudo apt-get update
sudo apt-get install -y just libopenmpi-dev openmpi-bin libboost-dev libboost-test-dev libmsgpack-cxx-dev
sudo apt-get install -y just libopenmpi-dev openmpi-bin libboost-dev libboost-test-dev libmsgpack-cxx-dev libhwloc-dev

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v9.0.0
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/qa-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libopenmpi-dev openmpi-bin libboost-dev libboost-test-dev libmsgpack-cxx-dev
sudo apt-get install -y libopenmpi-dev openmpi-bin libboost-dev libboost-test-dev libmsgpack-cxx-dev libhwloc-dev

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v9.0.0
Expand Down Expand Up @@ -157,7 +157,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libopenmpi-dev openmpi-bin libboost-dev
sudo apt-get install -y libopenmpi-dev openmpi-bin libboost-dev libhwloc-dev

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v9.0.0
Expand Down Expand Up @@ -205,7 +205,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libopenmpi-dev openmpi-bin libboost-dev
sudo apt-get install -y libopenmpi-dev openmpi-bin libboost-dev libhwloc-dev

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v9.0.0
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ jobs:
- name: Install dependencies
run: |
if [[ "${{ matrix.runner }}" == "macos-15" ]]; then
brew install boost open-mpi msgpack-cxx
brew install boost open-mpi msgpack-cxx hwloc
else
sudo apt-get update
packages="libopenmpi-dev openmpi-bin libboost-dev libboost-test-dev libmsgpack-cxx-dev"
packages="libopenmpi-dev openmpi-bin libboost-dev libboost-test-dev libmsgpack-cxx-dev libhwloc-dev"
if [[ "${{ matrix.compiler }}" == "clang++-18" ]]; then
packages="$packages clang-18"
fi
Expand Down
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ mp = MajoranaPropagator(operator, initial_state, cutoff=4)
- **uv**: Package management
- **Boost**: Used for various utilities (unordered_map, unit tests)
- **msgpack**: Serialization of the test-data fixtures only (`tests/data/*.msgpack`); consumed by the Python test loaders and the C++ test suite, not by the shipped library
- **hwloc**: CPU topology discovery and thread binding for partition placement (`CpuTopology.cpp`). Required system library (`libhwloc-dev` on Debian/Ubuntu, `hwloc` on Homebrew). Requires `pkg-config` so CMake can locate `hwloc`. Bundled into wheels automatically by auditwheel/delocate.
- **MPI**: For distributed parallelization

## Common Tasks
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ ctest --test-dir build/editable/Release

Full instructions — prerequisites, MPI options, and running the example
executable — are in the [building guide](https://docs.algorithmiq.fi/monoprop/docs/building).
In particular, from-source builds require `hwloc` and `pkg-config` so CMake can
locate `hwloc`.

## Running the tests

Expand Down
11 changes: 11 additions & 0 deletions cpp/monoprop/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
find_package(Boost 1.85 CONFIG REQUIRED)
message(STATUS "Using Boost: ${Boost_DIR} (version ${Boost_VERSION})")

find_package(PkgConfig REQUIRED QUIET)
pkg_check_modules(HWLOC REQUIRED QUIET IMPORTED_TARGET GLOBAL "hwloc>=2.9")
message(
STATUS
"Using hwloc: ${HWLOC_LINK_LIBRARIES} (version ${HWLOC_VERSION})"
)

target_sources(
monoprop-objs
PRIVATE
Expand Down Expand Up @@ -43,6 +50,8 @@ target_link_libraries(
Boost::boost
Threads::Threads
$<$<TARGET_EXISTS:MPI::MPI_CXX>:MPI::MPI_CXX>
PRIVATE
PkgConfig::HWLOC
)

set_target_properties(
Expand Down Expand Up @@ -97,6 +106,8 @@ target_link_libraries(
Boost::boost
Threads::Threads
$<$<TARGET_EXISTS:MPI::MPI_CXX>:MPI::MPI_CXX>
PRIVATE
PkgConfig::HWLOC
)

add_subdirectory(algebra)
Expand Down
Loading
Loading