Get mmap() working with WIN32 MSVC

- We have pretty high quality POSIX polyfills now
- We no longer need to override malloc()

Tracked by issue #91
Improves upon #341
This commit is contained in:
Justine Tunney 2023-03-28 09:27:41 -07:00
parent e4881686b4
commit cbddf4661b
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
8 changed files with 700 additions and 751 deletions

View file

@ -30,8 +30,8 @@ endif
# Compile flags
#
CFLAGS = -I. -O3 -DNDEBUG -std=c11 -fPIC -g -fno-omit-frame-pointer
CXXFLAGS = -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC -g -fno-omit-frame-pointer
CFLAGS = -I. -O3 -DNDEBUG -std=c11 -fPIC
CXXFLAGS = -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC
LDFLAGS =
# OS specific
@ -185,14 +185,17 @@ default: main quantize
ggml.o: ggml.c ggml.h
$(CC) $(CFLAGS) -c ggml.c -o ggml.o
mmap.o: mmap.c mmap.h
$(CC) $(CFLAGS) -c mmap.c -o mmap.o
utils.o: utils.cpp utils.h
$(CXX) $(CXXFLAGS) -c utils.cpp -o utils.o
clean:
rm -f *.o main quantize
main: main.cpp ggml.o utils.o
$(CXX) $(CXXFLAGS) main.cpp ggml.o utils.o -o main $(LDFLAGS)
main: main.cpp ggml.o utils.o mmap.o
$(CXX) $(CXXFLAGS) main.cpp ggml.o utils.o mmap.o -o main $(LDFLAGS)
./main -h
quantize: quantize.cpp ggml.o utils.o