Skip to content

Commit 92b5898

Browse files
authored
Merge pull request #7584 from ggouaillardet/topic/configury_fpp
configury: try if -fpp flag is needed to preprocess .F90 files
2 parents 4c89999 + a2c711b commit 92b5898

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

config/ompi_setup_fc.m4

+20-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ dnl Copyright (c) 2007 Los Alamos National Security, LLC. All rights
1414
dnl reserved.
1515
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
1616
dnl Copyright (c) 2009-2014 Cisco Systems, Inc. All rights reserved.
17-
dnl Copyright (c) 2015-2016 Research Organization for Information Science
18-
dnl and Technology (RIST). All rights reserved.
17+
dnl Copyright (c) 2015-2020 Research Organization for Information Science
18+
dnl and Technology (RIST). All rights reserved.
1919
dnl $COPYRIGHT$
2020
dnl
2121
dnl Additional copyrights may follow
@@ -139,6 +139,24 @@ AC_DEFUN([OMPI_SETUP_FC],[
139139
[AC_FC_SRCEXT(f)
140140
AC_FC_SRCEXT(f90)])
141141

142+
AC_MSG_CHECKING([if Fortran compilers preprocess .F90 files without additional flag])
143+
cat > conftest_f.F90 << EOF
144+
#if 0
145+
#error The source file was not preprocessed
146+
#endif
147+
program bogus
148+
end program
149+
EOF
150+
OPAL_LOG_COMMAND([$FC $FCFLAGS -c conftest_f.F90],
151+
[AC_MSG_RESULT(["yes"])],
152+
[AC_MSG_CHECKING([if -fpp flag works])
153+
OPAL_LOG_COMMAND([$FC $FCFLAGS -fpp -c conftest_f.F90],
154+
[AC_MSG_RESULT(["yes"])
155+
FCFLAGS="$FCFLAGS -fpp"],
156+
[AC_MSG_RESULT("no")
157+
AC_MSG_ERROR(["cannot preprocess Fortran files, Aborting"])])])
158+
rm -f conftest*
159+
142160
# Per trac #1982, on OS X, we may need some esoteric linker flags
143161
# in the wrapper compilers. However, per
144162
# https://github.com/open-mpi/ompi/issues/259, we need to use

0 commit comments

Comments
 (0)