Commit a8b4503a authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch 'autotools-update' into 'master'

Autotools update

Fix problem configuring against HDF5 without CFLAGS and LDFLAGS set.

Fix problem building without MPI support.

Improve the installation documentation.

See merge request !27

Former-commit-id: ac0293bd397169e4e42eaad4e3163bd1624c6490
parents 97b002d5 b43a132e
......@@ -58,10 +58,35 @@ for instance. GCC address sanitizer flags can be included using the
option. Note this requires a GCC compiler version of at least 4.8.
Dependencies: needs to be filled in...
SWIFT currently requires a compiler with OpenMP support.
Dependencies
============
SWIFT depends on a number of thirdparty libraries that should be available
before you can build it.
HDF5: a HDF5 library is required to read and write particle data. One of the
commands "h5cc" or "h5pcc" should be available. If "h5pcc" is located them a
parallel HDF5 built for the version of MPI located should be provided. If
the command is not available then it can be located using the "--with-hfd5"
configure option. The value should be the full path to the "h5cc" or "h5pcc"
commands.
MPI: an optional MPI library that fully supports MPI_THREAD_MULTIPLE.
Before running configure the "mpirun" command should be available in the
shell.
METIS: a build of the METIS library can be optionally used to optimize the
load between MPI nodes (requires an MPI library). This should be found in the
standard installation directories, or pointed at using the "--with-metis"
configuration option. In this case the top-level installation directory of
the METIS build should be given. Note to use METIS you should at least supply
"--with-metis".
DOXYGEN: the doxygen library is required to create the SWIFT API documentation.
......@@ -67,6 +67,7 @@ if test "$enable_mpi" = "yes"; then
AC_PATH_PROG([MPIRUN],[mpirun],[notfound])
if test "$MPIRUN" = "notfound"; then
AC_MSG_WARN([Cannot find mpirun command on PATH, thread support may not be correct])
enable_mpi="no"
else
# Special options we know about.
# Intel: -mt_mpi
......@@ -105,9 +106,7 @@ if test "$enable_mpi" = "yes"; then
AC_SUBST([MPI_THREAD_LIBS])
fi
fi
AM_CONDITIONAL([HAVEMPI],[test -n "$MPICC"])
AM_CONDITIONAL([HAVEMPI],[test $enable_mpi = "yes"])
# Need C99 and inline support.
AC_PROG_CC_C99
......@@ -199,22 +198,25 @@ fi
# don't use that.
AC_ARG_WITH([metis],
[AS_HELP_STRING([--with-metis=PATH],
[prefix where the metis library is installed @<:@default=yes@:>@]
[root directory where metis is installed @<:@default=yes@:>@]
)],
[],
[with_metis="no"]
)
if test "x$with_metis" != "xno"; then
if test "x$with_metis" != "xyes" -a "x$with_metis" != "x"; then
METIS_LIBS="-L$with_metis -lmetis"
METIS_LIBS="-L$with_metis/lib -lmetis"
METIS_INCS="-I$with_metis/include"
else
METIS_LIBS="-lmetis"
METIS_INCS=""
fi
AC_CHECK_LIB([metis],[METIS_PartGraphKway],
AC_DEFINE([HAVE_METIS],1,[The metis library appears to be present.]),
AC_MSG_ERROR(something is wrong with the metis library!),$METIS_LIBS)
fi
AC_SUBST([METIS_LIBS])
AC_SUBST([METIS_INCS])
AM_CONDITIONAL([HAVEMETIS],[test -n "$METIS_LIBS"])
# Check for zlib.
......
......@@ -20,13 +20,13 @@
MYFLAGS = -DTIMER
# Add the source directory and debug to CFLAGS
AM_CFLAGS = -Wall -Werror -I../src -DCPU_TPS=2.67e9
AM_CFLAGS = -Wall -Werror -I../src -DCPU_TPS=2.67e9 $(HDF5_CPPFLAGS)
AM_LDFLAGS =
METIS_LIBS = @METIS_LIBS@
MPI_THREAD_LIBS = @MPI_THREAD_LIBS@
MPI_LIBS = $(METIS_LIBS) $(MPI_THREAD_LIBS)
MPI_FLAGS = -DWITH_MPI $(METIS_INCS)
# Set-up the library
bin_PROGRAMS = test test_fixdt test_mindt test_single
......@@ -53,17 +53,17 @@ test_mindt_LDADD = ../src/.libs/libswiftsim.a $(HDF5_LDFLAGS) $(HDF5_LIBS)
# Sources for test_mpi
test_mpi_SOURCES = test.c
test_mpi_CFLAGS = $(MYFLAGS) $(AM_CFLAGS) -DWITH_MPI -DENGINE_POLICY="engine_policy_multistep | engine_policy_keep"
test_mpi_CFLAGS = $(MYFLAGS) $(AM_CFLAGS) $(MPI_FLAGS) -DENGINE_POLICY="engine_policy_multistep | engine_policy_keep"
test_mpi_LDADD = ../src/.libs/libswiftsim_mpi.a $(HDF5_LDFLAGS) $(HDF5_LIBS) $(MPI_LIBS)
# Sources for test_fixdt_mpi
test_fixdt_mpi_SOURCES = test.c
test_fixdt_mpi_CFLAGS = $(MYFLAGS) $(AM_CFLAGS) -DWITH_MPI -DENGINE_POLICY="engine_policy_fixdt | engine_policy_keep"
test_fixdt_mpi_CFLAGS = $(MYFLAGS) $(AM_CFLAGS) $(MPI_FLAGS) -DENGINE_POLICY="engine_policy_fixdt | engine_policy_keep"
test_fixdt_mpi_LDADD = ../src/.libs/libswiftsim_mpi.a $(HDF5_LDFLAGS) $(HDF5_LIBS) $(MPI_LIBS)
# Sources for test_mindt_mpi
test_mindt_mpi_SOURCES = test.c
test_mindt_mpi_CFLAGS = $(MYFLAGS) $(AM_CFLAGS) -DWITH_MPI -DENGINE_POLICY="engine_policy_keep"
test_mindt_mpi_CFLAGS = $(MYFLAGS) $(AM_CFLAGS) $(MPI_FLAGS) -DENGINE_POLICY="engine_policy_keep"
test_mindt_mpi_LDADD = ../src/.libs/libswiftsim_mpi.a $(HDF5_LDFLAGS) $(HDF5_LIBS) $(MPI_LIBS)
# Sources for test_single
......
......@@ -17,7 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Add the debug flag to the whole thing
AM_CFLAGS = -DTIMER -DCOUNTER -DCPU_TPS=2.30e9
AM_CFLAGS = -DTIMER -DCOUNTER -DCPU_TPS=2.30e9 $(HDF5_CPPFLAGS)
# Assign a "safe" version number
AM_LDFLAGS = $(LAPACK_LIBS) $(BLAS_LIBS) $(HDF5_LDFLAGS) -version-info 0:0:0 # -fsanitize=address
......@@ -52,7 +52,7 @@ libswiftsim_la_SOURCES = $(AM_SOURCES)
# Sources and flags for MPI library
libswiftsim_mpi_la_SOURCES = $(AM_SOURCES)
libswiftsim_mpi_la_CFLAGS = $(AM_CFLAGS) -DWITH_MPI
libswiftsim_mpi_la_CFLAGS = $(AM_CFLAGS) -DWITH_MPI $(METIS_INCS)
libswiftsim_mpi_la_SHORTNAME = mpi
......
......@@ -35,11 +35,11 @@
/* MPI headers. */
#ifdef WITH_MPI
#include <mpi.h>
#endif
/* METIS headers. */
#ifdef HAVE_METIS
#include <metis.h>
/* METIS headers only used when MPI is also available. */
#ifdef HAVE_METIS
#include <metis.h>
#endif
#endif
/* Local headers. */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment