'make -j 16' fails with "unterminated #ifdef" error
---------------------------------------------------

                 Key: THRIFT-1027
                 URL: https://issues.apache.org/jira/browse/THRIFT-1027
             Project: Thrift
          Issue Type: Bug
          Components: Build Process
         Environment: Ubuntu 10.04
            Reporter: Anatol Pomozov


If I run 'make' in 1 thread Thrift builds fine. But if I clean&run it with 16 
threads the build process fails almost constantly with following error

{noformat} 
g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../../lib/cpp/src -I/usr/include  -Wall 
-g -O2 -MT Benchmark.o -MD -MP -MF .deps/Benchmark.Tpo -c -o Benchmark.o 
Benchmark.cpp
/bin/sh ../../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. 
-I../../.. -I../../../lib/cpp/src -I/usr/include  -Wall -g -O2 -MT 
OptionalRequiredTest_types.lo -MD -MP -MF .deps/OptionalRequiredTest_types.Tpo 
-c -o OptionalRequiredTest_types.lo `test -f 
'gen-cpp/OptionalRequiredTest_types.cpp' || echo 
'./'`gen-cpp/OptionalRequiredTest_types.cpp
/bin/sh ../../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. 
-I../../.. -I../../../lib/cpp/src -I/usr/include  -Wall -g -O2 -MT 
ThriftTest_types.lo -MD -MP -MF .deps/ThriftTest_types.Tpo -c -o 
ThriftTest_types.lo `test -f 'gen-cpp/ThriftTest_types.cpp' || echo 
'./'`gen-cpp/ThriftTest_types.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../../lib/cpp/src 
-I/usr/include -Wall -g -O2 -MT DebugProtoTest_extras.lo -MD -MP -MF 
.deps/DebugProtoTest_extras.Tpo -c DebugProtoTest_extras.cpp  -fPIC -DPIC -o 
.libs/DebugProtoTest_extras.o
/bin/sh ../../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. 
-I../../.. -I../../../lib/cpp/src -I/usr/include  -Wall -g -O2 -MT 
DebugProtoTest_types.lo -MD -MP -MF .deps/DebugProtoTest_types.Tpo -c -o 
DebugProtoTest_types.lo `test -f 'gen-cpp/DebugProtoTest_types.cpp' || echo 
'./'`gen-cpp/DebugProtoTest_types.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../../lib/cpp/src 
-I/usr/include -Wall -g -O2 -MT OptionalRequiredTest_types.lo -MD -MP -MF 
.deps/OptionalRequiredTest_types.Tpo -c gen-cpp/OptionalRequiredTest_types.cpp  
-fPIC -DPIC -o .libs/OptionalRequiredTest_types.o
In file included from DebugProtoTest_extras.cpp:22:
gen-cpp/DebugProtoTest_types.h:6:1: error: unterminated #ifndef
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../../lib/cpp/src 
-I/usr/include -Wall -g -O2 -MT ThriftTest_extras.lo -MD -MP -MF 
.deps/ThriftTest_extras.Tpo -c ThriftTest_extras.cpp  -fPIC -DPIC -o 
.libs/ThriftTest_extras.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../../lib/cpp/src 
-I/usr/include -Wall -g -O2 -MT ThriftTest_types.lo -MD -MP -MF 
.deps/ThriftTest_types.Tpo -c gen-cpp/ThriftTest_types.cpp  -fPIC -DPIC -o 
.libs/ThriftTest_types.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../../lib/cpp/src 
-I/usr/include -Wall -g -O2 -MT DebugProtoTest_types.lo -MD -MP -MF 
.deps/DebugProtoTest_types.Tpo -c gen-cpp/DebugProtoTest_types.cpp  -fPIC -DPIC 
-o .libs/DebugProtoTest_types.o
DebugProtoTest_extras.cpp:27: error: definition of 'bool 
thrift::test::debug::Empty::operator<(const thrift::test::debug::Empty&) const' 
is not in namespace enclosing 'thrift::test::debug::Empty'
DebugProtoTest_extras.cpp:33: error: expected '}' at end of input
DebugProtoTest_extras.cpp:33: error: expected '}' at end of input
DebugProtoTest_extras.cpp:33: error: expected '}' at end of input
make[4]: *** [DebugProtoTest_extras.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
{noformat} 

The file ./lib/cpp/test/gen-cpp/DebugProtoTest_types.h looks ok. Now if I run 
'make -j 16' once again - everything builds fine.

It makes me think that this is a concurrency issue in Makefiles. My only guess 
is this is some undeclared dependency. It looks like DebugProtoTest_extras.cpp 
started building before gen-cpp/DebugProtoTest_types.h generation ended.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to