[Insight-developers] CableSwig build problem resolved
Brad King
brad.king at kitware.com
Wed, 17 Mar 2004 10:46:07 -0500
Hans J. Johnson wrote:
> Brad, Bill, or other CableSwig Maintainers,
>
> I had a nasty little problem compiling CableSwig that started
> intermitantly after the merging with the main SWIG tree.
>
> The file Utilities/CableSwig/SWIG/Source/CParse/cscanner.c includes
> "parser.h" with the intent of getting
> Utilities/CableSwig/SWIG/Source/CParse/parser.h. The problem is that my
> system has 8 different parser.h files from other packages, and one of
> them is being included instead of the desired parser.h.
>
> /usr/include/gnome-xml/parser.h
> /usr/include/libxml2/libxml/parser.h
> /usr/include/namazu/parser.h
> /usr/include/pgsql/server/parser/parser.h
> /usr/src/linux-2.4.20-28.9/net/tux/parser.h
> /home/hjohnson/src/buildhome/gcc3/DEBUG/include/parser.h
> /home/hjohnson/src/brains2/iplFreeware/gcc3/DEBUG/Insight-build/Utilities/CableSwig/SWIG/Source/CParse/parser.h
>
> (The offending version this time is from the AFNI package that I need
> installed for my integration with brains2.).
>
> The problem is not really your problem, but the solution should be easy
> to implement, and sure would help avoid this problem in the future.
> Would it be possible have it's name changed to something like
> swig_parser.h?
We cannot rename it because it is generated from parser.y with yacc or
bison if one is available on the system, and it is hard to configure
those names. However, I've fixed the problem in this case by changing
the include line to
#include <../CParse/parser.h>
which should find the right one. This is a hack until we provide more
fine-grained include path control in CMake.
-Brad