Makefile 4.13 KB
Newer Older
Florian Wittkamp's avatar
Florian Wittkamp committed
1
# Makefile for IFOS2D
Tilman Steinweg's avatar
Tilman Steinweg committed
2 3 4 5 6 7 8 9

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

# source code for model generation

#MODEL = hh.c
MODEL = ../genmod/1D_linear_gradient_visc.c
10
MODEL_AC = ../genmod/1D_linear_gradient_ac.c
11
MODEL_EL = ../genmod/1D_linear_gradient_el.c
Florian Wittkamp's avatar
Florian Wittkamp committed
12
MODEL_VAC = ../genmod/1D_linear_gradient_viscac.c
Tilman Steinweg's avatar
Tilman Steinweg committed
13 14
EXEC= ../bin

Florian Wittkamp's avatar
Florian Wittkamp committed
15 16 17 18 19 20 21
# Description:
# CC = Compiler
# LFLAGS = Linker flag
# CFLAGS = Compiler flag

# LINUX with OpenMPI / IntelMPI and INTEL Compiler
# Use icc whenever possible, this will be much faster than gcc
22
CC=mpicc
Tilman Steinweg's avatar
Tilman Steinweg committed
23 24 25 26 27
LFLAGS=-lm -lcseife -lstfinv -laff -lfourierxx -lfftw3 -lstdc++
CFLAGS=-O3
SFLAGS=-L./../contrib/libcseife -L./../contrib/bin
IFLAGS=-I./../contrib/libcseife -I./../contrib/header -I.

Florian Wittkamp's avatar
Florian Wittkamp committed
28 29 30 31 32 33
# LINUX with OpenMPI / IntelMPI and GCC Compiler
#CC=mpicc
#LFLAGS=-lm -lcseife -lstfinv -laff -lfourierxx -lfftw3 -lstdc++
#CFLAGS=-O3
#SFLAGS=-L./../contrib/libcseife -L./../contrib/bin
#IFLAGS=-I./../contrib/libcseife -I./../contrib/header -I.
Tilman Steinweg's avatar
Tilman Steinweg committed
34

Florian Wittkamp's avatar
Florian Wittkamp committed
35 36 37 38
ifeq ($(TERM_PROGRAM),Apple_Terminal)
LFLAGS=-lm -lcseife -lstfinv -laff -lfourierxx -lfftw3 -lc++
CC=mpicc
endif
Tilman Steinweg's avatar
Tilman Steinweg committed
39 40 41 42

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

Florian Wittkamp's avatar
Florian Wittkamp committed
43 44 45 46 47
# -------------
# pattern rules
# -------------

%.o: %.c
Tilman Steinweg's avatar
Tilman Steinweg committed
48
	$(CC) $(CFLAGS) -o $@ -c $< $(IFLAGS)
Florian Wittkamp's avatar
Florian Wittkamp committed
49 50 51 52 53 54 55 56 57
	$(CC) $(CFLAGS) -MM $*.c $(IFLAGS) > $*.d

SNAPMERGE_OBJ = $(SNAPMERGE_SCR:%.c=%.o)

IFOS_OBJ = $(IFOS2D:%.c=%.o)

# -------------
# Dependencies
# -------------
Tilman Steinweg's avatar
Tilman Steinweg committed
58 59 60 61 62 63 64 65 66 67 68

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


Florian Wittkamp's avatar
Florian Wittkamp committed
69 70
IFOS2D= \
	IFOS2D.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
71 72
	stf.c \
	window_cos.c \
73
	alloc_sections.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
74
	calc_mat_change_test.c \
Florian Wittkamp's avatar
Florian Wittkamp committed
75
    	calc_res.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
76
	calc_misfit.c \
Florian Wittkamp's avatar
Florian Wittkamp committed
77
    	calc_opt_step.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
78 79 80 81 82 83 84 85 86 87 88 89 90
	calc_energy.c \
	checkfd.c \
	checkfd_ssg_elastic.c \
	checkfd_ssg_visc.c \
	conv_FD.c \
	count_killed_traces.c \
	psource.c \
	holbergcoeff.c\
	comm_ini.c\
	exchange_v.c \
	exchange_s.c \
	exchange_p.c \
	snap_ssg.c \
Florian Wittkamp's avatar
Florian Wittkamp committed
91
   	snap_ssg_SH.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
92 93 94 95 96 97
	seismo_ssg.c \
	surface_elastic_PML.c \
	surface_acoustic_PML.c \
	surface_PML.c \
	update_v_ssg.c \
	update_v_PML.c \
98
	update_v_PML_SH.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
99 100 101 102 103
	update_v_acoustic_PML.c \
	prepare_update_s.c \
	update_p_PML.c \
	update_s_elastic_ssg.c \
	update_s_elastic_PML.c \
Florian Wittkamp's avatar
Florian Wittkamp committed
104
    	update_s_elastic_PML_SH.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
105
	update_s_visc_PML.c \
Florian Wittkamp's avatar
Florian Wittkamp committed
106
    	update_s_visc_PML_SH.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
107 108 109 110 111 112 113 114 115 116 117 118 119 120
	av_mue.c \
	av_rho.c \
	av_tau.c \
	median2D.c \
	exchange_par.c \
	info.c \
	inseis.c \
	inseis_source_wavelet.c \
	initproc.c \
	interpol.c \
	json_parser.c \
	LBFGS.c \
	smooth.c \
	$(MODEL) \
121
	$(MODEL_AC) \
122
	$(MODEL_EL) \
Florian Wittkamp's avatar
Florian Wittkamp committed
123
    	$(MODEL_VAC) \
Tilman Steinweg's avatar
Tilman Steinweg committed
124 125 126 127 128 129 130 131 132 133 134 135
	matcopy.c \
	matcopy_elastic.c \
	matcopy_acoustic.c \
	mergemod.c \
	max_grad.c \
	note.c \
	norm.c \
	outseis_vector.c \
	outseis_glob.c \
	catseis.c \
	output_source_signal.c \
	PCG.c \
136
	PCG_SH.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
137 138 139 140 141 142
	PML_pro.c \
	readdsk.c \
	read_par_json.c \
	readmod.c \
	readmod_elastic.c \
	readmod_acoustic.c \
Florian Wittkamp's avatar
Florian Wittkamp committed
143
    	receiver.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
144
	rd_sour.c \
Florian Wittkamp's avatar
Florian Wittkamp committed
145 146
    	read_workflow.c \
    	apply_workflow.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
	saveseis_glob.c \
	sources.c \
	solvelin.c \
	spat_filt.c \
	splitsrc.c \
	splitsrc_back.c \
	splitrec.c \
	stalta.c \
	taper.c \
	taper_grad.c \
	taper_grad_shot.c \
	timedomain_filt.c \
	timedomain_filt_vector.c \
	time_window.c \
	util.c \
	wavelet.c \
	wavelet_stf.c \
	writemod.c \
	write_par.c \
	writedsk.c \
	zero_fdveps.c \
	zero_fdveps_ac.c \
	zero_fdveps_visc.c \
	calc_envelope.c \
Florian Wittkamp's avatar
Florian Wittkamp committed
171 172 173 174
    	joint_inversion.c \
    	matrix_operations.c \
    	wolfe_condition.c \
    	calc_hilbert.c \
175 176
	eprecond.c \
	eprecond1.c \
Florian Wittkamp's avatar
Florian Wittkamp committed
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
    	zero_fdveps_viscac.c \
    	update_p_visc_PML.c \
    	matcopy_viscac.c \
    	prepare_update_p.c \
    	readmod_viscac.c \
    	time_window_glob.c \
    	create_trkill_table.c \
    	filter_frequencies.c

# -------------
# Targes
# -------------

IFOS2D:		$(IFOS_OBJ) fd.h
	$(CC) $(SFLAGS) $(IFOS_OBJ) -o $(EXEC)/IFOS2D $(LFLAGS)
Tilman Steinweg's avatar
Tilman Steinweg committed
192

Florian Wittkamp's avatar
Florian Wittkamp committed
193
all: IFOS2D snapmerge
Tilman Steinweg's avatar
Tilman Steinweg committed
194 195 196 197

snapmerge:	$(SNAPMERGE_OBJ)
	$(CC) $(SFLAGS) $(SNAPMERGE_OBJ) -o ../bin/snapmerge $(LFLAGS)

Florian Wittkamp's avatar
Florian Wittkamp committed
198
.PHONY: clean
Tilman Steinweg's avatar
Tilman Steinweg committed
199
clean:
Florian Wittkamp's avatar
Florian Wittkamp committed
200
	find . -name "*.d" -exec rm {} \;
Tilman Steinweg's avatar
Tilman Steinweg committed
201 202 203
	find . -name "*.o" -exec rm {} \; 
	find . -name "*.c%" -exec rm {} \;
	find . -name "*.bck" -exec rm {} \;
Florian Wittkamp's avatar
Florian Wittkamp committed
204
	find ../genmod -name "*.o" -exec rm {} \;
Florian Wittkamp's avatar
Florian Wittkamp committed
205 206 207 208
	find ../genmod -name "*.d" -exec rm {} \;

install: clean all

209
-include $(IFOS_OBJ:.o=.d)