Skip to content

configury: try if -fpp flag is needed to preprocess .F90 files #7584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions config/ompi_setup_fc.m4
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ dnl Copyright (c) 2007 Los Alamos National Security, LLC. All rights
dnl reserved.
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
dnl Copyright (c) 2009-2014 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2015-2016 Research Organization for Information Science
dnl and Technology (RIST). All rights reserved.
dnl Copyright (c) 2015-2020 Research Organization for Information Science
dnl and Technology (RIST). All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
Expand Down Expand Up @@ -139,6 +139,24 @@ AC_DEFUN([OMPI_SETUP_FC],[
[AC_FC_SRCEXT(f)
AC_FC_SRCEXT(f90)])

AC_MSG_CHECKING([if Fortran compilers preprocess .F90 files without additional flag])
cat > conftest_f.F90 << EOF
#if 0
#error The source file was not preprocessed
#endif
program bogus
end program
EOF
OPAL_LOG_COMMAND([$FC $FCFLAGS -c conftest_f.F90],
[AC_MSG_RESULT(["yes"])],
[AC_MSG_CHECKING([if -fpp flag works])
OPAL_LOG_COMMAND([$FC $FCFLAGS -fpp -c conftest_f.F90],
[AC_MSG_RESULT(["yes"])
FCFLAGS="$FCFLAGS -fpp"],
[AC_MSG_RESULT("no")
AC_MSG_ERROR(["cannot preprocess Fortran files, Aborting"])])])
rm -f conftest*

# Per trac #1982, on OS X, we may need some esoteric linker flags
# in the wrapper compilers. However, per
# https://github.com/open-mpi/ompi/issues/259, we need to use
Expand Down