Bugzilla – Bug 2637
../src/config-store/model/xml-config.h:25:10: fatal error: 'libxml/xmlwriter.h' file not found #include <libxml/xmlwriter.h>
Last modified: 2018-11-14 17:29:46 UTC
Created attachment 2764 [details] config.log [1457/2170] Compiling src/config-store/model/config-store.cc In file included from ../src/config-store/model/xml-config.cc:21: ../src/config-store/model/xml-config.h:25:10: fatal error: 'libxml/xmlwriter.h' file not found #include <libxml/xmlwriter.h> ^ 1 error generated. In file included from ../src/config-store/model/config-store.cc:31: ../src/config-store/model/xml-config.h:25:10: fatal error: 'libxml/xmlwriter.h' file not found #include <libxml/xmlwriter.h> ^ 1 error generated. config.log will be attached It appears that we might be trying to include -I/usr/include/libxml2 But this path does not exist on my machine. bash-3.2# ls usr/include/libxml2 ls: usr/include/libxml2: No such file or directory Xcode version: Version 8.2.1 (8C1002)
John, is this still an issue with your current machine? Would like to close if no longer bothering you.
I'm experiencing the same issue trying to build ns-3.27 on macOS 10.13.2.
(In reply to Elias Rohrer from comment #2) > I'm experiencing the same issue trying to build ns-3.27 on macOS 10.13.2. Correction: the issue only occurred because I did not install the current version of the Command Line Tools after upgrading Xcode. So, running $ xcode-select --install fixed the issue, ns-3.27 is building now. I assume OP had the same problem and this issue is not a bug of ns-3 and hence may be closed?!
Update: After upgrading to macOS Mojave, I encountered this problem again. This time, it wasn't sufficient to install the command line tools. Afterwards, I had to install the legacy header package located at /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
I see that emacs project has a similar issue: https://emacs.stackexchange.com/questions/34238/installing-emacs-from-source-make-fatal-error-libxml-tree-h-file-not-found I suppose we need to disable libxml2 more gracefully for MacOS if header is not found, and provide more guidance on the 'installing Command Line Tools plus Legacy Headers' approach for MacOS users who want the XML features. Any thoughts on this approach? I will try to access a Mojave machine to experiment.
This would be nice. Is libxml2 really needed for ns-3's basic functionality? Could the respective components just get disabled when the library is not present? However, notice that I now multiple times encountered that the configure script seemed to have found libxml2, but the build then failed at compile time..
Created attachment 3210 [details] patch to fix I will commit this patch if it passes tests.
The patch should append the right include path if the situation exists (pig-config declares that libxml2 is installed, but the headers exist elsewhere). It should also not harm the case in which the user has already installed macOS_SDK_headers_for_macOS_10.14.pkg This is somewhat of a homebrew issue to resolve in the long run (either by changing package configs or requiring users to install the SDK headers package). In the meantime, I think we can recommend to users to take all three steps, with the third one optional, if they want to use the (optional) XML features: 1) install Xcode 2) install command-line tools 3) (optional) install the macOS_SDK_headers_for_macOS_10.14.pkg
pushed in 13855:2c86757b4511, and wiki Installation page updated