From 074672cc2e7725fbbb0328b9f3ae766d45afec96 Mon Sep 17 00:00:00 2001
From: James Willis <james.s.willis@durham.ac.uk>
Date: Fri, 3 Aug 2018 09:28:08 +0100
Subject: [PATCH] Added VELCOIraptor linker flags to Makefile.am instead of
 adding it directly to the LIBS environment variable.

---
 configure.ac         | 1 -
 examples/Makefile.am | 2 +-
 src/Makefile.am      | 4 ++--
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 1682b81c4b..03bee71751 100644
--- a/configure.ac
+++ b/configure.ac
@@ -786,7 +786,6 @@ if test "x$with_velociraptor" != "xno"; then
    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
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 9b9f76294f..e4a12fc1a9 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -24,7 +24,7 @@ AM_CFLAGS = -I$(top_srcdir)/src $(HDF5_CPPFLAGS) $(GSL_INCS) $(FFTW_INCS)
 AM_LDFLAGS = $(HDF5_LDFLAGS)
 
 # Extra libraries.
-EXTRA_LIBS = $(HDF5_LIBS) $(FFTW_LIBS) $(PROFILER_LIBS) $(TCMALLOC_LIBS) $(JEMALLOC_LIBS) $(TBBMALLOC_LIBS) $(GRACKLE_LIBS) $(GSL_LIBS)
+EXTRA_LIBS = $(HDF5_LIBS) $(FFTW_LIBS) $(PROFILER_LIBS) $(TCMALLOC_LIBS) $(JEMALLOC_LIBS) $(TBBMALLOC_LIBS) $(GRACKLE_LIBS) $(VELOCIRAPTOR_LIBS) $(GSL_LIBS)
 
 # MPI libraries.
 MPI_LIBS = $(METIS_LIBS) $(MPI_THREAD_LIBS)
diff --git a/src/Makefile.am b/src/Makefile.am
index 4ef050a096..2ae00837cd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -157,14 +157,14 @@ nobase_noinst_HEADERS = align.h approx_math.h atomic.h barrier.h cycle.h error.h
 libswiftsim_la_SOURCES = $(AM_SOURCES)
 libswiftsim_la_CFLAGS = $(AM_CFLAGS)
 libswiftsim_la_LDFLAGS = $(AM_LDFLAGS) $(EXTRA_LIBS)
-libswiftsim_la_LIBADD = $(GRACKLE_LIBS)
+libswiftsim_la_LIBADD = $(GRACKLE_LIBS) $(VELOCIRAPTOR_LIBS)
 
 # Sources and flags for MPI library
 libswiftsim_mpi_la_SOURCES = $(AM_SOURCES)
 libswiftsim_mpi_la_CFLAGS = $(AM_CFLAGS) $(MPI_FLAGS)
 libswiftsim_mpi_la_LDFLAGS = $(AM_LDFLAGS) $(MPI_LIBS) $(EXTRA_LIBS)
 libswiftsim_mpi_la_SHORTNAME = mpi
-libswiftsim_mpi_la_LIBADD = $(GRACKLE_LIBS)
+libswiftsim_mpi_la_LIBADD = $(GRACKLE_LIBS) $(VELOCIRAPTOR_LIBS)
 
 
 # Versioning. If any sources change then update the version_string.h file with
-- 
GitLab