BrookXuan commented on issue #17696: URL: https://github.com/apache/tvm/issues/17696#issuecomment-3146308914
### Fix TVM: "cannot find -lxml2" Compilation Error ### Error When compiling TVM, linker fails with: ```bash [100%] Linking CXX shared library libtvm_allvisible.so [100%] Linking CXX shared library libtvm.so /usr/bin/ld/usr/bin/ld: cannot find : cannot find -lxml2-lxml2: : No such file or directoryNo such file or directory ``` ### Why System has `libxml2.so.2` (runtime library) but lacks `libxml2.so` (symbolic link for linking), which is provided by `libxml2-dev` (development package). ### Fix Install `libxml2-dev` to get the required link: ```bash sudo apt-get update && sudo apt-get install libxml2-dev ``` ### Verify Check the link exists after installation: ```bash ls -l /usr/lib/x86_64-linux-gnu/libxml2.so* ``` You’ll see `libxml2.so -> libxml2.so.2.9.13` (or similar version). ### Note **Don’t link against Conda’s `libxml2.so` (may cause dependency issues). Use system `libxml2-dev` instead.** -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
