-
Notifications
You must be signed in to change notification settings - Fork 2
Add pantor/ruckig LLAR Formula (v0.17.3) #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
fennoai
wants to merge
1
commit into
main
Choose a base branch
from
fennoai/issue-20-1785407796
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| compareVer (a, b) => { | ||
| // ruckig publishes semver tags like "v0.17.3". | ||
| return semver.compare(a.Version, b.Version) | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| import "os" | ||
|
|
||
| id "pantor/ruckig" | ||
|
|
||
| fromVer "v0.17.3" | ||
|
|
||
| onBuild ctx => { | ||
| installDir := ctx.outputDir | ||
|
|
||
| c := cmake.new(ctx.SourceDir, ctx.SourceDir+"/_build", installDir) | ||
| c.buildType "Release" | ||
|
|
||
| // ruckig is a C++20 CMake library. Build only the core static library: | ||
| // disable the examples, unit tests, the nanobind Python wrapper and the | ||
| // (network) cloud client, matching the community package interface. The | ||
| // cloud client would otherwise inject vendored third_party headers and a | ||
| // WITH_CLOUD_CLIENT define that are not part of the core install. | ||
| c.defineBool "BUILD_SHARED_LIBS", false | ||
| c.defineBool "CMAKE_POSITION_INDEPENDENT_CODE", true | ||
| c.defineBool "BUILD_EXAMPLES", false | ||
| c.defineBool "BUILD_TESTS", false | ||
| c.defineBool "BUILD_PYTHON_MODULE", false | ||
| c.defineBool "BUILD_CLOUD_CLIENT", false | ||
|
|
||
| c.configure | ||
| c.build | ||
| c.install | ||
|
|
||
| // Consumers link the installed "ruckig" library (target ruckig::ruckig). | ||
| ctx.setMetadata "-lruckig" | ||
| } | ||
|
|
||
| onTest ctx => { | ||
| installDir := ctx.outputDir | ||
|
|
||
| // Keep the consumer build in its own tree so onTest behaves identically | ||
| // on a cache hit (onBuild skipped, no _build dir) and a cache miss. | ||
| testDir := ctx.SourceDir + "/_testconsumer" | ||
| testBuild := testDir + "/_build" | ||
|
|
||
| os.mkdirAll(testDir, 0o755)! | ||
|
|
||
| // Consumer mirrors the Conan test_package: a single-DoF trajectory update. | ||
| cpp := `#include <cstdio> | ||
| #include <ruckig/ruckig.hpp> | ||
|
|
||
| int main() { | ||
| using namespace ruckig; | ||
|
|
||
| Ruckig<1> otg(0.01); | ||
| InputParameter<1> input; | ||
| OutputParameter<1> output; | ||
|
|
||
| input.target_position = {1.0}; | ||
| input.max_velocity = {1.0}; | ||
| input.max_acceleration = {1.0}; | ||
| input.max_jerk = {1.0}; | ||
|
|
||
| auto result = otg.update(input, output); | ||
| printf("Ruckig update result: %d\n", static_cast<int>(result)); | ||
| return 0; | ||
| } | ||
| ` | ||
| os.writeFile(testDir+"/test_package.cpp", []byte(cpp), 0o644)! | ||
|
|
||
| cml := `cmake_minimum_required(VERSION 3.15) | ||
| project(ruckig_test_package LANGUAGES CXX) | ||
|
|
||
| find_package(ruckig REQUIRED CONFIG) | ||
|
|
||
| add_executable(test_package test_package.cpp) | ||
| target_link_libraries(test_package PRIVATE ruckig::ruckig) | ||
| ` | ||
| os.writeFile(testDir+"/CMakeLists.txt", []byte(cml), 0o644)! | ||
|
|
||
| tc := cmake.new(testDir, testBuild, testBuild+"/_out") | ||
| tc.buildType "Release" | ||
| tc.use installDir | ||
|
|
||
| tc.configure | ||
| tc.build | ||
|
|
||
| // A non-zero exit surfaces via lastErr and fails the test. | ||
| exec testBuild + "/test_package" | ||
| if lastErr != nil { | ||
| panic lastErr | ||
| } | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "path": "pantor/ruckig", | ||
| "deps": {} | ||
| } |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The metadata is a bare
-lruckig, which omits the install-directory search paths. Upstream installs headers toinclude/ruckigand the archive tolib/, so a consumer given only-lruckighas no-I<installDir>/includeor-L<installDir>/liband cannot locate<ruckig/ruckig.hpp>or the archive. The spec's Metadata section says to include install-directory paths when consumers need them.This gap is not caught by
onTest: the consumer there usesfind_package(ruckig REQUIRED CONFIG)viatc.use installDir(CMAKE_PREFIX_PATH), so it never exercises the metadata string.Also note the comment on the line above describes the CMake target (
ruckig::ruckig), but the metadata emitted is a raw linker flag — different consumer contracts. Consider deriving the metadata from the installed CMake config (or otherwise including-I/-Lpaths) so raw-metadata consumers can compile and link.