title: Pthread and gcc compiling issue on OS X
body: <p>I have a script that compiles fine on Linux (Ubuntu 11.04), but not on OS X (Lion).</p>
  
  <pre><code>gcc -pthread -o hw1 hw1.c 
  hw1.c:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘barr’
  hw1.c: In function ‘__syncthreads’:
  hw1.c:53: error: ‘barr’ undeclared (first use in this function)
  hw1.c:53: error: (Each undeclared identifier is reported only once
  hw1.c:53: error: for each function it appears in.)
  hw1.c:54: error: ‘PTHREAD_BARRIER_SERIAL_THREAD’ undeclared (first use in this function)
  hw1.c: In function ‘parallel_psum’:
  hw1.c:94: error: ‘barr’ undeclared (first use in this function)
  hw1.c:107: warning: assignment from incompatible pointer type
  </code></pre>
  
  <p>Here's the first 22 lines of the code:</p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;time.h&gt;
  #include &lt;math.h&gt;
  #include &lt;sys/time.h&gt;
  #include &lt;pthread.h&gt;
  #include &lt;assert.h&gt;
  
  /* create thread argument struct for thr_func() */
  typedef struct _thread_data_t {
      int tid;
      int* ints;
      int* sums;
      int num_ints;
      int* temp;
  } thread_data_t;
  
  const int MIN_RAND_INT = 1;
  const int MAX_RAND_INT = 65000;
  
  // pthreads barrier variable
  pthread_barrier_t barr;
  </code></pre>
  
  <p>Any ideas why this is happening?</p>