diff --git a/m4/libxc.m4 b/m4/libxc.m4 index 210ad05294801b0e163ae9138347367649aa5af9..11b15f9ebd5b62748e5a8899107d1dd00d389656 100644 --- a/m4/libxc.m4 +++ b/m4/libxc.m4 @@ -29,9 +29,11 @@ dnl if not, use environment variables or defaults AC_ARG_WITH(libxc-prefix, [AS_HELP_STRING([--with-libxc-prefix=DIR], [Directory where libxc was installed.])]) # Set FCFLAGS_LIBXC only if not set from environment +# Note: Most distros package fortran modules in /usr/include, but Fedora and RHEL via epel (and its derivatives) package it in /usr/lib64/gfortran/modules. +# We include both paths here as this will only lead to a warning of folder not found at most. if test x"$FCFLAGS_LIBXC" = x; then case $with_libxc_prefix in - "") FCFLAGS_LIBXC="$ax_cv_f90_modflag/usr/include" ;; + "") FCFLAGS_LIBXC="$ax_cv_f90_modflag/usr/include $ax_cv_f90_modflag/usr/lib64/gfortran/modules" ;; *) FCFLAGS_LIBXC="$ax_cv_f90_modflag$with_libxc_prefix/include" ;; esac fi