From 458015aa90509e4515202c5f15ac76d900b52ef2 Mon Sep 17 00:00:00 2001 From: Mike Langmayr Date: Tue, 3 Nov 2026 14:19:49 -0800 Subject: [PATCH] Find ImageStreamIO in /usr/local/lib/cmake without ImageStreamIO_DIR --- .github/workflows/emulator-integration.yml | 2 +- README.md | 6 +++--- docs/configuration/index.md | 2 +- utils/CMakeLists.txt | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/emulator-integration.yml b/.github/workflows/emulator-integration.yml index a82c142..a5582a0 100644 --- a/.github/workflows/emulator-integration.yml +++ b/.github/workflows/emulator-integration.yml @@ -49,7 +49,7 @@ jobs: mkdir -p ${{github.workspace}}/build cd ${{github.workspace}}/build cmake -DCONTROLLER=archon \ - -DENABLE_SHM_OUTPUT=ON -DImageStreamIO_DIR=/usr/local/lib/cmake \ + -DENABLE_SHM_OUTPUT=ON \ -DBUILD_PYTHON_MODULE=ON .. make -j$(nproc) diff --git a/README.md b/README.md index 7a3fdca..c6cf3e1 100644 --- a/README.md +++ b/README.md @@ -50,10 +50,10 @@ If you encounter any problems or have questions about this project, please open `-DINTERFACE_TYPE=` is separate from `-DCONTROLLER=` and selects only which emulator is built. It defaults to `Archon`; `-DINTERFACE_TYPE=AstroCam` skips the emulator, since none is implemented for ARC. - To enable the shared-memory output (`SHM_ENABLED` in a `.cfg` file, see [Frame Outputs](#frame-outputs) below), add `-DENABLE_SHM_OUTPUT=ON -DImageStreamIO_DIR=/lib/cmake`: + To enable the shared-memory output (`SHM_ENABLED` in a `.cfg` file, see [Frame Outputs](#frame-outputs) below), add `-DENABLE_SHM_OUTPUT=ON`: ```bash - $ cmake -DENABLE_SHM_OUTPUT=ON -DImageStreamIO_DIR=/usr/local/lib/cmake .. + $ cmake -DENABLE_SHM_OUTPUT=ON .. ``` This requires [ImageStreamIO](https://github.com/milk-org/ImageStreamIO) to already be built and installed, since it isn't packaged for common distros: @@ -66,7 +66,7 @@ If you encounter any problems or have questions about this project, please open $ sudo make install ``` - ImageStreamIO's own `Config.cmake` files install directly under `/lib/cmake/` rather than the CMake-conventional `/lib/cmake/ImageStreamIO/`, so `-DImageStreamIO_DIR=...` must always be given explicitly, even for a standard system-wide install. + ImageStreamIO's `Config.cmake` files install directly under `/lib/cmake/` rather than the conventional `/lib/cmake/ImageStreamIO/`. The build looks in `/usr/local/lib/cmake`, where the steps above put them; for any other prefix, pass `-DImageStreamIO_DIR=/lib/cmake`. To build the Python module (see [Python Module](#python-module) below), add `-DBUILD_PYTHON_MODULE=ON`. It is off by default, so builds that don't want it never need pybind11. To install it into an environment rather than build it here, see [Installing with pip](#installing-with-pip) instead, which fetches pybind11 itself: diff --git a/docs/configuration/index.md b/docs/configuration/index.md index d0e2e5b..4b4f73f 100644 --- a/docs/configuration/index.md +++ b/docs/configuration/index.md @@ -48,7 +48,7 @@ These are CMake options, fixed when the software is compiled, not `.cfg` keys. |---|---|---| | `CONTROLLER` | none, required | `archon` or `astrocam`. CMake errors out if unset. | | `INTERFACE_TYPE` | `Archon` | Selects which emulator is built, independently of `CONTROLLER`. `AstroCam` builds none, since none exists for ARC. | -| `ENABLE_SHM_OUTPUT` | `OFF` | Build the ImageStreamIO shared-memory output. Also needs `-DImageStreamIO_DIR=/lib/cmake`. | +| `ENABLE_SHM_OUTPUT` | `OFF` | Build the ImageStreamIO shared-memory output. Found in `/usr/local/lib/cmake`; `-DImageStreamIO_DIR=/lib/cmake` for another prefix. | | `BUILD_PYTHON_MODULE` | `OFF` | Build the `camera_interface` Python module. Needs pybind11 at compile time only. | | `CMAKE_INSTALL_PREFIX` | `/usr/local` | Where `make install` puts binaries and the module | diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index fe1ba83..4d74da7 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -24,7 +24,8 @@ add_library(network STATIC target_link_libraries(network nlohmann_json::nlohmann_json) if(ENABLE_SHM_OUTPUT) - find_package(ImageStreamIO CONFIG REQUIRED) + # Upstream installs its config directly in /lib/cmake, which find_package does not search + find_package(ImageStreamIO CONFIG REQUIRED PATHS /usr/local/lib/cmake) add_library(shared_memory_writer STATIC ${PROJECT_UTILS_DIR}/shared_memory_writer.cpp