From: Marcus Calhoun-L. <mca...@ma...> - 2019-11-04 04:15:26
|
Greetings. My name is Marcus Calhoun-Lopez, and Mojca was kind enough to include me in this discussion. I originally raised this issue. The source of the error is as follows: *) In the file gnuplot-5.2.7/src/Makefile.in, there is the line of code DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) *) The -I switch means that Clang (and GCC) search $(top_builddir) before the default include directions. *) Clang (and GCC) have a file called version in the default included directories (likely to be part of the C++20 standard). *) On case-insensitive file systems (like the the default macOS file system), the files version and VERSION are the same. *) In $(top_builddir), there is a file called VERSION. *) gnuplot indirectly has an #include <version>. *) Instead of finding version in the default include directories, it finds the file VERSION in $(top_builddir). *) This causes an error. If -I$(top_builddir) is replaced with -idirafter$(top_builddir), the problem goes away. I am sorry if this is a little long winded. Please let me know if I can clarify. I can create a simple test program if that would help. Thank you, Marcus > On Nov 3, 2019, at 8:45 PM, Ethan Merritt (UW) <me...@uw...> wrote: > > On Sunday, 03 November 2019 18:56:09 Ethan Merritt wrote: > > > /opt/local/libexec/llvm-9.0/bin/../include/c++/v1/cstddef:37: > > > ../version:1:1: error: expected unqualified-id > > > 5.2 > > > ^ > > > > > > > And frankly, I cannot believe any tool vendor nor standardization body > > > > would be so daft as to assume that <version.h> is a suitable name for a > > > > new standard header. There must be roughly several million pre-existing > > > > user header files by that name out there that this would trample on. > > > > > > Well ... the fact is that the build breaks when using the latest clang > > > compiler. And on old OS versions this is now the default behaviour in > > > MacPorts, so gnuplot build is currently broken for many of our users. > > > > I can build from current git head using clang 9.0.0 without any problem. > > My wxgtk version is 3.1 > > > > On my system cstddef.h does not refer to VERSION anywhere. > > However that file came from gcc, not from llvm. > > I don't know where that gets us in debugging your problem, > > but it seems not to be a problem with clang per se. > > > > Note that the syntax > > #include <FILENAME> > > should only look in "a standard list of system directories". > > I do not know where that standard list is defined, but in any > > case it should not include the current working directory. > > So a local file named VERSION would not conflict. > > > > Ethan > > > > > > > > > > It hardly makes sense to start pointing fingers about who was supposed > > > to figure out that VERSION would be loaded first when one of the > > > compiler's own files says "#include <version>" ... > > > > > > Mojca > > Upon further reflection... > Your error message cannot be coming from a filename. > It is the VERSION symbol itself that may be an issue. > Can you compile a junk program? > > clang -o helloworld -DVERSION="6.7" helloworld.cpp > > If defining VERSION breaks your compile chain that is clearly > a problem, but it has nothing to do with gnuplot file names. > > Ethan > > -- > Ethan A Merritt, Dept of Biochemistry > Biomolecular Structure Center, K-428 Health Sciences Bldg > MS 357742, University of Washington, Seattle 98195-7742 |