Add profiling flag
This commit is contained in:
parent
ae7b437ac3
commit
11757e5e28
15
src/Makefile
15
src/Makefile
@ -8,7 +8,7 @@ CLASSOBJS=$(CLASSSRCS:.cpp=.o)
|
|||||||
|
|
||||||
INCLUDE=../include
|
INCLUDE=../include
|
||||||
|
|
||||||
CFLAGS=-larmadillo -llapack -std=c++11 -O2
|
CFLAGS=-Wall -larmadillo -llapack -std=c++11 -O3
|
||||||
OPENMP=-fopenmp
|
OPENMP=-fopenmp
|
||||||
|
|
||||||
# Add a debug flag when compiling (For the DEBUG macro in utils.hpp)
|
# Add a debug flag when compiling (For the DEBUG macro in utils.hpp)
|
||||||
@ -19,20 +19,27 @@ else
|
|||||||
DBGFLAG=
|
DBGFLAG=
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
PROFILE ?= 0
|
||||||
|
ifeq ($(PROFILE), 1)
|
||||||
|
PROFFLAG=-pg
|
||||||
|
else
|
||||||
|
PROFFLAG=
|
||||||
|
endif
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
||||||
all: test_suite main
|
all: test_suite main
|
||||||
|
|
||||||
# Rules for executables
|
# Rules for executables
|
||||||
main: main.o $(LIBOBJS) $(CLASSOBJS)
|
main: main.o $(LIBOBJS) $(CLASSOBJS)
|
||||||
$(CC) $^ -o $@ $(CFLAGS) $(DBGFLAG) -I$(INCLUDE) $(OPENMP)
|
$(CC) $^ -o $@ $(CFLAGS) $(DBGFLAG) $(PROFFLAG) -I$(INCLUDE) $(OPENMP)
|
||||||
|
|
||||||
test_suite: test_suite.o $(LIBOBJS) $(CLASSOBJS)
|
test_suite: test_suite.o $(LIBOBJS) $(CLASSOBJS)
|
||||||
$(CC) $^ -o $@ $(CFLAGS) $(DBGFLAG) -I$(INCLUDE) $(OPENMP)
|
$(CC) $^ -o $@ $(CFLAGS) $(DBGFLAG) $(PROFFLAG) -I$(INCLUDE) $(OPENMP)
|
||||||
|
|
||||||
# Rule for object files
|
# Rule for object files
|
||||||
%.o: %.cpp
|
%.o: %.cpp
|
||||||
$(CC) -c $^ -o $@ $(CFLAGS) $(DBGFLAG) -I$(INCLUDE) $(OPENMP)
|
$(CC) -c $^ -o $@ $(CFLAGS) $(DBGFLAG) $(PROFFLAG) -I$(INCLUDE) $(OPENMP)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm *.o
|
rm *.o
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user