-
Notifications
You must be signed in to change notification settings - Fork 132
Fix LD_LIBRARY_PATH handling for shared libraries during fpm test #1259
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1377,18 +1377,25 @@ subroutine get_library_dirs(model, targets, shared_lib_dirs) | |||||
|
|
||||||
| integer :: i | ||||||
| type(string_t) :: temp | ||||||
|
|
||||||
|
|
||||||
| ! Start with an empty list | ||||||
| allocate(shared_lib_dirs(0)) | ||||||
|
|
||||||
| do i = 1, size(targets) | ||||||
| associate(target => targets(i)%ptr) | ||||||
| ! Only consider shared and archive library targets | ||||||
| if (all(target%target_type /= [FPM_TARGET_SHARED,FPM_TARGET_ARCHIVE])) cycle | ||||||
|
||||||
| if (all(target%target_type /= [FPM_TARGET_SHARED,FPM_TARGET_ARCHIVE])) cycle | |
| if (.not. any(target%target_type == [FPM_TARGET_SHARED,FPM_TARGET_ARCHIVE])) cycle |
Copilot
AI
Mar 12, 2026
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.
These comments are misleading with the current logic: the code path also applies to FPM_TARGET_ARCHIVE due to the filter above. Please adjust the wording to match the implementation (or adjust the implementation to match the comment).
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 PR description focuses on fixing runtime discovery for shared libraries, but this change also includes
FPM_TARGET_ARCHIVE. Static archives don’t affectLD_LIBRARY_PATH, so either (a) restrict the condition toFPM_TARGET_SHAREDonly, or (b) update the PR description to explicitly state why archive targets should be included here.