Skip to content

Do not add LD_LIBRARY_PATH to search path when not defined - #24411

Merged
tianleiwu merged 1 commit into
microsoft:mainfrom
clementperon:fix_blank_LD_LIBRARY_PATH
Apr 21, 2025
Merged

Do not add LD_LIBRARY_PATH to search path when not defined#24411
tianleiwu merged 1 commit into
microsoft:mainfrom
clementperon:fix_blank_LD_LIBRARY_PATH

Conversation

@clementperon

Copy link
Copy Markdown
Contributor

If LD_LIBRARY_PATH is not defined a blank "-L" is added to the link command. This causes the next object to be linked to get treated as if it was a search path and causes link failure.

If LD_LIBRARY_PATH is not defined a blank "-L" is added to the
link command. This causes the next object to be linked to get
treated as if it was a search path and causes link failure.

Signed-off-by: Andrew Davis <afd@ti.com>
Signed-off-by: Clément Péron <peron.clem@gmail.com>
@tianleiwu

Copy link
Copy Markdown
Contributor

/azp run Linux QNN CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline,Windows x64 QNN CI Pipeline

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 5 pipeline(s).


target_link_libraries(onnxruntime_providers_acl -L$ENV{LD_LIBRARY_PATH})
if (DEFINED ENV{LD_LIBRARY_PATH})
target_link_libraries(onnxruntime_providers_acl -L$ENV{LD_LIBRARY_PATH})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

target_link_libraries does not accept -L options directly. It expects library targets or paths to libraries.

There are link_directories or set_target_properties(onnxruntime_providers_acl PROPERTIES LINK_FLAGS ...) for that purpose.

Anyway, let me merge this to unblock your build.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You should use target_link_directories

@tianleiwu
tianleiwu merged commit 49e94da into microsoft:main Apr 21, 2025
intbf pushed a commit to intbf/onnxruntime that referenced this pull request Apr 25, 2025
…#24411)

If LD_LIBRARY_PATH is not defined a blank "-L" is added to the link
command. This causes the next object to be linked to get treated as if
it was a search path and causes link failure.

Signed-off-by: Andrew Davis <afd@ti.com>
Signed-off-by: Clément Péron <peron.clem@gmail.com>
Co-authored-by: Andrew Davis <afd@ti.com>
Signed-off-by: bfilipek <bartlomiej.filipek@intel.com>
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.

4 participants