forked from LibOPF/LibOPF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (45 loc) · 1.95 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
LIB=./lib
INCLUDE=./include
SRC=./src
OBJ=./obj
# By default, build against "python", using "python-config" to query for
# compilation options. Override this by passing other values for
# PYTHON and PYTHON_CONFIG when invoking "make" (or by modifying this
# file).
# Compile for python 3:
# make PYTHON=python3 PYTHON_CONFIG=python3-config bindings
# The python interpreter to use:
PYTHON=python
# Modify for python 3:
# PYTHON=python3
# The python-config executable to use:
PYTHON_CONFIG=python-config
# Modify for python 3:
# PYTHON_CONFIG=python3-config
PYTHON_INCLUDES=$(shell $(PYTHON_CONFIG) --includes)
CC=gcc
FLAGS= -march=native -O3 -Wall -fPIC -fopenmp -D NTHREADS=4 -lgomp
INCFLAGS = -I$(INCLUDE)
all: libopf
libopf: libopf-build
libopf-build: \
aux
ar rcs $(LIB)/libopf.a $(OBJ)/*.o
aux: $(SRC)/common.c $(SRC)/set.c $(SRC)/realheap.c $(SRC)/linearalloc.c $(SRC)/metrics.c $(SRC)/measures.c $(SRC)/graph.c $(SRC)/knn.c $(SRC)/supervised.c $(SRC)/unsupervised.c
$(CC) $(FLAGS) $(INCFLAGS) -c $(SRC)/common.c -o $(OBJ)/common.o
$(CC) $(FLAGS) $(INCFLAGS) -c $(SRC)/set.c -o $(OBJ)/set.o
$(CC) $(FLAGS) $(INCFLAGS) -c $(SRC)/realheap.c -o $(OBJ)/realheap.o
$(CC) $(FLAGS) $(INCFLAGS) -c $(SRC)/linearalloc.c -o $(OBJ)/linearalloc.o
$(CC) $(FLAGS) $(INCFLAGS) -c $(SRC)/metrics.c -o $(OBJ)/metrics.o
$(CC) $(FLAGS) $(INCFLAGS) -c $(SRC)/measures.c -o $(OBJ)/measures.o
$(CC) $(FLAGS) $(INCFLAGS) -c $(SRC)/graph.c -o $(OBJ)/graph.o
$(CC) $(FLAGS) $(INCFLAGS) -c $(SRC)/knn.c -o $(OBJ)/knn.o
$(CC) $(FLAGS) $(INCFLAGS) -c $(SRC)/supervised.c -o $(OBJ)/supervised.o
$(CC) $(FLAGS) $(INCFLAGS) -c $(SRC)/unsupervised.c -o $(OBJ)/unsupervised.o
## Cleaning-up
clean:
rm -f $(LIB)/lib*.so; rm -f $(OBJ)/*.o
cython:
cython libopf_py.pyx
bindings:
$(CC) -shared -pthread -fPIC -fwrapv -O2 -Wall -fno-strict-aliasing $(INCFLAGS) $(PYTHON_INCLUDES) -fopenmp -o $(LIB)/libopf_py.so libopf_py.c $(LIB)/libopf.a