Skip to content

Commit

Permalink
Fix compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bab2min committed Jul 31, 2024
1 parent a0d59b1 commit 9fbfdca
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}" )
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
numpy>=1.10.0
numpy>=1.10.0,<2
9 changes: 6 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/TopicModel/TopicModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ namespace tomoto

virtual operator RawDoc() const
{
RawDoc raw{ *this };
RawDoc raw{ *static_cast<const RawDocKernel*>(this) };
if (wOrder.empty())
{
raw.words.insert(raw.words.begin(), words.begin(), words.end());
Expand Down

0 comments on commit 9fbfdca

Please sign in to comment.