-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
64 lines (56 loc) · 2.22 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
CC=gcc
CCFLAGS = -Wall -fopenmp -g -O2
CPP=g++
CPPFLAGS = -Wall -fopenmp -g -O2 -std=c++11
WASM=em++
WASMDEBUGFLAGS = -O2 -gsource-map --profiling --profiling-funcs --tracing -sNO_DISABLE_EXCEPTION_CATCHING -sASSERTIONS
WASMOPTFLAGS = -Os -s ASSERTIONS=0 -sDISABLE_EXCEPTION_CATCHING=1 -flto
WASMFLAGS = -std=c++17 -lembind -s WASM=1 -s MODULARIZE=1 -s EXPORT_NAME="'HIGHP'" -sALLOW_MEMORY_GROWTH --extern-post-js src/js/highp-post.js
SWIG=./swig/
SRC=./src/
SRC_C=$(SRC)c/
SRC_CPP=$(SRC)cpp/
BIN=./bin/
PYTHONLIB=highp
PYTHON27CFLAGS = $(shell python-config --cflags)
PYTHON27INCLUDES = $(shell python-config --includes)
PYTHON27LDFLAGS = $(shell python-config --ldflags)
PYTHON3CFLAGS = $(shell python3-config --cflags)
PYTHON3INCLUDES = $(shell python3-config --includes)
PYTHON3LDFLAGS = $(shell python3-config --ldflags)
test:
mkdir -p $(BIN)
$(CC) $(CCFLAGS) -o $(BIN)test $(SRC_C)test.c -lm
# $(BIN)test
$(CPP) $(CPPFLAGS) -o $(BIN)test $(SRC_CPP)test.cpp
$(BIN)test
python:
python setup.py build_ext --inplace
python_build:
mkdir -p $(PYTHONLIB)
echo "" > $(PYTHONLIB)/__init__.py
swig -c++ -python -outdir $(PYTHONLIB) $(SWIG)fuzzy.i
swig -c++ -python -outdir $(PYTHONLIB) $(SWIG)distance.i
swig -c++ -python -outdir $(PYTHONLIB) $(SWIG)dbscan.i
swig -c++ -python -outdir $(PYTHONLIB) $(SWIG)moving.i
swig -c++ -python -outdir $(PYTHONLIB) $(SWIG)similarity.i
swig -c++ -python -outdir $(PYTHONLIB) $(SWIG)kmeans.i
python setup.py build_ext --inplace
python_install:
mkdir -p $(PYTHONLIB)
echo "" > $(PYTHONLIB)/__init__.py
swig -c++ -python -outdir $(PYTHONLIB) $(SWIG)fuzzy.i
swig -c++ -python -outdir $(PYTHONLIB) $(SWIG)distance.i
swig -c++ -python -outdir $(PYTHONLIB) $(SWIG)dbscan.i
swig -c++ -python -outdir $(PYTHONLIB) $(SWIG)moving.i
swig -c++ -python -outdir $(PYTHONLIB) $(SWIG)similarity.i
swig -c++ -python -outdir $(PYTHONLIB) $(SWIG)kmeans.i
python setup.py install
wasm_test:
$(WASM) $(WASMFLAGS) $(WASMDEBUGFLAGS) -o $(BIN)highp.js $(SRC_CPP)/wasm/bindings.cpp
wasm_prod:
$(WASM) $(WASMFLAGS) $(WASMOPTFLAGS) -o $(BIN)highp.js $(SRC_CPP)/wasm/bindings.cpp
wasm_simd:
$(WASM) $(WASMFLAGS) $(WASMOPTFLAGS) -msimd128 -o $(BIN)highp.js $(SRC_CPP)/wasm/bindings.cpp
clean:
rm -rf build dist bin swig/*.cxx $(PYTHONLIB)