Fix makefile for viwer

This commit is contained in:
sandst_a committed 2026-10-23 10:51:22 +02:00
1 parent ad54112135
commit 93004154ff
3 files changed
+28 -1

No files matched your search

+18
View File
@@ -18,6 +18,24 @@ IOC_QT_PANEL := qt/$(IOC_NAME)_cpp_logic.ui
IOC_QTGEN := $(CPP_LOGIC_ROOT)/utils/cpp_logic_ioc_qtgen.py
IOC_SUBS_FILE := cfg/libmain.so_cpp_logic.subs
# Python's ctypes library is built locally, independently of the IOC module.
CXX ?= c++
VIEWER_CXXFLAGS ?= -O2 -std=c++17 -Wall -Wextra -pedantic
ifeq ($(shell uname -s),Darwin)
VIEWER_LIBRARY := build/libhexapod.dylib
VIEWER_SHARED := -dynamiclib
else
VIEWER_LIBRARY := build/libhexapod.so
VIEWER_SHARED := -shared
endif
.PHONY: viewer-lib
viewer-lib: $(VIEWER_LIBRARY)
$(VIEWER_LIBRARY): src/c_api.cpp src/kinematics.hpp
mkdir -p $(@D)
$(CXX) $(VIEWER_CXXFLAGS) -fPIC $(VIEWER_SHARED) -o $@ src/c_api.cpp
.PHONY: pvs ui
pvs:
+9
View File
@@ -357,6 +357,15 @@ The quintic profile in the offline viewer is not an IOC trajectory generator.
## EPICS viewer
Build the viewer's local C API library separately from the IOC's `libmain.so`:
```sh
make viewer-lib
```
This creates `build/libhexapod.so` (`.dylib` on macOS) from `src/c_api.cpp`
without EPICS dependencies. Rebuild it after changing the kinematics code.
For a running IOC, install the IOC viewer requirements and use the IOC record
prefix, including the trailing colon:
+1 -1
View File
@@ -18,7 +18,7 @@ class Model:
candidates = [ROOT / 'build' / ('libhexapod.' + ext) for ext in ('so', 'dylib')]
path = next((p for p in candidates if p.exists()), None)
if path is None:
raise RuntimeError('Build the C++ library first: make')
raise RuntimeError('Build the viewer C++ library first: make viewer-lib')
self.lib = ct.CDLL(str(path))
pointer = ct.POINTER(ct.c_double)
self.lib.hex_inverse.argtypes = [pointer] * 4