Makefile.am 16.9 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 \
46
47
    common_io.h single_io.h multipole.h map.h tools.h partition.h partition_fixed_costs.h \
    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
    star_formation_struct.h star_formation.h star_formation_iact.h \
56
    star_formation_logger.h star_formation_logger_struct.h \
57
    pressure_floor.h pressure_floor_struct.h pressure_floor_iact.h \
58
59
    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 \
60
    feedback.h feedback_struct.h feedback_properties.h task_order.h
61

62
63
64
# source files for EAGLE cooling
EAGLE_COOLING_SOURCES =
if HAVEEAGLECOOLING
65
EAGLE_COOLING_SOURCES += cooling/EAGLE/cooling.c cooling/EAGLE/cooling_tables.c
66
endif
67

68
69
70
71
72
73
# source files for EAGLE feedback
EAGLE_FEEDBACK_SOURCES =
if HAVEEAGLEFEEDBACK
EAGLE_FEEDBACK_SOURCES += feedback/EAGLE/feedback.c
endif

74
# Common source files
75
AM_SOURCES = space.c runner_main.c runner_doiact_hydro.c runner_doiact_limiter.c \
76
77
78
    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\
79
    queue.c task.c cell.c engine.c engine_maketasks.c engine_split_particles.c \
80
81
    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 \
82
    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
83
    kernel_hydro.c tools.c part.c partition.c clocks.c parser.c \
84
    physical_constants.c potential.c hydro_properties.c \
85
    threadpool.c cooling.c star_formation.c \
86
    statistics.c profiler.c dump.c logger.c \
87
    part_type.c xmf.c gravity_properties.c gravity.c \
88
    collectgroup.c hydro_space.c equation_of_state.c \
lhausamm's avatar
lhausamm committed
89
    chemistry.c cosmology.c restart.c mesh_gravity.c velociraptor_interface.c \
90
    outputlist.c velociraptor_dummy.c logger_io.c memuse.c mpiuse.c memuse_rnodes.c fof.c \
Loic Hausammann's avatar
Loic Hausammann committed
91
    hashmap.c pressure_floor.c \
92
    $(EAGLE_COOLING_SOURCES) $(EAGLE_FEEDBACK_SOURCES)
93
94

# Include files for distribution, not installation.
95
nobase_noinst_HEADERS = align.h approx_math.h atomic.h barrier.h cycle.h error.h inline.h kernel_hydro.h kernel_gravity.h \
96
97
98
		 gravity_iact.h kernel_long_gravity.h vector.h cache.h \
	         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 \
99
		 runner_doiact_functions_limiter.h runner_doiact_limiter.h units.h intrinsics.h minmax.h \
100
                 kick.h timestep.h drift.h adiabatic_index.h io_properties.h dimension.h part_type.h periodic.h memswap.h \
101
102
                 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 \
103
		 gravity/Default/gravity.h gravity/Default/gravity_iact.h gravity/Default/gravity_io.h \
104
		 gravity/Default/gravity_debug.h gravity/Default/gravity_part.h  \
105
106
		 gravity/Potential/gravity.h gravity/Potential/gravity_iact.h gravity/Potential/gravity_io.h \
		 gravity/Potential/gravity_debug.h gravity/Potential/gravity_part.h  \
107
108
		 gravity/MultiSoftening/gravity.h gravity/MultiSoftening/gravity_iact.h gravity/MultiSoftening/gravity_io.h \
		 gravity/MultiSoftening/gravity_debug.h gravity/MultiSoftening/gravity_part.h  \
109
		 equation_of_state.h \
110
		 equation_of_state/ideal_gas/equation_of_state.h equation_of_state/isothermal/equation_of_state.h \
111
	 	 hydro.h hydro_io.h hydro_parameters.h \
112
		 hydro/Minimal/hydro.h hydro/Minimal/hydro_iact.h hydro/Minimal/hydro_io.h \
113
                 hydro/Minimal/hydro_debug.h hydro/Minimal/hydro_part.h \
114
		 hydro/Minimal/hydro_parameters.h \
115
116
		 hydro/Default/hydro.h hydro/Default/hydro_iact.h hydro/Default/hydro_io.h \
                 hydro/Default/hydro_debug.h hydro/Default/hydro_part.h \
117
		 hydro/Default/hydro_parameters.h \
118
		 hydro/Gadget2/hydro.h hydro/Gadget2/hydro_iact.h hydro/Gadget2/hydro_io.h \
119
                 hydro/Gadget2/hydro_debug.h hydro/Gadget2/hydro_part.h \
120
		 hydro/Gadget2/hydro_parameters.h \
121
122
		 hydro/PressureEntropy/hydro.h hydro/PressureEntropy/hydro_iact.h hydro/PressureEntropy/hydro_io.h \
                 hydro/PressureEntropy/hydro_debug.h hydro/PressureEntropy/hydro_part.h \
123
		 hydro/PressureEntropy/hydro_parameters.h \
124
125
		 hydro/PressureEnergy/hydro.h hydro/PressureEnergy/hydro_iact.h hydro/PressureEnergy/hydro_io.h \
                 hydro/PressureEnergy/hydro_debug.h hydro/PressureEnergy/hydro_part.h \
126
		 hydro/PressureEnergy/hydro_parameters.h \
127
128
		 hydro/PressureEnergyMorrisMonaghanAV/hydro.h hydro/PressureEnergyMorrisMonaghanAV/hydro_iact.h hydro/PressureEnergyMorrisMonaghanAV/hydro_io.h \
                 hydro/PressureEnergyMorrisMonaghanAV/hydro_debug.h hydro/PressureEnergyMorrisMonaghanAV/hydro_part.h \
129
		 hydro/PressureEnergyMorrisMonaghanAV/hydro_parameters.h \
130
131
		 hydro/AnarchyPU/hydro.h hydro/PressureEnergy/hydro_iact.h hydro/PressureEnergy/hydro_io.h \
                 hydro/AnarchyPU/hydro_debug.h hydro/PressureEnergy/hydro_part.h \
132
		 hydro/AnarchyPU/hydro_parameters.h \
Josh Borrow's avatar
Josh Borrow committed
133
134
135
		 hydro/SPHENIX/hydro.h hydro/PressureEnergy/hydro_iact.h hydro/PressureEnergy/hydro_io.h \
                 hydro/SPHENIX/hydro_debug.h hydro/PressureEnergy/hydro_part.h \
		 hydro/SPHENIX/hydro_parameters.h \
136
137
138
139
		 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 \
140
141
142
143
                 hydro/Gizmo/hydro_gradients.h \
                 hydro/Gizmo/hydro_getters.h \
                 hydro/Gizmo/hydro_setters.h \
                 hydro/Gizmo/hydro_flux.h \
144
                 hydro/Gizmo/hydro_slope_limiters.h \
145
146
                 hydro/Gizmo/hydro_slope_limiters_face.h \
                 hydro/Gizmo/hydro_slope_limiters_cell.h \
147
148
149
                 hydro/Gizmo/hydro_unphysical.h \
                 hydro/Gizmo/hydro_gradients_sph.h \
                 hydro/Gizmo/hydro_gradients_gizmo.h \
150
                 hydro/Gizmo/hydro_velocities.h \
151
                 hydro/Gizmo/hydro_lloyd.h \
152
                 hydro/Gizmo/MFV/hydro_debug.h \
153
154
                 hydro/Gizmo/MFV/hydro_part.h \
                 hydro/Gizmo/MFV/hydro_velocities.h \
155
                 hydro/Gizmo/MFV/hydro_flux.h \
156
                 hydro/Gizmo/MFM/hydro_debug.h \
157
                 hydro/Gizmo/MFM/hydro_part.h \
158
                 hydro/Gizmo/MFM/hydro_flux.h \
159
                 hydro/Gizmo/MFM/hydro_velocities.h \
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
                 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 \
176
                 hydro/Shadowswift/hydro_parameters.h \
177
	         riemann/riemann_hllc.h riemann/riemann_trrs.h \
178
		 riemann/riemann_exact.h riemann/riemann_vacuum.h \
179
                 riemann/riemann_checks.h \
180
	 	 stars.h stars_io.h \
181
182
		 stars/Default/stars.h stars/Default/stars_iact.h stars/Default/stars_io.h \
		 stars/Default/stars_debug.h stars/Default/stars_part.h  \
183
184
		 stars/EAGLE/stars.h stars/EAGLE/stars_iact.h stars/EAGLE/stars_io.h \
		 stars/EAGLE/stars_debug.h stars/EAGLE/stars_part.h \
185
186
	         potential/none/potential.h potential/point_mass/potential.h \
                 potential/isothermal/potential.h potential/disc_patch/potential.h \
187
                 potential/sine_wave/potential.h \
188
		 star_formation/none/star_formation.h star_formation/none/star_formation_struct.h \
189
		 star_formation/none/star_formation_io.h star_formation/none/star_formation_iact.h \
190
		 star_formation/EAGLE/star_formation.h star_formation/EAGLE/star_formation_struct.h \
191
		 star_formation/EAGLE/star_formation_io.h star_formation/EAGLE/star_formation_iact.h \
Loic Hausammann's avatar
Loic Hausammann committed
192
		 star_formation/GEAR/star_formation.h star_formation/GEAR/star_formation_struct.h \
193
		 star_formation/GEAR/star_formation_io.h star_formation/GEAR/star_formation_iact.h \
194
195
196
197
                 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 \
198
                 cooling/none/cooling_io.h \
199
200
		 cooling/Compton/cooling.h cooling/Compton/cooling_struct.h \
                 cooling/Compton/cooling_io.h \
201
	         cooling/const_du/cooling.h cooling/const_du/cooling_struct.h \
202
                 cooling/const_du/cooling_io.h \
203
                 cooling/const_lambda/cooling.h cooling/const_lambda/cooling_struct.h \
204
                 cooling/const_lambda/cooling_io.h \
lhausamm's avatar
lhausamm committed
205
                 cooling/grackle/cooling.h cooling/grackle/cooling_struct.h \
206
                 cooling/grackle/cooling_io.h \
207
		 cooling/EAGLE/cooling.h cooling/EAGLE/cooling_struct.h cooling/EAGLE/cooling_tables.h \
208
                 cooling/EAGLE/cooling_io.h cooling/EAGLE/interpolate.h cooling/EAGLE/cooling_rates.h \
lhausamm's avatar
lhausamm committed
209
210
                 chemistry/none/chemistry.h \
		 chemistry/none/chemistry_io.h \
lhausamm's avatar
lhausamm committed
211
		 chemistry/none/chemistry_struct.h \
212
		 chemistry/none/chemistry_iact.h \
213
214
215
216
                 chemistry/GEAR/chemistry.h \
		 chemistry/GEAR/chemistry_io.h \
		 chemistry/GEAR/chemistry_struct.h \
		 chemistry/GEAR/chemistry_iact.h \
217
218
                 chemistry/EAGLE/chemistry.h \
		 chemistry/EAGLE/chemistry_io.h \
219
		 chemistry/EAGLE/chemistry_struct.h\
220
		 chemistry/EAGLE/chemistry_iact.h \
221
222
	         entropy_floor/none/entropy_floor.h \
                 entropy_floor/EAGLE/entropy_floor.h \
223
224
225
		 tracers/none/tracers.h tracers/none/tracers_struct.h \
                 tracers/none/tracers_io.h \
		 tracers/EAGLE/tracers.h tracers/EAGLE/tracers_struct.h \
226
                 tracers/EAGLE/tracers_io.h \
227
228
229
230
231
	         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 \
232
                 black_holes/Default/black_holes.h black_holes/Default/black_holes_io.h \
233
		 black_holes/Default/black_holes_part.h black_holes/Default/black_holes_iact.h \
234
                 black_holes/Default/black_holes_properties.h \
235
                 black_holes/Default/black_holes_struct.h \
236
                 black_holes/EAGLE/black_holes.h black_holes/EAGLE/black_holes_io.h \
237
		 black_holes/EAGLE/black_holes_part.h black_holes/EAGLE/black_holes_iact.h \
238
                 black_holes/EAGLE/black_holes_properties.h black_holes/EAGLE/black_holes_parameters.h \
239
                 black_holes/EAGLE/black_holes_struct.h \
240
241
		 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 \
242
		 pressure_floor/GEAR/pressure_floor_struct.h pressure_floor/none/pressure_floor_struct.h \
243
	         task_order/GEAR/task_order.h task_order/EAGLE/task_order.h task_order/none/task_order.h
244

245

246
247
248
249
250
251
252
253
254
255
# Sources and special flags for the gravity library
libgrav_la_SOURCES = runner_doiact_grav.c
libgrav_la_CFLAGS = $(AM_CFLAGS) $(GRAVITY_CFLAGS) 
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)

256
257
# Sources and flags for regular library
libswiftsim_la_SOURCES = $(AM_SOURCES)
258
libswiftsim_la_CFLAGS = $(AM_CFLAGS)
259
260
libswiftsim_la_LDFLAGS = $(AM_LDFLAGS) $(EXTRA_LIBS) -version-info 0:0:0
libswiftsim_la_LIBADD = $(GRACKLE_LIBS) $(VELOCIRAPTOR_LIBS) libgrav.la
261
262
263

# Sources and flags for MPI library
libswiftsim_mpi_la_SOURCES = $(AM_SOURCES)
264
libswiftsim_mpi_la_CFLAGS = $(AM_CFLAGS) $(MPI_FLAGS)
265
libswiftsim_mpi_la_LDFLAGS = $(AM_LDFLAGS) $(MPI_LIBS) $(EXTRA_LIBS) -version-info 0:0:0
266
libswiftsim_mpi_la_SHORTNAME = mpi
267
libswiftsim_mpi_la_LIBADD = $(GRACKLE_LIBS) $(VELOCIRAPTOR_LIBS) $(MPI_LIBS) libgrav_mpi.la
268

Matthieu Schaller's avatar
Matthieu Schaller committed
269
# Versioning. If any sources change then update the version_string.h file with
270
# the current git revision and package version.
Matthieu Schaller's avatar
Matthieu Schaller committed
271
# May have a checkout without a version_string.h file and no git command (tar/zip
272
# download), allow that, but make sure we know it.
273
version_string.h: version_string.h.in Makefile $(AM_SOURCES) $(include_HEADERS) $(noinst_HEADERS)
274
	if test "X$(GIT_CMD)" != "X"; then \
275
276
277
	    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`; \
278
	    sed -e "s,@PACKAGE_VERSION\@,$(PACKAGE_VERSION)," \
279
	        -e "s,@GIT_REVISION\@,$${GIT_REVISION}," \
280
	        -e "s|@GIT_BRANCH\@|$${GIT_BRANCH}|" \
281
	        -e "s|@GIT_DATE\@|$${GIT_DATE}|" \
282
	        -e "s|@SWIFT_CFLAGS\@|$(CFLAGS)|" $< > version_string.h; \
283
	else \
Matthieu Schaller's avatar
Matthieu Schaller committed
284
	    if test ! -f version_string.h; then \
285
	        sed -e "s,@PACKAGE_VERSION\@,$(PACKAGE_VERSION)," \
286
	            -e "s,@GIT_REVISION\@,unknown," \
287
		    -e "s,@GIT_BRANCH\@,unknown," \
288
		    -e "s,@GIT_DATE\@,unknown," \
289
	            -e "s|@SWIFT_CFLAGS\@|$(CFLAGS)|" $< > version_string.h; \
290
	    fi; \
291
	fi
292

Matthieu Schaller's avatar
Matthieu Schaller committed
293
294
#  Make sure version_string.h is built first.
BUILT_SOURCES = version_string.h
295

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