[ts-gen] Installation Issues
pippin at owlriver.net
Wed Apr 29 12:51:37 EDT 2009
About the compilation problems you are seeing:
> ... problem getting the shim to compile on my system ...
> I run openSuse 11.0 and have g++ as shown below ...
> /shim-090327> g++ --version
> g++ (SUSE Linux) 4.3.1 20080507 (prerelease)
> [gcc-4_3-branch revision 135036]
> Copyright (C) 2008 Free Software Foundation Inc.
> Here are the some of the error messages I am getting:
> src/../lib/wrap.h:11: error: expected asm or __attribute__
> before MinimalModeMultiParadigm
> In file included from src/rule.h:11
... [more similar error messages elided]
The problem you have is straight-forward to describe, about which
more below, though I'm not sure *why* you are receiving messages
such as the one quoted above.
What you're seeing is a compiler error message for occurrences of
the C++ keyword namespace, near the beginning of header files; the
compiler recognizes the namespace name that follows that keyword as
an identifier, evidently doesn't like seeing it at that point, and
gives you some guesses as to what I might have meant to say besides
Except that "namespace" is exactly what I meant to say, and it's
correct C++ code.
So, either the compiler is completely confused by that point, say
from previous or enclosing header files, since the namespace
keyword is nearly the first code in the header file; or it
doesn't recognize a basic C++ keyword. The latter case would
suggest that the compiler is being called as gcc rather than g++ .
> src/shim.h:11: error: expected asm or __attribute__
> before TShimInterpreter
> src/main.c: In function main:
> src/main.c:12: error: one undeclared (first use in this function)
> src/main.c:12: error: (Each undeclared identifier is reported only once
> src/main.c:12: error: for each function it appears in.)
... [more compiler confusion deleted]
In the first "main.c:12" line above, "one" is a namespace alias,
which has been declared, though using of course the keyword
"namespace". This is more evidence that your compiler is
compiling C and not C++, which is definitely possible with gcc.
The first thought that comes to mind is that the CC variable is
set incorrectly. From my release tarball build directory:
rel$ grep -h CC shim-0?????/Makefile | sort | uniq -c
14 CC := g++
8 CC := distcc g++
rel$ grep CC shim-0?????/Makefile | tail -3
shim-090320/Makefile:CC := g++
shim-090327/Makefile:CC := distcc g++
shim-090428/Makefile:CC := g++
So, all recent releases have a CC definition that is meant to
request g++ , though it seems that sometimes my release script
failed to patch out the distcc definition with one for plain g++ .
So perhaps you have distcc running, but no g++ on other machines
in your build farm? Hard to say from here. Anyway, CC *must*
include g++, plain g++ is best until we figure out what's wrong.
I'm not sure exactly what's wrong with your system, or in what way
the shim's Makefile is incompatable with Suse. One question that
comes to mind is whether you need to install additional packages
for C++, and have only installed those for gcc. I don't know the
package structure for Suse, so this is just a guess. If I may make
a suggestion, you probably want to make sure that the Makefile is
starting g++ for the compiles.
If you don't know how to check that, feel free to post the
entire textual stderr output of running make to the list. I.e.,
start the script program, run make, exit from the subshell that
script started, and post the resulting file "typescript" to the
list. You've already showed us the error output from the compiler,
but not the earlier trace lines showing what programs make is
It's clear that something very basic is wrong. Perhaps you're
running the compile from the wrong directory? For an unpack
directory . , the C++ sources are spread over ./src and ./lib ,
and the Makefile explains this to the compiler using vpath
directives. You do have GNU make installed, right? E.g.,
something more or less like the following:
tsi$ make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
This program built for x86_64-pc-linux-gnu
The details above aren't critical; all I'm asking you to check
is that the first line after --version starts with "GNU make" .
Yes, this is grasping at straws, but otherwise, I really have no other
idea why your system's compiler would be unable to get past the first
line of a header file without gagging on the keyword "namespace".
Please continue poking around, or posting more diagnostic info, and
I hope we can figure out what the problem is.
More information about the ts-general