You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by "tqchen (via GitHub)" <gi...@apache.org> on 2026/06/17 12:05:06 UTC

[PR] [CI][LLVM] Avoid global LLVM library search in wheels [tvm]

tqchen opened a new pull request, #19815:
URL: https://github.com/apache/tvm/pull/19815

   ## Summary
   
   `LIBRARY_PATH=/opt/llvm/lib` globally changes GCC library search order in manylinux wheel builds, which can make conda LLVM's `libstdc++` override the manylinux GCC toolset linker script. `llvm-config --libfiles` already reports absolute LLVM archive paths, so this PR resolves the remaining raw `-lxml2` system library through CMake on Linux instead of changing linker search globally.
   
   - Resolve LLVM's Linux `-lxml2` system-lib entry to an absolute library path with `llvm-config --libdir` as a hint.
   - Remove the Linux wheel `LIBRARY_PATH=/opt/llvm/lib` override while keeping `CMAKE_PREFIX_PATH=/opt/llvm`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [CI][LLVM] Avoid global LLVM library search in wheels [tvm]

Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen closed pull request #19815: [CI][LLVM] Avoid global LLVM library search in wheels
URL: https://github.com/apache/tvm/pull/19815


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [CI][LLVM] Avoid global LLVM library search in wheels [tvm]

Posted by "gemini-code-assist[bot] (via GitHub)" <gi...@apache.org>.
gemini-code-assist[bot] commented on code in PR #19815:
URL: https://github.com/apache/tvm/pull/19815#discussion_r3427951590


##########
cmake/utils/FindLLVM.cmake:
##########
@@ -208,7 +208,12 @@ macro(find_llvm use_llvm)
         endif()
       elseif("${__flag}" STREQUAL "-lxml2")
         message(STATUS "LLVM links against xml2")
-        list(APPEND LLVM_LIBS "-lxml2")
+        if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+          find_library(__llvm_xml2_library NAMES xml2 HINTS "${__llvm_libdir}" REQUIRED)
+          list(APPEND LLVM_LIBS "${__llvm_xml2_library}")

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   Since `find_library` caches its result in the CMake cache, if a developer re-runs CMake with a different LLVM path (which changes `${__llvm_libdir}`), the cached value of `__llvm_xml2_library` will persist and point to the old path. To ensure the library is correctly re-resolved when the LLVM path changes, we should unset `__llvm_xml2_library` from the cache before calling `find_library`.
   
   ```
           if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
             unset(__llvm_xml2_library CACHE)
             find_library(__llvm_xml2_library NAMES xml2 HINTS "${__llvm_libdir}" REQUIRED)
             list(APPEND LLVM_LIBS "${__llvm_xml2_library}")
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [CI][LLVM] Avoid global LLVM library search in wheels [tvm]

Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen commented on PR #19815:
URL: https://github.com/apache/tvm/pull/19815#issuecomment-4730562979

   Closing before further diagnostic probing; will reopen or send a fresh PR after collecting the needed fork-side logs.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org