Skip to content

Fix Windows installation errors once and for all

Hoogenboom requested to merge jerryhoogenboom/tssv:master into master

After the release of 0.4.1 I still ran into some issues with installing on Windows. I spent today fixing anything that popped up until it installed successfully.

The changes are:

  • 28488618: Avoided the use of variable length arrays as these are not supported by MSVC. The lengths of arrays must be known at compile-time, else you get an error C2057: expected constant expression. (I made this change before I figured MSVC should take the SSE2 route instead, so this is not strictly needed anymore to compile with MSVC, but it will probably fix other non-C99-non-SSE2-compilers anyway.)
  • 8b057ec5: Moved the declarations of __m128i variables in the SSE2 code up to the beginning of the function, as MSVC can't cope with them being declared after some function logic. The error you'd get is a rather cryptic error C2275: '__m128i' : illegal use of this type as an expression.
  • 96d3195f: Updated the detection of SSE2 capabilities such that SSE2 works with compilers that don't define __GNUC__. I made a special case for MSVC as it does not define __SSE2__ (or any of its family members) either. Instead it 'just works' with MSVC, so if _MSC_VER is defined, the code now assumes SSE2 is available.
  • 8ea3ee1f: Apparently the first argument to distutils.core.Extensionis a module name, not a module path. Hence, the /was supposed to be a .. This issue presented itself on Windows as error LNK2001: unresolved external symbol inittssv/_sg_align.

With these fixes in place, TSSV compiles and installs on my 64-bit Windows 10 laptop with 64-bit Python 2.7.12. Of course, all of this is tested for regressions with gcc 4.8.4 and Ubuntu 16.04.1 LTS as well.

Merge request reports

Loading