Commit 2a484c7f authored by James Willis's avatar James Willis
Browse files

The path to the VELOCIraptor library can be specified at configure and the...

The path to the VELOCIraptor library can be specified at configure and the relevant linker flags are added automatically.
parent 640fd73d
......@@ -771,6 +771,39 @@ if test "$with_hdf5" = "yes"; then
fi
AM_CONDITIONAL([HAVEPARALLELHDF5],[test "$have_parallel_hdf5" = "yes"])
# Check for VELOCIraptor.
have_velociraptor="no"
AC_ARG_WITH([velociraptor],
[AS_HELP_STRING([--with-velociraptor=PATH],
[Directory where velociraptor library exists @<:@yes/no@:>@]
)],
[with_velociraptor="$withval"],
[with_velociraptor="no"]
)
if test "x$with_velociraptor" != "xno"; then
AC_PROG_FC
AC_FC_LIBRARY_LDFLAGS
if test "x$with_velociraptor" != "xyes" -a "x$with_velociraptor" != "x"; then
VELOCIRAPTOR_LIBS="-L$with_velociraptor -lstf -lstdc++ -lhdf5_cpp"
CFLAGS="$CFLAGS -fopenmp"
LIBS="$LIBS $VELOCIRAPTOR_LIBS"
else
VELOCIRAPTOR_LIBS=""
fi
have_velociraptor="yes"
AC_CHECK_LIB(
[stf],
[InitVelociraptor],
[AC_DEFINE([HAVE_VELOCIRAPTOR],1,[The VELOCIraptor library appears to be present.])],
[AC_MSG_ERROR(Cannot find VELOCIraptor library at $with_velociraptor)],
[$VELOCIRAPTOR_LIBS $HDF5_LDFLAGS $HDF5_LIBS $GSL_LIBS]
)
fi
AC_SUBST([VELOCIRAPTOR_LIBS])
AM_CONDITIONAL([HAVEVELOCIRAPTOR],[test -n "$VELOCIRAPTOR_LIBS"])
# Check for floating-point execeptions
AC_CHECK_FUNC(feenableexcept, AC_DEFINE([HAVE_FE_ENABLE_EXCEPT],[1],
[Defined if the floating-point exception can be enabled using non-standard GNU functions.]))
......@@ -993,18 +1026,6 @@ if test "$enable_debug_interactions" != "no"; then
fi
fi
# Check if VELOCIraptor is enabled.
AC_ARG_ENABLE([velociraptor],
[AS_HELP_STRING([--enable-velociraptor],
[Activate structure finding with VELOCIraptor.]
)],
[enable_velociraptor="$enableval"],
[enable_velociraptor="no"]
)
if test "$enable_velociraptor" != "no"; then
AC_DEFINE([WITH_VELOCIRAPTOR],1,[Enable VELOCIRaptor])
fi
# SPH Kernel function
AC_ARG_WITH([kernel],
[AS_HELP_STRING([--with-kernel=<kernel>],
......@@ -1341,22 +1362,22 @@ AC_MSG_RESULT([
$PACKAGE_NAME v.$PACKAGE_VERSION
Compiler : $CC
- vendor : $ax_cv_c_compiler_vendor
- version : $ax_cv_c_compiler_version
- flags : $CFLAGS
MPI enabled : $enable_mpi
HDF5 enabled : $with_hdf5
- parallel : $have_parallel_hdf5
Metis enabled : $have_metis
FFTW3 enabled : $have_fftw
GSL enabled : $have_gsl
libNUMA enabled : $have_numa
GRACKLE enabled : $have_grackle
Special allocators : $have_special_allocator
CPU profiler : $have_profiler
Pthread barriers : $have_pthread_barrier
VELOCIraptor : $enable_velociraptor
Compiler : $CC
- vendor : $ax_cv_c_compiler_vendor
- version : $ax_cv_c_compiler_version
- flags : $CFLAGS
MPI enabled : $enable_mpi
HDF5 enabled : $with_hdf5
- parallel : $have_parallel_hdf5
Metis enabled : $have_metis
FFTW3 enabled : $have_fftw
GSL enabled : $have_gsl
libNUMA enabled : $have_numa
GRACKLE enabled : $have_grackle
Special allocators : $have_special_allocator
CPU profiler : $have_profiler
Pthread barriers : $have_pthread_barrier
VELOCIraptor enabled : $have_velociraptor
Hydro scheme : $with_hydro
Dimensionality : $with_dimension
......
......@@ -1125,7 +1125,7 @@ int main(int argc, char *argv[]) {
engine_print_stats(&e);
engine_dump_snapshot(&e);
#ifdef WITH_VELOCIRAPTOR
#ifdef HAVE_VELOCIRAPTOR
/* Call VELOCIraptor at the end of the run to find groups. */
if (e.policy & engine_policy_structure_finding) {
velociraptor_init(&e);
......
......@@ -44,7 +44,7 @@
*/
void velociraptor_init(struct engine *e) {
#ifdef WITH_VELOCIRAPTOR
#ifdef HAVE_VELOCIRAPTOR
struct space *s = e->s;
struct cosmoinfo cosmo_info;
struct unitinfo unit_info;
......@@ -137,7 +137,7 @@ void velociraptor_init(struct engine *e) {
if(!InitVelociraptor(configfilename, outputFileName, cosmo_info, unit_info, sim_info)) error("Exiting. VELOCIraptor initialisation failed.");
#else
error("SWIFT not configure to run with VELOCIraptor.");
#endif /* WITH_VELOCIRAPTOR */
#endif /* HAVE_VELOCIRAPTOR */
}
......@@ -149,7 +149,7 @@ void velociraptor_init(struct engine *e) {
*/
void velociraptor_invoke(struct engine *e) {
#ifdef WITH_VELOCIRAPTOR
#ifdef HAVE_VELOCIRAPTOR
struct space *s = e->s;
struct gpart *gparts = s->gparts;
struct part *parts = s->parts;
......@@ -246,5 +246,5 @@ void velociraptor_invoke(struct engine *e) {
clocks_from_ticks(getticks() - tic), clocks_getunit(), engine_rank);
#else
error("SWIFT not configure to run with VELOCIraptor.");
#endif /* WITH_VELOCIRAPTOR */
#endif /* HAVE_VELOCIRAPTOR */
}
Markdown is supported
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