Add Linux build support (development)#1
Open
pskeshu wants to merge 1 commit into
Open
Conversation
Make the CMake build cross-platform so ScopeOne builds and runs on Linux (demo camera), while leaving the Windows build path unchanged. All platform-specific logic is guarded behind if(WIN32)/else(). - ScopeOneCore/CMakeLists.txt: Linux branch uses system Qt6, OpenCV (core+imgproc only, avoiding the viz/VTK chain), TIFF and ZLIB via find_package, and links MMCore as an imported static library built from mmCoreAndDevices. - CMakeLists.txt: guard the hardcoded Windows Qt prefix path. - RecordingManager.cpp: give TiffOptions an explicit constructor instead of default member initializers (GCC rejects the brace-default argument). - ScopeOneLocalApiServer.cpp: guard the Win32 CreateFileMapping/ MapViewOfFile frame export behind _WIN32; the local API socket still works on Linux (zero-copy frame export is a follow-up).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
I came across ScopeOne, and out of curiosity tried building it on Linux. Beyond
the curiosity, cross-platform builds make a project meaningfully easier to
develop on and contribute to — even if production stays on Windows. The
encouraging part is that the hard work is already done: the multi-process core is
built on Qt's cross-platform primitives (
QProcess,QSharedMemory,QLocalServer), so very little of the runtime is actually Windows-specific. Thegap was mostly the build system plus a couple of small spots.
This PR makes ScopeOne build and run on Linux with the demo camera, while
leaving the Windows build path untouched.
What's in this PR (4 files, +74/−39)
Everything platform-specific is guarded behind
if(WIN32)/else()so the Windowsbuild is unchanged:
ScopeOneCore/CMakeLists.txt— Linux branch resolves deps viafind_package(system Qt6, OpenCV [core+imgproconly, to avoid theviz→VTK chain], TIFF, ZLIB) and links MMCore as an imported static librarybuilt from
mmCoreAndDevices.CMakeLists.txt— guard the hardcodedC:/Qt/...prefix so it'sWindows-only.
ScopeOneCore/src/RecordingManager.cpp— giveSaveBackend::TiffOptionsan explicit constructor instead of default member initializers; GCC rejects
= {}as a default argument for the nested aggregate (MSVC accepts it).Behavior unchanged.
src/ScopeOneLocalApiServer.cpp— guard the Win32CreateFileMapping/MapViewOfFileframe export behind#if defined(_WIN32).The local API socket server still runs on Linux; only the zero-copy shared-frame
export is disabled for now (see follow-ups).
Building the Micro-Manager dependency
I built only the minimal pieces from
mmCoreAndDevices(no vendor adapters) viathe standard autotools path:
This yields
libMMCore.a,libMMDevice.a, andlibmmgr_dal_DemoCamera.so.0(no boost or swig required). Then the usual ScopeOne build, pointing the core
CMake at that checkout via
external/mmCoreAndDevices.Verification
config/MMConfig_demo.cfgandsnapImage()returns a 512×512 16-bit frame.
preserve it, but someone with a Windows setup should confirm.
Scope / non-goals
expected for Micro-Manager.
Known follow-ups (happy to do these if useful)
AgentProtocol.hhardcodesScopeOne_Agent.exe; needs a platform-aware name on Linux. The single-camerademo uses the native path and is unaffected.
shm_open/mmap(orQSharedMemory) so external clients get zero-copy frameson Linux too.
.sonext to the binary inCMake instead of copying it manually.
Questions for maintainers
now?
mmCoreAndDevicesdependency wired on Linux(find-or-fetch in CMake, documented manual build, submodule)? I followed the
existing
external/layout but kept it flexible.Thanks for open-sourcing this — it's a clean codebase to work in.