BLD: fix Cygwin build error.  Closes #1944.  Thanks to Sebastian Sohr.
BUG: ticket #1578, Fix python-debug warning for python >= 2.7.

In Python >= 2.7 the memory management of unicode objects changed from
PyMem_* to PyObject_*. Numpy had its own modified copy of some of the
Python code for handling unicode objects and it needed to be updated
to deal with the change. Thanks to Joseph Miessner for tracking this down
and finding the fix.
Revert "BUG: ticket #1578, Fix python-debug warning for python >= 2.7."

This reverts commit 0a3a954c3750419552c076aa444563ac20def14a. The fix
caused segfaults for python built using the default ucs2 unicode size. It
looks like the cause is memory corruption in the PyObject pooled memory. In
particular, the routines in ucsnarrow.c lack the checks and fallbacks
present in the original Python source code in Objects/unicodeobject.c. I
think the best fix is to rewrite the relevant bits of numpy code so that
they don't use the MyPyUnicode_* routines at all, but rather the routines
present in Python.
BLD: fix build error on Windows with MSVC9. Thanks to Christoph Gohlke.
BUG: einsum: Fix issue #2027, inner loop 3rd data pointer was not being incremented
TST: Add a test for ticket #2027
BUG: ticket #1578, fix python debug segfault.

Squashed and backported from master.
BLD: raise a clearer warning in case of building without cleaning up first.

Occurs only on Python 3.x when a version.py file is already present, due to
copying the whole tree into build/pyk3/.

(backport of cd6d53ff)
BLD: fix build for py3k + pip. Closes #1857. Thanks to Erik Bray.

Also works inside a virtualenv.
BLD: follow build_ext coding convention in build_clib to catch strange fcompiler value reported in ml.
BLD: fix up detection of Intel CPU on OS X in system_info.py.
BLD: add support for the new X11 directory structure on Ubuntu & co.
BUG: distutils: change compile flag on AIX from -O5 to -O3. See #1261.
BUG: distutils: update HP compiler flags. Closes #1377.
ENH: distutils: provide better support for C++ code on HPUX. Closes #1383.
FIX: add ufsparse to the libraries search path.

Fixes a build failure on macports when it detected umfpack but was
unable to build the extension module. Equivalent to the
'/usr/include/suitesparse' path under Debian.
ENH: Add 'pgfortran' as a valid compiler in the Portland Group
suite of fortran compilers. Adjust the version string command.
MAINT: update version match regexp for IBM AIX Fortran compilers.

The patched version correctly matches the output of ``xlf -qversion`` on my AIX platform:

  $ uname -a
  AIX c1t0101 3 5 00CF49B14C00
  $ xlf -qversion
  IBM XL Fortran for AIX, V12.1
  Version: 12.01.0000.0000
  $
Merge pull request #258 from rgommers/backport-build-fixes

Backport build fixes to 1.6.x
BUG: ticket #2063, make unique return consistent index.

Make unique use  mergesort when return_index is true. This quarantees that
the returned indices are of the first occurrence of the unique elements and
makes the behavior better defined and consistent.