|
|
@@ -25,7 +25,8 @@ TARGET := knnsearch |
|
|
|
# Source directories list(space seperated). Makefile-relative path, UNDER current directory. |
|
|
|
SRC_DIR_LIST := src |
|
|
|
# Include directories list(space seperated). Makefile-relative path. |
|
|
|
INC_DIR_LIST := src inc |
|
|
|
INC_DIR_LIST := inc \ |
|
|
|
src |
|
|
|
# Exclude files list(space seperated). Filenames only. |
|
|
|
# EXC_FILE_LIST := bad.cpp old.cpp |
|
|
|
|
|
|
@@ -48,7 +49,7 @@ PRE_DEFS := |
|
|
|
|
|
|
|
# ============== Linker settings ============== |
|
|
|
# Linker flags (example: -pthread -lm) |
|
|
|
LDFLAGS := -pthread |
|
|
|
LDFLAGS := -pthread -lopenblas |
|
|
|
# Map output file |
|
|
|
MAP_FILE := output.map |
|
|
|
MAP_FLAG := -Xlinker -Map=$(BUILD_DIR)/$(MAP_FILE) |
|
|
@@ -57,7 +58,7 @@ MAP_FLAG := -Xlinker -Map=$(BUILD_DIR)/$(MAP_FILE) |
|
|
|
# We need: |
|
|
|
# - Bind the entire project directory(the dir that icludes all the code) as volume. |
|
|
|
# - In docker instance, change to working directory(where the makefile is). |
|
|
|
DOCKER_VOL_DIR := $${PWD} |
|
|
|
DOCKER_VOL_DIR := ${PWD} |
|
|
|
DOCKER_WRK_DIR := |
|
|
|
DOCKER_RUN := docker run --rm |
|
|
|
DOCKER_FLAGS := -v $(DOCKER_VOL_DIR):/usr/src/$(PROJECT) -w /usr/src/$(PROJECT)/$(DOCKER_WRK_DIR) |
|
|
@@ -137,8 +138,8 @@ include $(wildcard $(DEP)) |
|
|
|
$(BUILD_DIR)/$(TARGET): $(OBJ) |
|
|
|
@mkdir -p $(@D) |
|
|
|
@echo Linking to target: $(TARGET) |
|
|
|
@echo $(DOCKER) $(CXX) $(LDFLAGS) $(MAP_FLAG) -o $(@D)/$(TARGET) '$$(OBJ)' |
|
|
|
@$(DOCKER) $(CXX) $(LDFLAGS) $(MAP_FLAG) -o $(@D)/$(TARGET) $(OBJ) |
|
|
|
@echo $(DOCKER) $(CXX) '$$(OBJ)' $(LDFLAGS) $(MAP_FLAG) -o $(@D)/$(TARGET) |
|
|
|
@$(DOCKER) $(CXX) $(OBJ) $(LDFLAGS) $(MAP_FLAG) -o $(@D)/$(TARGET) |
|
|
|
@echo |
|
|
|
@echo Print size information |
|
|
|
@$(CSIZE) $(@D)/$(TARGET) |
|
|
@@ -221,7 +222,6 @@ v1: $(BUILD_DIR)/$(TARGET) |
|
|
|
cp $(BUILD_DIR)/$(TARGET) out/$(TARGET) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# |
|
|
|
# ========= Inside CSAL Image build rules =========== |
|
|
|
# |
|
|
@@ -258,4 +258,14 @@ csal_v1: TARGET := knnsearch_v1 |
|
|
|
csal_v1: $(BUILD_DIR)/$(TARGET) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# |
|
|
|
# ======== Run from container ========= |
|
|
|
# |
|
|
|
# examples: |
|
|
|
# |
|
|
|
# make IMAGE=hpcimage EXEC=knnsearch_v1 run |
|
|
|
# make IMAGE=hpcimage EXEC=knnsearch_cilkv1 run |
|
|
|
# |
|
|
|
run: DOCKER := $(DOCKER_CMD) |
|
|
|
run: |
|
|
|
$(DOCKER) ./out/$(EXEC) |