diff --git a/Makefile.am b/Makefile.am index c1e09f589cbb40bf1a3f5d8262f8086130810c78..5528f67cba8471de734d34caa81f8bec370242ad 100644 --- a/Makefile.am +++ b/Makefile.am @@ -75,13 +75,13 @@ sPuReMD_lib_libspuremd_la_SOURCES = sPuReMD/src/allocate.c \ sPuReMD_lib_libspuremd_la_CFLAGS = @DFT_CFLAGS@ @CFLAGS_EXTRA@ @OMP_CFLAGS@ sPuReMD_lib_libspuremd_la_CPPFLAGS = -I sPuReMD/src @CPPFLAGS_EXTRA@ sPuReMD_lib_libspuremd_la_LDFLAGS = -version-info 1:0:0 -sPuReMD_lib_libspuremd_la_LIBADD = @OMP_LIBS@ @L_LIBS@ @T_LIBS@ +sPuReMD_lib_libspuremd_la_LIBADD = @OMP_LIBS@ @L_LIBS@ @T_LIBS@ @G_LIBS@ bin_PROGRAMS = sPuReMD/bin/spuremd sPuReMD_bin_spuremd_SOURCES = sPuReMD/src/driver.c sPuReMD_bin_spuremd_CFLAGS = @DFT_CFLAGS@ @CFLAGS_EXTRA@ @OMP_CFLAGS@ sPuReMD_bin_spuremd_CPPFLAGS = -I sPuReMD/src @CPPFLAGS_EXTRA@ -sPuReMD_bin_spuremd_LDADD = sPuReMD/lib/libspuremd.la @OMP_LIBS@ @L_LIBS@ @T_LIBS@ +sPuReMD_bin_spuremd_LDADD = sPuReMD/lib/libspuremd.la @OMP_LIBS@ @L_LIBS@ @T_LIBS@ @G_LIBS@ check_PROGRAMS = TESTS = diff --git a/configure.ac b/configure.ac index b8b158e2bcee9553a85646ba811f0c5430302131..ba8b3afabab9de2b224ea5cc5bf631396d4cb04e 100644 --- a/configure.ac +++ b/configure.ac @@ -290,6 +290,35 @@ if test "x${pack_serial_enabled}" = "xyes" || test "x${pack_openmp_enabled}" = " fi AC_SUBST([T_LIBS], ["${TENSORFLOW_LIBS}"]) + # Check for GNU Scientific Library (for energy minimization) + GSL_LIBS= + AC_CHECK_HEADERS([gsl/gsl_sf_bessel.h], [GSL_FOUND_HEADERS="yes"]) + if test "x${GSL_FOUND_HEADERS}" = "xyes"; then + # BUG: AC_SEARCH_LIBS fails to reset LIBS when nested in conditional statements, so do it manually + save_LIBS="${LIBS}" + AC_SEARCH_LIBS([gsl_sf_bessel_J0], [gsl], + [GSL_FOUND_LIBS="yes"], [GSL_FOUND_LIBS="no"], + [-lgslcblas -m]) + LIBS="${save_LIBS}" + AS_IF([test "x${GSL_FOUND_LIBS}" != "xyes"], + [AC_MSG_WARN([ +---------------------------------------------------- + Unable to find GNU scientific library (GSL) on this system. + Disabling support for dependent methods. +----------------------------------------------------])]) + if test "x${GSL_FOUND_HEADERS}" = "xyes" && test "x${GSL_FOUND_LIBS}" = "xyes"; then + GSL_LIBS="-lgsl -lgslcblas -m" + fi + AC_DEFINE([HAVE_GSL], [1], [Define to 1 if you have GNU scientific library (GSL) support enabled.]) + else + AC_MSG_WARN([ +-------------------------------------------------- + Unable to find GNU scientific library (GSL) headers on this system. + Disabling support for dependent methods. +--------------------------------------------------]) + fi + AC_SUBST([G_LIBS], ["${GSL_LIBS}"]) + AC_LANG_POP([C]) fi AM_CONDITIONAL([BUILD_S_OMP], [test "x${pack_serial_enabled}" = "xyes" || test "x${pack_openmp_enabled}" = "xyes"])