diff --git a/CMakeLists.txt b/CMakeLists.txt index cc4fba6..3a51281 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,10 +20,13 @@ if(MSVC) set (ADDITIONAL_FLAGS "") elseif (TARGET_ARCH STREQUAL "sse2") set (ADDITIONAL_FLAGS "/arch:SSE2") + add_definitions(-D__SSE2__) elseif (TARGET_ARCH STREQUAL "avx") set (ADDITIONAL_FLAGS "/arch:AVX") + add_definitions(-D__SSE2__) elseif (TARGET_ARCH STREQUAL "avx2") set (ADDITIONAL_FLAGS "/arch:AVX2") + add_definitions(-D__SSE2__) endif() set ( CMAKE_C_FLAGS_DEBUG "-DDEBUG -DC_FLAGS -Zc:__cplusplus -Zi -Od ${ADDITIONAL_FLAGS}" ) diff --git a/requirements.txt b/requirements.txt index 152d9da..7e6c5fa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -numpy>=1.10.0 \ No newline at end of file +numpy>=1.10.0,<2 \ No newline at end of file diff --git a/setup.py b/setup.py index 3844654..a3ff6c1 100644 --- a/setup.py +++ b/setup.py @@ -19,8 +19,6 @@ def get_extra_cmake_options(): """read --clean, --no, --set, --compiler-flags, and -G options from the command line and add them as cmake switches. """ _cmake_extra_options = ["-DCMAKE_POSITION_INDEPENDENT_CODE=1"] - if os.environ.get('KIWI_CPU_ARCH'): - _cmake_extra_options.append("-DKIWI_CPU_ARCH=" + os.environ['KIWI_CPU_ARCH']) if os.environ.get('MACOSX_DEPLOYMENT_TARGET'): _cmake_extra_options.append("-DCMAKE_OSX_DEPLOYMENT_TARGET=" + os.environ['MACOSX_DEPLOYMENT_TARGET']) _clean_build_folder = False @@ -212,7 +210,12 @@ def build_extension(self, ext): # if target is in 64bit, remove 'none' if struct.calcsize("P") == 8: - arch_levels.remove('none') + try: + arch_levels.remove('none') + except ValueError: + pass +else: + arch_levels = [a for a in arch_levels if a in ('none', 'sse2')] modules = [] if len(arch_levels) > 1: diff --git a/src/TopicModel/TopicModel.hpp b/src/TopicModel/TopicModel.hpp index d1a9068..54a4253 100644 --- a/src/TopicModel/TopicModel.hpp +++ b/src/TopicModel/TopicModel.hpp @@ -107,7 +107,7 @@ namespace tomoto virtual operator RawDoc() const { - RawDoc raw{ *this }; + RawDoc raw{ *static_cast(this) }; if (wOrder.empty()) { raw.words.insert(raw.words.begin(), words.begin(), words.end());