From 77855a0668528f40981cf131e24bf9aa75e8b4b5 Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Thu, 10 Nov 2022 14:19:02 +0100 Subject: [PATCH] Fix gfortran module search for libxc Gfortran for some reason does not automatically search the path `/usr/lib64/gfortran/modules/` which is used in libxc packaging `%{_fmoddir}` [1] https://src.fedoraproject.org/rpms/libxc/blob/d8d63bed0b05b33a2b69cfef42c1870ef5bc13e9/f/libxc.spec#_121 [2] https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/3e8695eaed21fcfcca6063368a9a54d7d5f876bc/f/macros#_20 Signed-off-by: Cristian Le --- m4/libxc.m4 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/m4/libxc.m4 b/m4/libxc.m4 index 210ad05294..11b15f9ebd 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 -- GitLab