If you changed these lines:
float dists[clusterNeighborCandidates.size() - (i+1)];
compute_distances( distance_deltaCache,
neighborPartition->genomeCache,
clusterNeighborCandidates,
i, i+1, clusterNeighborCandidates.size(),
dists );
to this:
::std::vector<float> dists(clusterNeighborCandidates.size() - (i+1));
compute_distances( distance_deltaCache,
neighborPartition->genomeCache,
clusterNeighborCandidates,
i, i+1, clusterNeighborCandidates.size(),
&(dists[0]) );
I bet the problem would go away.
The problem is that the original code has a dynamically sized array on the stack. The compiler generated code that calls the 'alloca' to allocate memory off the stack. Unfortunately, that function is non-standard and has kind of a shady history in general.
And dynamically sized arrays, while legal C99, are not legal C++03 or C++11. I think both g++ and clang support them as an extension. But apparently that support is slightly broken under OS X.
::std::vector
neatly sidesteps that problem. It does not allocate the array on the stack. It allocates it on the heap.