diff --git a/Makefile.win b/Makefile.win index 17e5a17..280caaa 100644 --- a/Makefile.win +++ b/Makefile.win @@ -1,19 +1,22 @@ CXX = cl.exe -CFLAGS = /nologo /O2 /EHsc /D "_CRT_SECURE_NO_DEPRECATE" /D "USEOMP" /openmp +CFLAGS = /nologo /O2 /EHsc /D "_CRT_SECURE_NO_DEPRECATE" /D "USEOMP" /D "USESSE" /openmp TARGET = windows all: $(TARGET) $(TARGET)\ffm-train.exe $(TARGET)\ffm-predict.exe -$(TARGET)\ffm-predict.exe: ffm.h ffm-predict.cpp ffm.obj - $(CXX) $(CFLAGS) ffm-predict.cpp ffm.obj -Fe$(TARGET)\ffm-predict.exe +$(TARGET)\ffm-predict.exe: ffm.h ffm-predict.cpp ffm.obj timer.obj + $(CXX) $(CFLAGS) ffm-predict.cpp ffm.obj timer.obj -Fe$(TARGET)\ffm-predict.exe -$(TARGET)\ffm-train.exe: ffm.h ffm-train.cpp ffm.obj - $(CXX) $(CFLAGS) ffm-train.cpp ffm.obj -Fe$(TARGET)\ffm-train.exe +$(TARGET)\ffm-train.exe: ffm.h ffm-train.cpp ffm.obj timer.obj + $(CXX) $(CFLAGS) ffm-train.cpp ffm.obj timer.obj -Fe$(TARGET)\ffm-train.exe ffm.obj: ffm.cpp ffm.h $(CXX) $(CFLAGS) -c ffm.cpp +timer.obj: timer.cpp timer.h + $(CXX) $(CFLAGS) -c timer.cpp + .PHONY: $(TARGET) $(TARGET): -mkdir $(TARGET) diff --git a/README b/README index b6a3a6d..c447aa4 100644 --- a/README +++ b/README @@ -249,7 +249,7 @@ Building Windows Binaries The Windows part is maintained by different maintainer, so it may not always support the latest version. -The latest version it supports is: v1.14 +The latest version it supports is: v1.21 To build them via command-line tools of Visual C++, use the following steps: diff --git a/ffm.cpp b/ffm.cpp index 2f13845..c111aed 100644 --- a/ffm.cpp +++ b/ffm.cpp @@ -363,7 +363,7 @@ uint64_t hashfile(string txt_path, bool one_block=false) ffm_long end = (ffm_long) f.tellg(); f.seekg(0, ios::beg); - assert(f.tellg() == 0); + assert(static_cast(f.tellg()) == 0); uint64_t magic = 90359; for(ffm_long pos = 0; pos < end; ) { @@ -499,10 +499,14 @@ bool check_same_txt_bin(string txt_path, string bin_path) { ffm_model::~ffm_model() { if(W != nullptr) { -#ifdef _WIN32 - _aligned_free(W); +#ifndef USESSE + free(W); #else + #ifdef _WIN32 + _aligned_free(W); + #else free(W); + #endif #endif W = nullptr; }