Makefile.am 10.1 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
19
# Add the non-standard paths to the included library headers
AM_CFLAGS = $(HDF5_CPPFLAGS) $(GSL_INCS) $(FFTW_INCS)
Pedro Gonnet's avatar
Pedro Gonnet committed
20
21

# Assign a "safe" version number
lhausamm's avatar
lhausamm committed
22
AM_LDFLAGS = $(HDF5_LDFLAGS) $(FFTW_LIBS) -version-info 0:0:0
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) $(PROFILER_LIBS) $(TCMALLOC_LIBS) $(JEMALLOC_LIBS) $(TBBMALLOC_LIBS) $(GRACKLE_LIB) $(GSL_LIBS)
29
30

# MPI libraries.
31
MPI_LIBS = $(METIS_LIBS) $(MPI_THREAD_LIBS)
lhausamm's avatar
lhausamm committed
32
MPI_FLAGS = -DWITH_MPI $(METIS_INCS)
33

34
35
# Build the libswiftsim library
lib_LTLIBRARIES = libswiftsim.la
36
37
38
39
# Build a MPI-enabled version too?
if HAVEMPI
lib_LTLIBRARIES += libswiftsim_mpi.la
endif
Pedro Gonnet's avatar
Pedro Gonnet committed
40
41

# List required headers
Pedro Gonnet's avatar
Pedro Gonnet committed
42
include_HEADERS = space.h runner.h queue.h task.h lock.h cell.h part.h const.h \
43
    engine.h swift.h serial_io.h timers.h debug.h scheduler.h proxy.h parallel_io.h \
44
    common_io.h single_io.h multipole.h map.h tools.h partition.h clocks.h parser.h \
45
    physical_constants.h physical_constants_cgs.h potential.h version.h \
46
47
    hydro_properties.h riemann.h threadpool.h cooling_io.h cooling.h cooling_struct.h \
    sourceterms.h sourceterms_struct.h statistics.h memswap.h cache.h runner_doiact_vec.h profiler.h \
48
    dump.h logger.h active.h timeline.h xmf.h gravity_properties.h gravity_derivatives.h \
lhausamm's avatar
lhausamm committed
49
    gravity_softened_derivatives.h vector_power.h collectgroup.h hydro_space.h sort_part.h \
50
    chemistry.h chemistry_io.h chemistry_struct.h cosmology.h restart.h space_getsid.h utilities.h \
51
    mesh_gravity.h cbrt.h velociraptor_interface.h swift_velociraptor_part.h outputlist.h
52
53
54

# Common source files
AM_SOURCES = space.c runner.c queue.c task.c cell.c engine.c \
55
    serial_io.c timers.c debug.c scheduler.c proxy.c parallel_io.c \
56
    units.c common_io.c single_io.c multipole.c version.c map.c \
Matthieu Schaller's avatar
Matthieu Schaller committed
57
    kernel_hydro.c tools.c part.c partition.c clocks.c parser.c \
58
    physical_constants.c potential.c hydro_properties.c \
59
    threadpool.c cooling.c sourceterms.c \
60
    statistics.c runner_doiact_vec.c profiler.c dump.c logger.c \
61
    part_type.c xmf.c gravity_properties.c gravity.c \
62
    collectgroup.c hydro_space.c equation_of_state.c \
lhausamm's avatar
lhausamm committed
63
    chemistry.c cosmology.c restart.c mesh_gravity.c velociraptor_interface.c \
64
    outputlist.c
65
66

# Include files for distribution, not installation.
67
nobase_noinst_HEADERS = align.h approx_math.h atomic.h barrier.h cycle.h error.h inline.h kernel_hydro.h kernel_gravity.h \
68
		 gravity_iact.h kernel_long_gravity.h vector.h cache.h runner_doiact.h runner_doiact_vec.h runner_doiact_grav.h  \
69
                 runner_doiact_nosort.h units.h intrinsics.h minmax.h kick.h timestep.h drift.h adiabatic_index.h io_properties.h \
70
		 dimension.h part_type.h periodic.h memswap.h dump.h logger.h sign.h \
71
		 gravity.h gravity_io.h gravity_cache.h \
72
		 gravity/Default/gravity.h gravity/Default/gravity_iact.h gravity/Default/gravity_io.h \
73
		 gravity/Default/gravity_debug.h gravity/Default/gravity_part.h  \
74
75
		 gravity/Potential/gravity.h gravity/Potential/gravity_iact.h gravity/Potential/gravity_io.h \
		 gravity/Potential/gravity_debug.h gravity/Potential/gravity_part.h  \
Tom Theuns's avatar
Tom Theuns committed
76
		 sourceterms.h \
77
		 equation_of_state.h \
78
		 equation_of_state/ideal_gas/equation_of_state.h equation_of_state/isothermal/equation_of_state.h \
79
	 	 hydro.h hydro_io.h \
80
		 hydro/Minimal/hydro.h hydro/Minimal/hydro_iact.h hydro/Minimal/hydro_io.h \
81
                 hydro/Minimal/hydro_debug.h hydro/Minimal/hydro_part.h \
82
83
84
		 hydro/Default/hydro.h hydro/Default/hydro_iact.h hydro/Default/hydro_io.h \
                 hydro/Default/hydro_debug.h hydro/Default/hydro_part.h \
		 hydro/Gadget2/hydro.h hydro/Gadget2/hydro_iact.h hydro/Gadget2/hydro_io.h \
85
                 hydro/Gadget2/hydro_debug.h hydro/Gadget2/hydro_part.h \
86
87
		 hydro/PressureEntropy/hydro.h hydro/PressureEntropy/hydro_iact.h hydro/PressureEntropy/hydro_io.h \
                 hydro/PressureEntropy/hydro_debug.h hydro/PressureEntropy/hydro_part.h \
88
89
90
91
92
93
94
95
96
97
98
		 hydro/GizmoMFV/hydro.h hydro/GizmoMFV/hydro_iact.h \
                 hydro/GizmoMFV/hydro_io.h hydro/GizmoMFV/hydro_debug.h \
                 hydro/GizmoMFV/hydro_part.h \
                 hydro/GizmoMFV/hydro_gradients_gizmo.h \
                 hydro/GizmoMFV/hydro_gradients.h \
                 hydro/GizmoMFV/hydro_gradients_sph.h \
                 hydro/GizmoMFV/hydro_slope_limiters_cell.h \
                 hydro/GizmoMFV/hydro_slope_limiters_face.h \
                 hydro/GizmoMFV/hydro_slope_limiters.h \
                 hydro/GizmoMFV/hydro_unphysical.h \
                 hydro/GizmoMFV/hydro_velocities.h \
99
100
101
102
103
104
105
106
107
108
		 hydro/GizmoMFM/hydro.h hydro/GizmoMFM/hydro_iact.h \
                 hydro/GizmoMFM/hydro_io.h hydro/GizmoMFM/hydro_debug.h \
                 hydro/GizmoMFM/hydro_part.h \
                 hydro/GizmoMFM/hydro_gradients_gizmo.h \
                 hydro/GizmoMFM/hydro_gradients.h \
                 hydro/GizmoMFM/hydro_gradients_sph.h \
                 hydro/GizmoMFM/hydro_slope_limiters_cell.h \
                 hydro/GizmoMFM/hydro_slope_limiters_face.h \
                 hydro/GizmoMFM/hydro_slope_limiters.h \
                 hydro/GizmoMFM/hydro_unphysical.h \
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
                 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 \
125
	         riemann/riemann_hllc.h riemann/riemann_trrs.h \
126
		 riemann/riemann_exact.h riemann/riemann_vacuum.h \
127
                 riemann/riemann_checks.h \
128
	 	 stars.h stars_io.h \
129
130
		 stars/Default/stars.h stars/Default/stars_iact.h stars/Default/stars_io.h \
		 stars/Default/stars_debug.h stars/Default/stars_part.h  \
131
132
	         potential/none/potential.h potential/point_mass/potential.h \
                 potential/isothermal/potential.h potential/disc_patch/potential.h \
133
                 potential/sine_wave/potential.h \
134
		 cooling/none/cooling.h cooling/none/cooling_struct.h \
135
                 cooling/none/cooling_io.h \
136
	         cooling/const_du/cooling.h cooling/const_du/cooling_struct.h \
137
                 cooling/const_du/cooling_io.h \
138
                 cooling/const_lambda/cooling.h cooling/const_lambda/cooling_struct.h \
139
                 cooling/const_lambda/cooling_io.h \
lhausamm's avatar
lhausamm committed
140
                 cooling/grackle/cooling.h cooling/grackle/cooling_struct.h \
141
                 cooling/grackle/cooling_io.h \
142
		 cooling/EAGLE/cooling.h cooling/EAGLE/cooling_struct.h \
143
                 cooling/EAGLE/cooling_io.h \
lhausamm's avatar
lhausamm committed
144
145
                 chemistry/none/chemistry.h \
		 chemistry/none/chemistry_io.h \
lhausamm's avatar
lhausamm committed
146
		 chemistry/none/chemistry_struct.h \
147
		 chemistry/none/chemistry_iact.h \
148
149
150
151
                 chemistry/GEAR/chemistry.h \
		 chemistry/GEAR/chemistry_io.h \
		 chemistry/GEAR/chemistry_struct.h \
		 chemistry/GEAR/chemistry_iact.h \
152
153
                 chemistry/EAGLE/chemistry.h \
		 chemistry/EAGLE/chemistry_io.h \
154
155
		 chemistry/EAGLE/chemistry_struct.h\
		 chemistry/EAGLE/chemistry_iact.h
156

157

158
159
# Sources and flags for regular library
libswiftsim_la_SOURCES = $(AM_SOURCES)
160
161
libswiftsim_la_CFLAGS = $(AM_CFLAGS)
libswiftsim_la_LDFLAGS = $(AM_LDFLAGS) $(EXTRA_LIBS)
162
libswiftsim_la_LIBADD = $(GRACKLE_LIBS) $(VELOCIRAPTOR_LIBS)
163
164
165

# Sources and flags for MPI library
libswiftsim_mpi_la_SOURCES = $(AM_SOURCES)
166
167
libswiftsim_mpi_la_CFLAGS = $(AM_CFLAGS) $(MPI_FLAGS)
libswiftsim_mpi_la_LDFLAGS = $(AM_LDFLAGS) $(MPI_LIBS) $(EXTRA_LIBS)
168
libswiftsim_mpi_la_SHORTNAME = mpi
169
libswiftsim_mpi_la_LIBADD = $(GRACKLE_LIBS) $(VELOCIRAPTOR_LIBS)
Pedro Gonnet's avatar
Pedro Gonnet committed
170

171

Matthieu Schaller's avatar
Matthieu Schaller committed
172
# Versioning. If any sources change then update the version_string.h file with
173
# the current git revision and package version.
Matthieu Schaller's avatar
Matthieu Schaller committed
174
# May have a checkout without a version_string.h file and no git command (tar/zip
175
# download), allow that, but make sure we know it.
Matthieu Schaller's avatar
Matthieu Schaller committed
176
version_string.h: version_string.h.in $(AM_SOURCES) $(include_HEADERS) $(noinst_HEADERS)
177
	if test "X$(GIT_CMD)" != "X"; then \
178
	    GIT_REVISION=`$(GIT_CMD) describe --abbrev=8  --always --tags --dirty`; \
179
	    GIT_BRANCH=`$(GIT_CMD) branch | sed -n 's/^\* \(.*\)/\1/p'`; \
180
            GIT_DATE=`$(GIT_CMD) log -1 --format=%ci`; \
181
	    sed -e "s,@PACKAGE_VERSION\@,$(PACKAGE_VERSION)," \
182
	        -e "s,@GIT_REVISION\@,$${GIT_REVISION}," \
183
	        -e "s|@GIT_BRANCH\@|$${GIT_BRANCH}|" \
184
	        -e "s|@GIT_DATE\@|$${GIT_DATE}|" \
185
	        -e "s|@SWIFT_CFLAGS\@|$(CFLAGS)|" $< > version_string.h; \
186
	else \
Matthieu Schaller's avatar
Matthieu Schaller committed
187
	    if test ! -f version_string.h; then \
188
	        sed -e "s,@PACKAGE_VERSION\@,$(PACKAGE_VERSION)," \
189
	            -e "s,@GIT_REVISION\@,unknown," \
190
		    -e "s,@GIT_BRANCH\@,unknown," \
191
		    -e "s,@GIT_DATE\@,unknown," \
192
	            -e "s|@SWIFT_CFLAGS\@|$(CFLAGS)|" $< > version_string.h; \
193
	    fi; \
194
	fi
195

Matthieu Schaller's avatar
Matthieu Schaller committed
196
197
#  Make sure version_string.h is built first.
BUILT_SOURCES = version_string.h
198

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