-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·57 lines (42 loc) · 1.44 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
CXX := g++
CUXX := nvcc
CXXFLAGS := -fopenmp #-std=c++17 -pedantic-errors -Wall -Wextra -Werror
CUXXFLAGS := #-std=c++17 -pedantic-errors -Wall -Wextra -Werror
#LDFLAGS := -L/usr/lib -L/opt/cuda/include -lstdc++ -lm -lcudart
#LDFLAGS := -L/usr/lib -L/usr/lib/cuda -lstdc++ -lm -lcudart
LDFLAGS := #-L/usr/include/cuda -L/usr/lib/cuda -lstdc++ -lm -lcudart
OBJ_DIR := obj
APP_DIR := bin
TARGET := seis_fwi
INCLUDE := -Iinclude -Iinclude/cpu
INCLUDE_CUDA := #-Iinclude/cuda
#-I/usr/include/hdf5
SRC := $(wildcard src/*.cpp) $(wildcard src/cpu/*.cpp) $(wildcard ext/*/*.cpp)
SRC_CUDA := #$(wildcard src/cuda/*.cu)
LIB = #ext/inih/*.o
OBJECTS := $(SRC:%.cpp=$(OBJ_DIR)/%.o) #$(SRC_CUDA:%.cu=$(OBJ_DIR)/%.o) $(LIB)
all: build $(APP_DIR)/$(TARGET)
$(OBJ_DIR)/%.o: %.cpp
@mkdir -p $(@D)
$(CXX) $(CXXFLAGS) $(INCLUDE) $(INCLUDE_CUDA) -c $< -o $@ $(LDFLAGS)
#$(OBJ_DIR)/%.o: %.cu
# @mkdir -p $(@D)
# $(CUXX) $(CUXXFLAGS) $(INCLUDE_CUDA) -c $< -o $@ $(LDFLAGS)
$(APP_DIR)/$(TARGET): $(OBJECTS)
@mkdir -p $(@D)
$(CXX) $(CXXFLAGS) -o $(APP_DIR)/$(TARGET) $^ $(LDFLAGS)
.PHONY: all build clean debug release
build:
@mkdir -p $(APP_DIR)
@mkdir -p $(OBJ_DIR)
debug: CXXFLAGS += -DDEBUG -g
debug: all
release: CXXFLAGS += -O2
release: all
run:
python3 ./scripts/pre_proc_fwi.py
$(APP_DIR)/$(TARGET)
python3 ./scripts/post_proc.py
clean:
-@rm -rvf $(OBJ_DIR)/*
-@rm -rvf $(APP_DIR)/*