Makefile_AMDiS.mk 4.17 KB
Newer Older
1
2
3
4
5
6
PARMETIS_DIR = $(AMDIS_DIR)/lib/ParMetis-3.1

# ============================================================================
# ===== includes pathes ======================================================
# ============================================================================

7
AMDIS_INCLUDE = -I$(AMDIS_DIR)/include -I$(AMDIS_DIR)/include/compositeFEM -I$(AMDIS_DIR)/include/reinit -I$(AMDIS_DIR)/include/mtl4
8
9
10
PARMETIS_INCLUDE = -I$(PARMETIS_DIR)
PARALLEL_INCLUDE = -I$(AMDIS_DIR)/src/parallel

11
INCLUDES = -I. $(AMDIS_INCLUDE) $(PARALLEL_INCLUDE)
12
13
14
15
16

# ============================================================================
# ===== libraries ============================================================
# ============================================================================

17
AMDIS_LIB = -L$(AMDIS_DIR)/lib -lamdis -lcompositeFEM -lreinit
18
PNG_LIB = 
19
LIBS =
20

21
UMFPACK_LIB = 
22
23
24
25
26
27
28
ifeq ($(strip $(USE_SERVER)), mars)
	UMFPACK_LIB += -lmkl -lumfpack -lamd
else
	ifeq ($(strip $(USE_SERVER)), themisto)
		UMFPACK_LIB += $(MKL_LIB) -lmkl -lguide -lpthread -lumfpack -lamd
	else	
		ifeq ($(strip $(USE_SERVER)), deimos)
29
#			LIBS += -L/fastfs/wir/local/lib
30
31
32
33
34
35
36
37
38
			MPI_DIR = /licsoft/libraries/openmpi/1.2.6/64bit
			UMFPACK_LIB += -lumfpack -lamd -L/licsoft/libraries/goto -lgoto -lpthread
		else
			UMFPACK_LIB += -lblas -lumfpack -lamd
		endif
	endif
endif

PARMETIS_LIB = -L$(PARMETIS_DIR) -lparmetis -lmetis
39
ZOLTAN_LIB = -L$(AMDIS_DIR)/lib/zoltan_build/lib -lzoltan
40

41
LIBS += $(AMDIS_LIB) $(PNG_LIB)
42
LIBS += -lboost_iostreams -lboost_filesystem -lboost_system -lboost_date_time
43
44
45

ifeq ($(strip $(USE_UMFPACK)), 1)
	LIBS += $(UMFPACK_LIB)
Thomas Witkowski's avatar
Thomas Witkowski committed
46
	CPPFLAGS += -DHAVE_UMFPACK -DMTL_HAS_UMFPACK
47
	INCLUDES += -I$(AMDIS_DIR)/include/umfpack -I$(AMDIS_DIR)/include/ufconfig -I$(AMDIS_DIR)/include/amd
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
endif

ifeq ($(strip $(USE_MKL)), 1)
	ifeq ($(strip $(USE_SERVER)), themisto)
		LIBS += $(MKL_LIB) 
	else
		LIBS += -L$(MKL_LIB) 
	endif

	LIBS += -lmkl -lmkl_solver -lguide -lpthread
endif

# ============================================================================
# ===== parallel or sequential ? =============================================
# ============================================================================

ifeq ($(strip $(USE_PARALLEL_AMDIS)), 1)
Thomas Witkowski's avatar
Thomas Witkowski committed
65
66
67
68
	include ${PETSC_DIR}/conf/variables
	CFLAGS = ${PETSC_CC_INCLUDES}
	FFLAGS = ${PETSC_FC_INCLUDES}

69
70
71
72
73
74
75
76
77
78
	ifeq ($(strip $(USE_SERVER)), mars)
		ifeq ($(strip $(USE_COMPILER)), gcc)
			COMPILE = g++
		else
			COMPILE = icpc
		endif
	else
		COMPILE = $(MPI_DIR)/bin/mpiCC
	endif

79
	CPPFLAGS += -DHAVE_PARALLEL_DOMAIN_AMDIS
Thomas Witkowski's avatar
Thomas Witkowski committed
80
81
	INCLUDES += $(PETSC_INCLUDE)
	LIBS += $(PARMETIS_LIB) -lmpi $(PETSC_LIB)
82
	LIBS += $(ZOLTAN_LIB)
83
84
85
86
87
88
89
90
else
	ifeq ($(strip $(USE_COMPILER)), gcc)
		COMPILE = g++
	else
		COMPILE = icpc
	endif
endif

91
92
93
94
ifeq ($(strip $(USE_MARMOT)), 1)
	COMPILE = marmotcxx
endif

95
96
97
98
99
# ============================================================================
# ===== compile flags ========================================================
# ============================================================================

ifeq ($(strip $(DEBUG)), 0)
Thomas Witkowski's avatar
Thomas Witkowski committed
100
       CPPFLAGS += -g -O3 -DNDEBUG
101
else
Thomas Witkowski's avatar
Thomas Witkowski committed
102
       CPPFLAGS += -g -O0 -DDEBUG=1
103
104
endif

105
106
107
108
# ============================================================================
# ===== object directory =====================================================
# ============================================================================
ifeq ($(OBJDIR),)
109
	OBJDIR = .
110
endif
111
112
113
114
115
# ============================================================================
# ===== libtool linking ======================================================
# ============================================================================

LIBTOOL = $(AMDIS_DIR)/libtool
Thomas Witkowski's avatar
Thomas Witkowski committed
116
117
118
119
120
121

ifeq ($(strip $(USE_PARALLEL_AMDIS)), 1)
	LINK = $(LIBTOOL) --tag=mpiCC --mode=link $(COMPILE)
else
	LINK = $(LIBTOOL) --mode=link $(COMPILE)
endif
122
123
124
125
126
127
128
129
130

# ============================================================================
# ===== rules ================================================================
# ============================================================================

all : 
	make $(PROGRAMS)

clean: 
Backofen, Rainer's avatar
Backofen, Rainer committed
131
	-rm -rf $(OBJDIR)/*.o
132
133
134
	-rm -rf $(PROGRAMS)

.cc.o: $*.cc
135
	$(COMPILE) $(DEFS) $(INCLUDES) $(CPPFLAGS) -c -o $(OBJDIR)/$*.o $^ 
136
137
138