Makefile.am 18.7 KB
Newer Older
1
# This file is part of SWIFT.
2
# Copyright (c) 2012 Pedro Gonnet (pedro.gonnet@durham.ac.uk),
3
#                    Matthieu Schaller (matthieu.schaller@durham.ac.uk).
4
#
Pedro Gonnet's avatar
Pedro Gonnet committed
5
6
7
8
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
9
#
Pedro Gonnet's avatar
Pedro Gonnet committed
10
11
12
13
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
14
#
Pedro Gonnet's avatar
Pedro Gonnet committed
15
16
17
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

18
# Add the non-standard paths to the included library headers
19
AM_CFLAGS = $(HDF5_CPPFLAGS) $(GSL_INCS) $(FFTW_INCS) $(NUMA_INCS) $(GRACKLE_INCS)
Pedro Gonnet's avatar
Pedro Gonnet committed
20
21

# Assign a "safe" version number
22
AM_LDFLAGS = $(HDF5_LDFLAGS) $(FFTW_LIBS)
Pedro Gonnet's avatar
Pedro Gonnet committed
23

24
25
26
# The git command, if available.
GIT_CMD = @GIT_CMD@

27
# Additional dependencies for shared libraries.
28
EXTRA_LIBS = $(HDF5_LIBS) $(FFTW_LIBS) $(NUMA_LIBS) $(PROFILER_LIBS) $(TCMALLOC_LIBS) $(JEMALLOC_LIBS) $(TBBMALLOC_LIBS) $(GRACKLE_LIBS) $(GSL_LIBS)
29
30

# MPI libraries.
31
32
MPI_LIBS = $(PARMETIS_LIBS) $(METIS_LIBS) $(MPI_THREAD_LIBS)
MPI_FLAGS = -DWITH_MPI $(PARMETIS_INCS) $(METIS_INCS)
33

34
# Build the libswiftsim library and a convenience library just for the gravity tasks
35
lib_LTLIBRARIES = libswiftsim.la
36
noinst_LTLIBRARIES = libgrav.la 
37
38
39
# Build a MPI-enabled version too?
if HAVEMPI
lib_LTLIBRARIES += libswiftsim_mpi.la
40
noinst_LTLIBRARIES += libgrav_mpi.la
41
endif
Pedro Gonnet's avatar
Pedro Gonnet committed
42
43

# List required headers
Pedro Gonnet's avatar
Pedro Gonnet committed
44
include_HEADERS = space.h runner.h queue.h task.h lock.h cell.h part.h const.h \
45
    engine.h swift.h serial_io.h timers.h debug.h scheduler.h proxy.h parallel_io.h \
Matthieu Schaller's avatar
Matthieu Schaller committed
46
    common_io.h single_io.h map.h tools.h partition.h partition_fixed_costs.h \
47
    clocks.h parser.h physical_constants.h physical_constants_cgs.h potential.h version.h \
48
    hydro_properties.h riemann.h threadpool.h cooling_io.h cooling.h cooling_struct.h \
49
    statistics.h memswap.h cache.h runner_doiact_hydro_vec.h profiler.h entropy_floor.h \
50
    dump.h logger.h active.h timeline.h xmf.h gravity_properties.h gravity_derivatives.h \
lhausamm's avatar
lhausamm committed
51
    gravity_softened_derivatives.h vector_power.h collectgroup.h hydro_space.h sort_part.h \
52
    chemistry.h chemistry_io.h chemistry_struct.h cosmology.h restart.h space_getsid.h utilities.h \
53
    mesh_gravity.h cbrt.h exp10.h velociraptor_interface.h swift_velociraptor_part.h outputlist.h \
54
    logger_io.h tracers_io.h tracers.h tracers_struct.h star_formation_io.h fof.h fof_struct.h fof_io.h \
55
    multipole.h multipole_accept.h multipole_struct.h binomial.h \
56
    star_formation_struct.h star_formation.h star_formation_iact.h \
57
    star_formation_logger.h star_formation_logger_struct.h \
58
    pressure_floor.h pressure_floor_struct.h pressure_floor_iact.h \
59
60
    velociraptor_struct.h velociraptor_io.h random.h memuse.h mpiuse.h memuse_rnodes.h \
    black_holes.h black_holes_io.h black_holes_properties.h black_holes_struct.h \
Loic Hausammann's avatar
Loic Hausammann committed
61
62
    feedback.h feedback_struct.h feedback_properties.h task_order.h \
    space_unique_id.h
63

64
65
66
67
68
69
# source files for EAGLE cooling
QLA_COOLING_SOURCES =
if HAVEQLACOOLING
QLA_COOLING_SOURCES += cooling/QLA/cooling.c cooling/QLA/cooling_tables.c
endif

70
71
72
# source files for EAGLE cooling
EAGLE_COOLING_SOURCES =
if HAVEEAGLECOOLING
73
EAGLE_COOLING_SOURCES += cooling/EAGLE/cooling.c cooling/EAGLE/cooling_tables.c
74
endif
75

76
77
78
79
80
81
# source files for EAGLE feedback
EAGLE_FEEDBACK_SOURCES =
if HAVEEAGLEFEEDBACK
EAGLE_FEEDBACK_SOURCES += feedback/EAGLE/feedback.c
endif

Loic Hausammann's avatar
Gear    
Loic Hausammann committed
82
83
84
85
86
87
# source files for GRACKLE cooling
GRACKLE_COOLING_SOURCES =
if HAVEGRACKLECOOLING
GRACKLE_COOLING_SOURCES += cooling/grackle/cooling.c
endif

Matthieu Schaller's avatar
Matthieu Schaller committed
88
# source files for GEAR feedback
Loic Hausammann's avatar
Gear    
Loic Hausammann committed
89
90
91
92
93
94
GEAR_FEEDBACK_SOURCES =
if HAVEGEARFEEDBACK
GEAR_FEEDBACK_SOURCES += feedback/GEAR/stellar_evolution.c feedback/GEAR/feedback.c \
	feedback/GEAR/initial_mass_function.c feedback/GEAR/supernovae_ia.c feedback/GEAR/supernovae_ii.c
endif

95
# Common source files
96
AM_SOURCES = space.c runner_main.c runner_doiact_hydro.c runner_doiact_limiter.c \
97
98
99
    runner_doiact_stars.c runner_doiact_black_holes.c runner_ghost.c runner_recv.c \
    runner_sort.c runner_drift.c runner_black_holes.c runner_time_integration.c \
    runner_doiact_hydro_vec.c runner_others.c\
100
    queue.c task.c cell.c engine.c engine_maketasks.c engine_split_particles.c \
101
102
    engine_marktasks.c engine_drift.c engine_unskip.c engine_collect_end_of_step.c \
    engine_redistribute.c engine_fof.c serial_io.c timers.c debug.c scheduler.c \
103
    proxy.c parallel_io.c units.c common_io.c single_io.c multipole.c version.c map.c \
Matthieu Schaller's avatar
Matthieu Schaller committed
104
    kernel_hydro.c tools.c part.c partition.c clocks.c parser.c \
105
    physical_constants.c potential.c hydro_properties.c \
106
    threadpool.c cooling.c star_formation.c \
107
    statistics.c profiler.c dump.c logger.c \
108
    part_type.c xmf.c gravity_properties.c gravity.c \
109
    collectgroup.c hydro_space.c equation_of_state.c \
lhausamm's avatar
lhausamm committed
110
    chemistry.c cosmology.c restart.c mesh_gravity.c velociraptor_interface.c \
111
    outputlist.c velociraptor_dummy.c logger_io.c memuse.c mpiuse.c memuse_rnodes.c fof.c \
Loic Hausammann's avatar
Loic Hausammann committed
112
    hashmap.c pressure_floor.c space_unique_id.c \
113
    $(QLA_COOLING_SOURCES) \
Matthieu Schaller's avatar
Matthieu Schaller committed
114
115
    $(EAGLE_COOLING_SOURCES) $(EAGLE_FEEDBACK_SOURCES) \
    $(GRACKLE_COOLING_SOURCES) $(GEAR_FEEDBACK_SOURCES)
116
117

# Include files for distribution, not installation.
118
nobase_noinst_HEADERS = align.h approx_math.h atomic.h barrier.h cycle.h error.h inline.h kernel_hydro.h kernel_gravity.h \
119
		 gravity_iact.h kernel_long_gravity.h vector.h accumulate.h cache.h \
120
121
	         runner_doiact_nosort.h runner_doiact_hydro.h runner_doiact_stars.h runner_doiact_black_holes.h runner_doiact_grav.h \
                 runner_doiact_functions_hydro.h runner_doiact_functions_stars.h runner_doiact_functions_black_holes.h \
122
		 runner_doiact_functions_limiter.h runner_doiact_limiter.h units.h intrinsics.h minmax.h \
123
                 kick.h timestep.h drift.h adiabatic_index.h io_properties.h dimension.h part_type.h periodic.h memswap.h \
124
125
                 timestep_limiter.h timestep_limiter_iact.h timestep_sync.h timestep_sync_part.h timestep_limiter_struct.h \
                 dump.h logger.h sign.h logger_io.h hashmap.h gravity.h gravity_io.h gravity_cache.h \
126
		 gravity/Default/gravity.h gravity/Default/gravity_iact.h gravity/Default/gravity_io.h \
127
		 gravity/Default/gravity_debug.h gravity/Default/gravity_part.h  \
128
129
		 gravity/Potential/gravity.h gravity/Potential/gravity_iact.h gravity/Potential/gravity_io.h \
		 gravity/Potential/gravity_debug.h gravity/Potential/gravity_part.h  \
130
131
		 gravity/MultiSoftening/gravity.h gravity/MultiSoftening/gravity_iact.h gravity/MultiSoftening/gravity_io.h \
		 gravity/MultiSoftening/gravity_debug.h gravity/MultiSoftening/gravity_part.h  \
132
		 equation_of_state.h \
133
		 equation_of_state/ideal_gas/equation_of_state.h equation_of_state/isothermal/equation_of_state.h \
134
	 	 hydro.h hydro_io.h hydro_parameters.h \
135
		 hydro/Minimal/hydro.h hydro/Minimal/hydro_iact.h hydro/Minimal/hydro_io.h \
136
                 hydro/Minimal/hydro_debug.h hydro/Minimal/hydro_part.h \
137
		 hydro/Minimal/hydro_parameters.h \
138
139
		 hydro/Default/hydro.h hydro/Default/hydro_iact.h hydro/Default/hydro_io.h \
                 hydro/Default/hydro_debug.h hydro/Default/hydro_part.h \
140
		 hydro/Default/hydro_parameters.h \
141
		 hydro/Gadget2/hydro.h hydro/Gadget2/hydro_iact.h hydro/Gadget2/hydro_io.h \
142
                 hydro/Gadget2/hydro_debug.h hydro/Gadget2/hydro_part.h \
143
		 hydro/Gadget2/hydro_parameters.h \
144
145
		 hydro/PressureEntropy/hydro.h hydro/PressureEntropy/hydro_iact.h hydro/PressureEntropy/hydro_io.h \
                 hydro/PressureEntropy/hydro_debug.h hydro/PressureEntropy/hydro_part.h \
146
		 hydro/PressureEntropy/hydro_parameters.h \
147
148
		 hydro/PressureEnergy/hydro.h hydro/PressureEnergy/hydro_iact.h hydro/PressureEnergy/hydro_io.h \
                 hydro/PressureEnergy/hydro_debug.h hydro/PressureEnergy/hydro_part.h \
149
		 hydro/PressureEnergy/hydro_parameters.h \
150
151
		 hydro/PressureEnergyMorrisMonaghanAV/hydro.h hydro/PressureEnergyMorrisMonaghanAV/hydro_iact.h hydro/PressureEnergyMorrisMonaghanAV/hydro_io.h \
                 hydro/PressureEnergyMorrisMonaghanAV/hydro_debug.h hydro/PressureEnergyMorrisMonaghanAV/hydro_part.h \
152
		 hydro/PressureEnergyMorrisMonaghanAV/hydro_parameters.h \
153
154
		 hydro/AnarchyPU/hydro.h hydro/AnarchyPU/hydro_iact.h hydro/AnarchyPU/hydro_io.h \
                 hydro/AnarchyPU/hydro_debug.h hydro/AnarchyPU/hydro_part.h \
155
		 hydro/AnarchyPU/hydro_parameters.h \
156
157
		 hydro/SPHENIX/hydro.h hydro/SPHENIX/hydro_iact.h hydro/SPHENIX/hydro_io.h \
                 hydro/SPHENIX/hydro_debug.h hydro/SPHENIX/hydro_part.h \
Josh Borrow's avatar
Josh Borrow committed
158
		 hydro/SPHENIX/hydro_parameters.h \
159
160
161
162
		 hydro/Gizmo/hydro_parameters.h \
                 hydro/Gizmo/hydro_io.h hydro/Gizmo/hydro_debug.h \
                 hydro/Gizmo/hydro.h hydro/Gizmo/hydro_iact.h \
                 hydro/Gizmo/hydro_part.h \
163
164
165
166
                 hydro/Gizmo/hydro_gradients.h \
                 hydro/Gizmo/hydro_getters.h \
                 hydro/Gizmo/hydro_setters.h \
                 hydro/Gizmo/hydro_flux.h \
167
                 hydro/Gizmo/hydro_slope_limiters.h \
168
169
                 hydro/Gizmo/hydro_slope_limiters_face.h \
                 hydro/Gizmo/hydro_slope_limiters_cell.h \
170
171
172
                 hydro/Gizmo/hydro_unphysical.h \
                 hydro/Gizmo/hydro_gradients_sph.h \
                 hydro/Gizmo/hydro_gradients_gizmo.h \
173
                 hydro/Gizmo/hydro_velocities.h \
174
                 hydro/Gizmo/hydro_lloyd.h \
175
                 hydro/Gizmo/MFV/hydro_debug.h \
176
177
                 hydro/Gizmo/MFV/hydro_part.h \
                 hydro/Gizmo/MFV/hydro_velocities.h \
178
                 hydro/Gizmo/MFV/hydro_flux.h \
179
                 hydro/Gizmo/MFM/hydro_debug.h \
180
                 hydro/Gizmo/MFM/hydro_part.h \
181
                 hydro/Gizmo/MFM/hydro_flux.h \
182
                 hydro/Gizmo/MFM/hydro_velocities.h \
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
                 hydro/Shadowswift/hydro_debug.h \
                 hydro/Shadowswift/hydro_gradients.h hydro/Shadowswift/hydro.h \
                 hydro/Shadowswift/hydro_iact.h \
                 hydro/Shadowswift/hydro_io.h \
                 hydro/Shadowswift/hydro_part.h \
                 hydro/Shadowswift/hydro_slope_limiters_cell.h \
                 hydro/Shadowswift/hydro_slope_limiters_face.h \
                 hydro/Shadowswift/hydro_slope_limiters.h \
                 hydro/Shadowswift/voronoi1d_algorithm.h \
                 hydro/Shadowswift/voronoi1d_cell.h \
                 hydro/Shadowswift/voronoi2d_algorithm.h \
                 hydro/Shadowswift/voronoi2d_cell.h \
                 hydro/Shadowswift/voronoi3d_algorithm.h \
                 hydro/Shadowswift/voronoi3d_cell.h \
                 hydro/Shadowswift/voronoi_algorithm.h \
                 hydro/Shadowswift/voronoi_cell.h \
199
                 hydro/Shadowswift/hydro_parameters.h \
200
	         riemann/riemann_hllc.h riemann/riemann_trrs.h \
201
		 riemann/riemann_exact.h riemann/riemann_vacuum.h \
202
                 riemann/riemann_checks.h \
203
	 	 stars.h stars_io.h \
204
205
		 stars/Default/stars.h stars/Default/stars_iact.h stars/Default/stars_io.h \
		 stars/Default/stars_debug.h stars/Default/stars_part.h  \
206
207
		 stars/EAGLE/stars.h stars/EAGLE/stars_iact.h stars/EAGLE/stars_io.h \
		 stars/EAGLE/stars_debug.h stars/EAGLE/stars_part.h \
Loic Hausammann's avatar
Gear    
Loic Hausammann committed
208
209
		 stars/GEAR/stars.h stars/GEAR/stars_iact.h stars/GEAR/stars_io.h \
		 stars/GEAR/stars_debug.h stars/GEAR/stars_part.h \
210
211
	         potential/none/potential.h potential/point_mass/potential.h \
                 potential/isothermal/potential.h potential/disc_patch/potential.h \
212
                 potential/sine_wave/potential.h \
213
		 star_formation/none/star_formation.h star_formation/none/star_formation_struct.h \
214
		 star_formation/none/star_formation_io.h star_formation/none/star_formation_iact.h \
215
216
		 star_formation/QLA/star_formation.h star_formation/QLA/star_formation_struct.h \
		 star_formation/QLA/star_formation_io.h star_formation/QLA/star_formation_iact.h \
217
		 star_formation/EAGLE/star_formation.h star_formation/EAGLE/star_formation_struct.h \
218
		 star_formation/EAGLE/star_formation_io.h star_formation/EAGLE/star_formation_iact.h \
Loic Hausammann's avatar
Loic Hausammann committed
219
		 star_formation/GEAR/star_formation.h star_formation/GEAR/star_formation_struct.h \
220
		 star_formation/GEAR/star_formation_io.h star_formation/GEAR/star_formation_iact.h \
221
222
223
224
                 star_formation/EAGLE/star_formation_logger.h star_formation/EAGLE/star_formation_logger_struct.h \
                 star_formation/GEAR/star_formation_logger.h star_formation/GEAR/star_formation_logger_struct.h \
                 star_formation/none/star_formation_logger.h star_formation/none/star_formation_logger_struct.h \
                 cooling/none/cooling.h cooling/none/cooling_struct.h \
225
                 cooling/none/cooling_io.h \
226
227
		 cooling/Compton/cooling.h cooling/Compton/cooling_struct.h \
                 cooling/Compton/cooling_io.h \
228
	         cooling/const_du/cooling.h cooling/const_du/cooling_struct.h \
229
                 cooling/const_du/cooling_io.h \
230
                 cooling/const_lambda/cooling.h cooling/const_lambda/cooling_struct.h \
231
                 cooling/const_lambda/cooling_io.h \
lhausamm's avatar
lhausamm committed
232
                 cooling/grackle/cooling.h cooling/grackle/cooling_struct.h \
233
                 cooling/grackle/cooling_io.h \
234
		 cooling/EAGLE/cooling.h cooling/EAGLE/cooling_struct.h cooling/EAGLE/cooling_tables.h \
235
                 cooling/EAGLE/cooling_io.h cooling/EAGLE/interpolate.h cooling/EAGLE/cooling_rates.h \
236
237
		 cooling/QLA/cooling.h cooling/QLA/cooling_struct.h cooling/QLA/cooling_tables.h \
                 cooling/QLA/cooling_io.h cooling/QLA/interpolate.h cooling/QLA/cooling_rates.h \
lhausamm's avatar
lhausamm committed
238
239
                 chemistry/none/chemistry.h \
		 chemistry/none/chemistry_io.h \
lhausamm's avatar
lhausamm committed
240
		 chemistry/none/chemistry_struct.h \
241
		 chemistry/none/chemistry_iact.h \
242
243
244
245
                 chemistry/GEAR/chemistry.h \
		 chemistry/GEAR/chemistry_io.h \
		 chemistry/GEAR/chemistry_struct.h \
		 chemistry/GEAR/chemistry_iact.h \
246
247
                 chemistry/EAGLE/chemistry.h \
		 chemistry/EAGLE/chemistry_io.h \
248
		 chemistry/EAGLE/chemistry_struct.h\
249
		 chemistry/EAGLE/chemistry_iact.h \
250
251
252
253
                 chemistry/QLA/chemistry.h \
		 chemistry/QLA/chemistry_io.h \
		 chemistry/QLA/chemistry_struct.h\
		 chemistry/QLA/chemistry_iact.h \
254
255
	         entropy_floor/none/entropy_floor.h \
                 entropy_floor/EAGLE/entropy_floor.h \
256
                 entropy_floor/QLA/entropy_floor.h \
257
258
259
		 tracers/none/tracers.h tracers/none/tracers_struct.h \
                 tracers/none/tracers_io.h \
		 tracers/EAGLE/tracers.h tracers/EAGLE/tracers_struct.h \
260
                 tracers/EAGLE/tracers_io.h \
261
262
263
264
265
	         feedback/none/feedback.h feedback/none/feedback_struct.h feedback/none/feedback_iact.h \
                 feedback/none/feedback_properties.h \
	         feedback/EAGLE/feedback.h feedback/EAGLE/feedback_struct.h feedback/EAGLE/feedback_iact.h \
                 feedback/EAGLE/feedback_properties.h feedback/EAGLE/imf.h feedback/EAGLE/interpolate.h \
                 feedback/EAGLE/yield_tables.h \
Loic Hausammann's avatar
Gear    
Loic Hausammann committed
266
267
268
269
270
		 feedback/GEAR/stellar_evolution_struct.h feedback/GEAR/stellar_evolution.h \
		 feedback/GEAR/feedback.h feedback/GEAR/feedback_iact.h \
		 feedback/GEAR/feedback_properties.h feedback/GEAR/feedback_struct.h \
                 feedback/GEAR/initial_mass_function.h feedback/GEAR/supernovae_ia.h feedback/GEAR/supernovae_ii.h \
                 feedback/GEAR/lifetime.h feedback/GEAR/hdf5_functions.h feedback/GEAR/interpolation.h \
271
                 black_holes/Default/black_holes.h black_holes/Default/black_holes_io.h \
272
		 black_holes/Default/black_holes_part.h black_holes/Default/black_holes_iact.h \
273
                 black_holes/Default/black_holes_properties.h \
274
                 black_holes/Default/black_holes_struct.h \
275
                 black_holes/EAGLE/black_holes.h black_holes/EAGLE/black_holes_io.h \
276
		 black_holes/EAGLE/black_holes_part.h black_holes/EAGLE/black_holes_iact.h \
277
                 black_holes/EAGLE/black_holes_properties.h black_holes/EAGLE/black_holes_parameters.h \
278
                 black_holes/EAGLE/black_holes_struct.h \
279
280
		 pressure_floor/GEAR/pressure_floor.h pressure_floor/none/pressure_floor.h \
		 pressure_floor/GEAR/pressure_floor_iact.h pressure_floor/none/pressure_floor_iact.h \
281
		 pressure_floor/GEAR/pressure_floor_struct.h pressure_floor/none/pressure_floor_struct.h \
Loic Hausammann's avatar
Loic Hausammann committed
282
	         task_order/GEAR/task_order.h task_order/EAGLE/task_order.h task_order/default/task_order.h
283

284

285
286
# Sources and special flags for the gravity library
libgrav_la_SOURCES = runner_doiact_grav.c
Loic Hausammann's avatar
Gear    
Loic Hausammann committed
287
libgrav_la_CFLAGS = $(AM_CFLAGS) $(GRAVITY_CFLAGS)
288
289
290
291
292
293
294
libgrav_la_LDFLAGS = $(AM_LDFLAGS) $(EXTRA_LIBS)

# Sources and special flags for the gravity MPI library
libgrav_mpi_la_SOURCES = runner_doiact_grav.c
libgrav_mpi_la_CFLAGS = $(AM_CFLAGS) $(GRAVITY_CFLAGS) -DWITH_MPI
libgrav_mpi_la_LDFLAGS = $(AM_LDFLAGS) $(MPI_LIBS) $(EXTRA_LIBS)

295
296
# Sources and flags for regular library
libswiftsim_la_SOURCES = $(AM_SOURCES)
297
libswiftsim_la_CFLAGS = $(AM_CFLAGS)
298
299
libswiftsim_la_LDFLAGS = $(AM_LDFLAGS) $(EXTRA_LIBS) -version-info 0:0:0
libswiftsim_la_LIBADD = $(GRACKLE_LIBS) $(VELOCIRAPTOR_LIBS) libgrav.la
300
301
302

# Sources and flags for MPI library
libswiftsim_mpi_la_SOURCES = $(AM_SOURCES)
303
libswiftsim_mpi_la_CFLAGS = $(AM_CFLAGS) $(MPI_FLAGS)
304
libswiftsim_mpi_la_LDFLAGS = $(AM_LDFLAGS) $(MPI_LIBS) $(EXTRA_LIBS) -version-info 0:0:0
305
libswiftsim_mpi_la_SHORTNAME = mpi
306
libswiftsim_mpi_la_LIBADD = $(GRACKLE_LIBS) $(VELOCIRAPTOR_LIBS) $(MPI_LIBS) libgrav_mpi.la
307

Matthieu Schaller's avatar
Matthieu Schaller committed
308
# Versioning. If any sources change then update the version_string.h file with
309
# the current git revision and package version.
Matthieu Schaller's avatar
Matthieu Schaller committed
310
# May have a checkout without a version_string.h file and no git command (tar/zip
311
# download), allow that, but make sure we know it.
312
version_string.h: version_string.h.in Makefile $(AM_SOURCES) $(include_HEADERS) $(noinst_HEADERS)
313
	if test "X$(GIT_CMD)" != "X"; then \
314
315
316
	    GIT_REVISION=`$(GIT_CMD) describe --abbrev=8  --always --tags --dirty 2>/dev/null`; \
	    GIT_BRANCH=`$(GIT_CMD) branch 2>/dev/null | sed -n 's/^\* \(.*\)/\1/p' 2>/dev/null`; \
            GIT_DATE=`$(GIT_CMD) log -1 --format=%ci 2>/dev/null`; \
317
	    sed -e "s,@PACKAGE_VERSION\@,$(PACKAGE_VERSION)," \
318
	        -e "s,@GIT_REVISION\@,$${GIT_REVISION}," \
319
	        -e "s|@GIT_BRANCH\@|$${GIT_BRANCH}|" \
320
	        -e "s|@GIT_DATE\@|$${GIT_DATE}|" \
321
	        -e "s|@SWIFT_CFLAGS\@|$(CFLAGS)|" $< > version_string.h; \
322
	else \
Matthieu Schaller's avatar
Matthieu Schaller committed
323
	    if test ! -f version_string.h; then \
324
	        sed -e "s,@PACKAGE_VERSION\@,$(PACKAGE_VERSION)," \
325
	            -e "s,@GIT_REVISION\@,unknown," \
326
		    -e "s,@GIT_BRANCH\@,unknown," \
327
		    -e "s,@GIT_DATE\@,unknown," \
328
	            -e "s|@SWIFT_CFLAGS\@|$(CFLAGS)|" $< > version_string.h; \
329
	    fi; \
330
	fi
331

Matthieu Schaller's avatar
Matthieu Schaller committed
332
333
#  Make sure version_string.h is built first.
BUILT_SOURCES = version_string.h
334

335
#  And distribute the built files.
Matthieu Schaller's avatar
Matthieu Schaller committed
336
EXTRA_DIST = version_string.h version_string.h.in