Makefile 4.95 KB
Newer Older
tilman.metz's avatar
tilman.metz committed
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
# Makefile for SOFI3D 

#--------------------------------------------------------
# edit here

# source code for model generation (viscoelastic)
MODEL_SRC_V = hh_visco.c

# source code for model generation (elastic)
MODEL_SRC_E = hh_elastic.c

# source code for model generation (acoustic)
MODEL_SRC_A = hh_acoustic.c

# source code for benchmark model
MODEL_SRC_BENCH = benchmod.c

# Compiler (LAM: CC=hcc, CRAY T3E: CC=cc, SHARCNet: mpicc)

# On Linux cluster running LAM
# CC=hcc
# LFLAGS=-lm -lmpi
# CFLAGS=-g -Wall -O4

# On CRAY T3E
# CC=cc

# On Linux Cluster using OpenMPI
 CC=mpicc
30
 LFLAGS=-lm
tilman.metz's avatar
tilman.metz committed
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 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234
 CFLAGS=-Wall -O3

# On InstitutsCluster2 using intelMPI AND ITAC (no optimization)
# CC = mpicc
# LFLAGS = -tcollect
# CFLAGS = -tcollect -trace

# On InstitutsCluster2 using Open MPI and scalasca (no optimization)
#CC = skin mpicc
#LFLAGS =
#CFLAGS =-O3

#On InstitutsCluster2 using Open MPI and DDT (no optimization)
#CC = mpicc
#LFLAGS = -g
#CFLAGS = -g -O0 -i_dynamic


# On JUROPA cluster
#CC=mpicc
#LFLAGS=-lm
#CFLAGS=-O3 -ipo 


# On HLRN system
#CC=mpcc
#LFLAGS=-lm  

# ON Linux cluster ALTIX.RZ.UNI-KIEL:DE
#CC=icc
#CFLAGS=-mp -O3 -ip0q
#LFLAGS=-lmpi -lm

# ON Linux cluster ALTIX.HRZ.TU-FREIBERG.DE
#CC=icc
#CFLAGS=-mp -O3 -ip0
#LFLAGS=-lmpi -lm -i-static


# after this line, no further editing should be necessary
# --------------------------------------------------------

.c.o:
	$(CC) -c  $(CFLAGS) $<


SEISMERGE_SCR = seismerge.c


SNAPMERGE_SCR = \
	json_parser.c\
	merge.c \
	read_par_json.c \
	readdsk.c \
	snapmerge.c \
	util.c \
	writedsk.c 
	
	
PARTMODEL_SCR = \
	json_parser.c\
	part_model.c \
	read_par_json.c \
	util.c 	


SOFI3D_UTIL = \
		absorb.c \
		av_mat.c \
		comm_ini.c \
		catseis.c \
		info.c \
		initproc.c \
		initsour.c \
		json_parser.c\
		merge.c \
		mergemod.c \
		note.c \
		outseis.c \
		outseis_glob.c \
		output_source_signal.c \
		PML_ini.c \
		rd_sour.c \
		read_checkpoint.c\
		readdsk.c \
		read_par_json.c \
		exchange_par.c \
		receiver.c \
		save_checkpoint.c\
		saveseis.c \
		saveseis_glob.c \
		sources.c \
		splitrec.c \
		splitsrc.c \
		timing.c \
		util.c \
		wavelet.c \
		writedsk.c \
		writemod.c \
		writepar.c \
		zero_acoustic.c \
        zero.c \
		zero_elastic.c \
		zero_elastic_CPML.c \
		rwsegy.c

SOFI3D_SRC = \
		sofi3D.c \
		comm_ini_s.c \
		checkfd_ssg.c \
		CPML_coeff.c \
		CPML_ini_elastic.c\
		eqsource.c \
		seismo_ssg.c \
		matcopy.c \
		surface_ssg.c \
		surface_ssg_elastic.c \
		update_s_ssg.c \
		update_s_ssg_elastic.c \
		update_s_ssg_CPML.c \
		update_s_ssg_CPML_elastic.c \
		update_v_ssg.c \
		update_v_ssg_CPML.c \
		snap_ssg.c \
		exchange_v.c \
		exchange_s.c \
		psource.c \
		readmod.c \
		$(MODEL_SRC_E) \
		$(MODEL_SRC_V) \
		$(SOFI3D_UTIL) 
		
SOFI3D_SRC_BENCH = \
		sofi3D.c \
		comm_ini_s.c \
		checkfd_ssg.c \
		CPML_coeff.c \
		CPML_ini_elastic.c\
		eqsource.c \
		seismo_ssg.c \
		matcopy.c \
		surface_ssg.c \
		surface_ssg_elastic.c \
		update_s_ssg.c \
		update_s_ssg_elastic.c \
		update_s_ssg_CPML.c \
		update_s_ssg_CPML_elastic.c \
		update_v_ssg.c \
		update_v_ssg_CPML.c \
		snap_ssg.c \
		exchange_v.c \
		exchange_s.c \
		psource.c \
		readmod.c \
		$(MODEL_SRC_BENCH) \
		$(MODEL_SRC_V) \
		$(SOFI3D_UTIL)

SOFI3D_SRC_RSG = \
		sofi3D_rsg.c \
		checkfd_rsg.c \
		seismo_rsg.c \
		update_s_rsg.c \
		matcopy.c \
		update_v_rsg.c \
		snap_rsg.c \
		exchange_v_rsg.c \
		exchange_s_rsg.c \
		psource_rsg.c \
		$(MODEL_SRC_E) \
		$(MODEL_SRC_V) \
		$(SOFI3D_UTIL) 

SOFI3D_SRC_ACOUSTIC = \
		av_mat_acoustic.c \
		sofi3D_acoustic.c \
		checkfd_acoustic.c \
		comm_ini_acoustic.c \
		seismo_ssg_acoustic.c \
		matcopy_acoustic.c \
		surface_acoustic.c \
		PML_ini_acoustic.c \
		absorb_PML.c \
		update_s_acoustic.c \
		update_v_acoustic.c \
		update_s_acoustic_PML.c \
		update_v_acoustic_PML.c \
		snap_ssg_acoustic.c \
		exchange_v_acoustic.c \
		exchange_s_acoustic.c \
		psource_acoustic.c \
		readmod_acoustic.c \
		$(MODEL_SRC_A) \
		$(SOFI3D_UTIL) 

SOFI3D_OBJ = $(SOFI3D_SRC:%.c=%.o)
SOFI3D_OBJ_RSG = $(SOFI3D_SRC_RSG:%.c=%.o)
SOFI3D_OBJ_BENCH = $(SOFI3D_SRC_BENCH:%.c=%.o)
SOFI3D_OBJ_ACOUSTIC = $(SOFI3D_SRC_ACOUSTIC:%.c=%.o)

SNAPMERGE_OBJ = $(SNAPMERGE_SCR:%.c=%.o)
PARTMODEL_OBJ = $(PARTMODEL_SCR:%.c=%.o)
SEISMERGE_OBJ = $(SEISMERGE_SCR:%.c=%.o)

235 236 237
sofi3D:		$(SOFI3D_OBJ)
	$(CC) $(SOFI3D_OBJ) -o ../bin/sofi3D $(LFLAGS)

tilman.metz's avatar
tilman.metz committed
238
seismerge:	$(SEISMERGE_OBJ)
239
	$(CC) $(SEISMERGE_OBJ) -o ../bin/seismerge $(LFLAGS)
tilman.metz's avatar
tilman.metz committed
240 241

snapmerge:	$(SNAPMERGE_OBJ)
242
	$(CC) $(SNAPMERGE_OBJ) -o ../bin/snapmerge $(LFLAGS)
tilman.metz's avatar
tilman.metz committed
243 244
		
part_model:	$(PARTMODEL_OBJ)
245
	$(CC) $(PARTMODEL_OBJ) -o ../bin/partmodel $(LFLAGS)
tilman.metz's avatar
tilman.metz committed
246 247

#sofi3D_rsg: $(SOFI3D_OBJ_RSG)
248
#	$(CC) $(SOFI3D_OBJ_RSG) -o ../bin/sofi3D_rsg $(LFLAGS)
tilman.metz's avatar
tilman.metz committed
249 250

sofi3D_bench: $(SOFI3D_OBJ_BENCH)
251
	$(CC)  $(SOFI3D_OBJ_BENCH) -o ../bin/sofi3D_bench $(LFLAGS)
tilman.metz's avatar
tilman.metz committed
252 253

sofi3D_acoustic: $(SOFI3D_OBJ_ACOUSTIC)
254
	$(CC) $(SOFI3D_OBJ_ACOUSTIC) -o ../bin/sofi3D_acoustic $(LFLAGS)
tilman.metz's avatar
tilman.metz committed
255 256 257 258 259 260 261

clean:
	find . -name "*.o" -exec rm {} \;
	find . -name "*.bck" -exec rm {} \;
	find . -name "core" -exec rm {} \;

all: clean sofi3D sofi3D_acoustic snapmerge seismerge part_model