I had been running into an error trying to compile StreamIt programs with the cluster backend with the SVN tip (r11463)
$ strc --cluster 1 HelloWorld.str
Starting Kopi2SIR... done.
Entry to Cluster Backend
Running Constant Prop and Unroll... done.
Running Constant Field Propagation... done.
Estimating Code size of Filters... done.
Estimating Code size of Filters... done.
Running Partitioning... target number of threads: 1
Running Partitioning... target number of threads: 1
Detected target is max fusion, fusing as much as possible...
Done Partitioning...
Generating cluster code...
NOTE: Missing or empty $STREAMIT_HOME/cluster-machines.txt file,
so all threads assigned to adk9-laptop in cluster-config.txt.
Done generating cluster code.
g++ -O3 -I/scratch/Software/streamit-2.1.1/library/cluster -c -o combined_threads.o combined_threads.cpp
combined_threads.cpp: In function ‘void init()’:
combined_threads.cpp:61:50: error: ‘PTHREAD_STACK_MIN’ was not declared in this scope
combined_threads.cpp: In function ‘int main(int, char**)’:
combined_threads.cpp:127:30: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
combined_threads.cpp:127:48: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
make: *** [combined_threads.o] Error 1
Apparently, the definition of PTHREAD_STACK_MIN has changed from pthread.h to limits.h. Here's a fix for this issue:
Include "limits.h" in the generated code for PTHREAD_STACK_MIN
Index: streams/src/at/dms/kjc/cluster/GenerateMasterDotCpp.java
===================================================================
--- streams/src/at/dms/kjc/cluster/GenerateMasterDotCpp.java (revision 11463)
+++ streams/src/at/dms/kjc/cluster/GenerateMasterDotCpp.java (working copy)
<at> <at> -43,6 +43,7 <at> <at>
p.print("#include <pthread.h>\n");
p.print("#include <unistd.h>\n");
p.print("#include <signal.h>\n");
+ p.print("#include <limits.h>\n");
p.print("#include <string.h>\n");
p.print("#include <stdlib.h>\n");
p.print("#include <stdio.h>\n");