title: Thrust Error: libc++abi.dylib: terminate called throwing an exception. Abort trap: 6
body: <p>Trying to do a simple copy data from Host to Device using thrust. It's outputting:</p>
  
  <pre><code>libc++abi.dylib: terminate called throwing an exception
  Abort trap: 6
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>#include &lt;thrust/host_vector.h&gt;
  #include &lt;thrust/device_vector.h&gt;
  void test()
  {
      thrust::host_vector&lt;int&gt; H(4);
      H[0] = 14;
      H[1] = 20;
      H[2] = 38;
      H[3] = 46;
      thrust::device_vector&lt;int&gt; D = H; // causing error
  }
  int main()
  {
      test(); 
      return 0;
  }
  </code></pre>
  
  <p>Here's how I compiled and ran it in OS X:</p>
  
  <pre><code>$ nvcc test.cu -o test
  $ ./test
  </code></pre>
  
  <p>I have CUDA 5.5 installed which I believe installed Thrust 1.6.0 automatically.</p>