forked from AI4EarthLab/OpenArray
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.mpich
More file actions
95 lines (62 loc) · 2.37 KB
/
Copy pathMakefile.mpich
File metadata and controls
95 lines (62 loc) · 2.37 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name = main
compile_thread = -j8
#if you put the exteranl libaray in one directory
#EXT_INCLUDE = $(addprefix -I, $(shell find ${EXT_PATH}/include -maxdepth 1 -type d))
#EXT_LIB = -L${EXT_PATH}/lib64/
#JIT_LIB = ${EXT_PATH}/lib64/
EXT_LIB_LINK = -lpnetcdf -ldl \
-lgfortran
oplevel0 = -O0 -w -g -std=c++0x -D_WITHOUT_LLVM_ -DSUNWAY
oplevel3 = -O3 -O3 -w -g -std=c++0x -D_WITHOUT_LLVM_ -DSUNWAY
FC = mpif90 ${oplevel0}
CC = mpicc ${oplevel0}
CXX = mpicxx ${oplevel0}
FCFLAGS =
CXXFLAGS =
CFLAGS =
LIBS = -lstdc++ ${EXT_LIB} ${EXT_LIB_LINK}
OBJS = $(addsuffix .o, $(basename $(wildcard *.cpp))) \
$(addsuffix .o, $(basename $(wildcard utils/*.cpp))) \
$(addsuffix .o, $(basename $(wildcard c-interface/*.cpp))) \
$(addsuffix .o, $(basename $(wildcard modules/*/*.cpp)))
OBJ_FORTRAN_LIB = ${OBJS} fortran/oa_utils.o fortran/oa_type.o fortran/oa_cache.o fortran/oa_init.o fortran/oa_interpolation.o fortran/oa_io.o fortran/oa_mat_mult.o fortran/oa_min_max.o fortran/oa_mpi.o fortran/oa_option.o fortran/oa_partition.o fortran/oa_rep.o fortran/oa_set.o fortran/oa_set_with_mask.o fortran/oa_shift.o fortran/oa_sub.o fortran/oa_sum.o fortran/oa_mod.o
#OBJ_FORTRAN_LIB = ${OBJS} \
# $(addsuffix .o, $(basename $(wildcard fortran/*.F90)))
OBJ_FORTRAN = ${OBJ_FORTRAN_LIB} test/oa_test.o test/oa_main.o
OBJ_MANUAL = user-manual/oa_main.o
.DEFAULT_GOAL := all
MAKEFILE = makefile.intel
AA = $(wildcard *.cpp) $(wildcard modules/*/*.cpp)
debug:
@echo ${OBJS}
%.o: %.cpp
$(CXX) ${EXT_INCLUDE} -c $(CXXFLAGS) $< -o $@
%.o: %.c
$(CXX) ${EXT_INCLUDE} -c $(CFLAGS) $< -o $@
%.o: %.F90
$(FC) ${FCFLAGS} -c $< -o $@
#%.d: %.cpp
# $(CXX) ${EXT_INCLUDE} -c $(CXXFLAGS) $< -o $*.o -MMD
#
#%.d: %.c
# $(CXX) ${EXT_INCLUDE} -c $(CFLAGS) $< -o $*.o -MMD
#%.d: %.F90
# $(FC) ${FCFLAGS} -c $< -o $*.o -gen-dep=$*.d
-include $(OBJ_FORTRAN_LIB:.o=.d)
#-include $(OBJ_FORTRAN:.o=.d)
#-include $(OBJ_MAIN:.o=.d)
#-include $(OBJ_TEST:.o=.d)
#-include $(OBJ_TEST_PERF:.o=.d)
manual_main : ${OBJ_MANUAL}
-${FC} -o manual_main ${OBJ_MANUAL} \
${EXT_LIB_LINK} ${LIBS} -lgfortran -L. -lopenarray -lm -ldl -lstdc++ -lpnetcdf -lpthread
oalib_obj: ${OBJ_FORTRAN_LIB}
@ar rcs libopenarray.a ${OBJ_FORTRAN_LIB}
clean:
@find . -name "*.o" \
-or -name "*.d*" \
-or -name "*.mod" \
-or -name "main" \
-or -name "fortran_main" \
-or -name "testall_main" | \
xargs rm -f &>/dev/null