Make install/compile scripts run on non-Windows#4
Open
tabedzki wants to merge 1 commit into
Open
Conversation
The install and compile scripts assumed a Windows + MSVC environment and the Java/Swing MATLAB runtime, so they failed on macOS/Linux. Make them portable without changing Windows behaviour: - compile_transformations: on macOS, link the optional C++ MEX export symbols with the classic linker (-ld_classic); newer Xcode linkers treat MATLAB's <initial-undefines> as hard errors otherwise. - install_virmen: only copy git-hooks when the directory exists, write version.txt relative to the repo (the old $GIT_DIR path is unset when run interactively), guard the Windows-only winmerge call behind ispc, and report errors via getReport (displayException did not exist). - compile_serialcomm: skip on non-Windows -- Serial.cpp uses the Win32 COM-port API and cannot build elsewhere. - calibrateBallMEX, calibrateBallMEX_2sensors: replace the Java java.lang.Thread.sleep(8) with pause(0.008), which does not depend on the removed MATLAB Java runtime. Assisted-by: ClaudeCode:claude-opus-4.8
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.
🤖 AI text below 🤖
Summary
ViRMEn's install/compile scripts assumed a Windows + MSVC toolchain and the (now-removed) MATLAB Java runtime, so they errored out on macOS/Linux. This PR makes them portable without changing Windows behavior — Windows still takes the exact same code paths it did before.
Changes
compile_transformations.m— on macOS, link the optional C++ MEX export symbols with the classic linker (-Wl,-ld_classic). Newer Xcode linkers treat MATLAB's<initial-undefines>(_mexCreateMexFunction, etc.) as hard errors; the classic linker treats them as optional, which is what MATLAB expects.install_virmen.mgit-hooks/when that directory exists.version.txtrelative to the repo — the old\$GIT_DIR/../version.txtpath is unset when the script is run interactively from MATLAB.winmergeinvocation behindispc.getReport(err)(the previously-calleddisplayExceptiondoes not exist in this repo).compile_serialcomm.m— skip on non-Windows;Serial.cppuses the Win32 COM-port API (windows.h,crtdbg.h,tchar.h) and cannot build elsewhere.calibrateBallMEX.m/calibrateBallMEX_2sensors.m— replacejava.lang.Thread.sleep(8)withpause(0.008), which doesn't depend on the removed MATLAB Java runtime.Testing
On MATLAB R2024a (macOS),
install_virmennow runs to completion:transformToroidalParametrizedMexandminiVR_projection_wparameterscompile (the latter via the classic-linker path), and the Windows-only serial/NI-DAQ steps are skipped with a clear warning instead of erroring.Notes
.mexmaci64binaries are intentionally not included here — they're build artifacts, and this PR is about the build scripts. Each developer regenerates them by runninginstall_virmenon their platform.uisplittoolGUI rework); both branch frommaster.