Makefile.am 10.4 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) $(GRACKLE_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_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
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 \
lhausamm's avatar
lhausamm committed
51
52
    mesh_gravity.h cbrt.h velociraptor_interface.h swift_velociraptor_part.h outputlist.h \
    logger_io.h
53
54
55

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

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

161

162
163
# Sources and flags for regular library
libswiftsim_la_SOURCES = $(AM_SOURCES)
164
165
libswiftsim_la_CFLAGS = $(AM_CFLAGS)
libswiftsim_la_LDFLAGS = $(AM_LDFLAGS) $(EXTRA_LIBS)
166
libswiftsim_la_LIBADD = $(GRACKLE_LIBS) $(VELOCIRAPTOR_LIBS)
167
168
169

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

175

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

Matthieu Schaller's avatar
Matthieu Schaller committed
200
201
#  Make sure version_string.h is built first.
BUILT_SOURCES = version_string.h
202

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