Skip to content

Adding example - #227

Open
magnoxemo wants to merge 14 commits into
xdg-org:mainfrom
magnoxemo:examples
Open

Adding example#227
magnoxemo wants to merge 14 commits into
xdg-org:mainfrom
magnoxemo:examples

Conversation

@magnoxemo

@magnoxemo magnoxemo commented May 10, 2026

Copy link
Copy Markdown
Contributor

closes #87

I am opening to this PR to test if I am breaking anything or not since, I haven't build xdg locally yet.

@magnoxemo magnoxemo changed the title Examples Adding example May 10, 2026
@magnoxemo
magnoxemo marked this pull request as ready for review May 10, 2026 02:10
@magnoxemo

Copy link
Copy Markdown
Contributor Author

@pshriwise I think this is ready for a review.

Comment thread examples/ray_segments.cpp Outdated
magnoxemo and others added 2 commits May 11, 2026 09:33
Co-authored-by: Waqar Butt <114666466+Waqar-ukaea@users.noreply.github.com>
@magnoxemo

Copy link
Copy Markdown
Contributor Author

I just noticed that one of the example in tools have used argument parser. Maybe it will be better to take advantage of that? Let me know if you don't like the changes.

@pshriwise pshriwise left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few thoughts from me as well.

To give the example some purpose, I wonder if a Monte Carlo volume estimation using the XDG methods would be interesting.

Comment thread examples/CMakeLists.txt Outdated
Comment thread examples/ray_segments.cpp Outdated
@magnoxemo

Copy link
Copy Markdown
Contributor Author

Agreed. I will update this and make it a volume estimation example.

Comment thread examples/element_volume_estimation.cpp
Comment thread CMakeLists.txt
endif()

target_link_libraries(xdg PRIVATE fmt::fmt)
target_link_libraries(xdg PUBLIC fmt::fmt)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remind me why this is necessary again?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue was that fmt was linked privately to xdg. As a result, when a library or executable linked against xdg, the fmt dependency was not propagated to it. That caused the linker error we were seeing at that time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Initial set of examples.

3 participants