Skip to content

Commit e1df5de

Browse files
committed
wrapper: conditionally install mpifort
Similar to 38e53f3 (which dealt with C++), only install mpifort (etc.) if there is actually a Fortran compiler available. Signed-off-by: Jeff Squyres <[email protected]>
1 parent 3946060 commit e1df5de

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed

config/ompi_setup_fc.m4

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ AC_DEFUN([OMPI_SETUP_FC],[
6161
# Autoconf (version >= 2.64) docs.
6262
AC_REQUIRE([_OMPI_SETUP_FC_COMPILER])
6363

64+
# If $FC is "no", that's another way of the user telling us "I
65+
# don't want any Fortran compiler". That being said, there are
66+
# already existing code paths that expect an empty $FC to mean "no
67+
# Fortran compiler", so turn "no" into "" here.
68+
AS_IF([test "$FC" = "no"], [FC=])
69+
6470
AS_IF([test -z "$FC"],
6571
[AC_MSG_WARN([*** All Fortran MPI bindings disabled (could not find compiler)])
6672
ompi_fc_happy=0],

config/ompi_setup_mpi_fortran.m4

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ AC_DEFUN([OMPI_SETUP_MPI_FORTRAN],[
9797
AS_IF([test $OMPI_TRY_FORTRAN_BINDINGS -gt $OMPI_FORTRAN_NO_BINDINGS],
9898
[OMPI_SETUP_FC([ompi_fortran_happy=1])])
9999

100+
AM_CONDITIONAL([OMPI_HAVE_FORTRAN_COMPILER], [test -n "$FC"])
101+
100102
# These values will be determined by SETUP_FC. We must always
101103
# AC_DEFINE these results, even in the --disable-mpi-fortran case,
102104
# for ompi_info.

ompi/tools/wrappers/Makefile.am

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,16 @@
2424

2525
include $(top_srcdir)/Makefile.ompi-rules
2626

27-
generated_man_pages = mpicc.1 mpifort.1 mpif77.1 mpif90.1
27+
generated_man_pages = mpicc.1
2828

2929
if OMPI_HAVE_CXX_COMPILER
3030
generated_man_pages += mpic++.1 mpicxx.1
3131
endif
3232

33+
if OMPI_HAVE_FORTRAN_COMPILER
34+
generated_man_pages += mpifort.1 mpif77.1 mpif90.1
35+
endif
36+
3337
if OMPI_WANT_JAVA_BINDINGS
3438
generated_man_pages += mpijavac.1
3539
endif
@@ -53,9 +57,11 @@ if OMPI_HAVE_CXX_COMPILER
5357
(cd $(DESTDIR)$(bindir); rm -f mpic++; $(LN_S) ompi_wrapper_script mpic++)
5458
(cd $(DESTDIR)$(bindir); rm -f mpicxx; $(LN_S) ompi_wrapper_script mpicxx)
5559
endif
60+
if OMPI_HAVE_FORTRAN_COMPILER
5661
(cd $(DESTDIR)$(bindir); rm -f mpifort; $(LN_S) ompi_wrapper_script mpifort)
5762
(cd $(DESTDIR)$(bindir); rm -f mpif77; $(LN_S) ompi_wrapper_script mpif77)
5863
(cd $(DESTDIR)$(bindir); rm -f mpif90; $(LN_S) ompi_wrapper_script mpif90)
64+
endif
5965
if OMPI_WANT_JAVA_BINDINGS
6066
(cp mpijavac.pl $(DESTDIR)$(bindir))
6167
(cd $(DESTDIR)$(bindir); chmod +x mpijavac.pl; rm -f mpijavac; $(LN_S) mpijavac.pl mpijavac)
@@ -85,36 +91,44 @@ else # OPAL_WANT_SCRIPT_WRAPPER_COMPILERS
8591
if OPAL_INSTALL_BINARIES
8692

8793
pkgconfigdir = $(libdir)/pkgconfig
88-
pkgconfig_DATA = ompi.pc ompi-c.pc ompi-fort.pc
94+
pkgconfig_DATA = ompi.pc ompi-c.pc
8995

9096
if OMPI_HAVE_CXX_COMPILER
9197
pkgconfig_DATA += ompi-cxx.pc
9298
endif
9399

100+
if OMPI_HAVE_FORTRAN_COMPILER
101+
pkgconfig_DATA += ompi-fort.pc
102+
endif
103+
94104
if OMPI_WANT_JAVA_BINDINGS
95105
bin_SCRIPTS = mpijavac.pl
96106
endif
97107

98108
man_MANS = $(man_pages)
99109

100-
nodist_ompidata_DATA = \
101-
mpicc-wrapper-data.txt \
102-
mpifort-wrapper-data.txt
110+
nodist_ompidata_DATA = mpicc-wrapper-data.txt
103111

104112
if OMPI_HAVE_CXX_COMPILER
105113
nodist_ompidata_DATA += mpic++-wrapper-data.txt
106114
endif
107115

116+
if OMPI_HAVE_FORTRAN_COMPILER
117+
nodist_ompidata_DATA += mpifort-wrapper-data.txt
118+
endif
119+
108120
install-exec-hook-always:
109121
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
110122
(cd $(DESTDIR)$(bindir); rm -f mpicc$(EXEEXT); $(LN_S) opal_wrapper$(EXEEXT) mpicc$(EXEEXT))
111123
if OMPI_HAVE_CXX_COMPILER
112124
(cd $(DESTDIR)$(bindir); rm -f mpic++$(EXEEXT); $(LN_S) opal_wrapper$(EXEEXT) mpic++$(EXEEXT))
113125
(cd $(DESTDIR)$(bindir); rm -f mpicxx$(EXEEXT); $(LN_S) opal_wrapper$(EXEEXT) mpicxx$(EXEEXT))
114126
endif
127+
if OMPI_HAVE_FORTRAN_COMPILER
115128
(cd $(DESTDIR)$(bindir); rm -f mpifort$(EXEEXT); $(LN_S) opal_wrapper$(EXEEXT) mpifort$(EXEEXT))
116129
(cd $(DESTDIR)$(bindir); rm -f mpif77$(EXEEXT); $(LN_S) opal_wrapper$(EXEEXT) mpif77$(EXEEXT))
117130
(cd $(DESTDIR)$(bindir); rm -f mpif90$(EXEEXT); $(LN_S) opal_wrapper$(EXEEXT) mpif90$(EXEEXT))
131+
endif
118132
if OMPI_WANT_JAVA_BINDINGS
119133
(cp mpijavac.pl $(DESTDIR)$(bindir))
120134
(cd $(DESTDIR)$(bindir); chmod +x mpijavac.pl; rm -f mpijavac; $(LN_S) mpijavac.pl mpijavac)
@@ -124,10 +138,12 @@ install-data-hook-always:
124138
if OMPI_HAVE_CXX_COMPILER
125139
(cd $(DESTDIR)$(pkgdatadir); rm -f mpicxx-wrapper-data.txt; $(LN_S) mpic++-wrapper-data.txt mpicxx-wrapper-data.txt)
126140
endif
141+
if OMPI_HAVE_FORTRAN_COMPILER
127142
(cd $(DESTDIR)$(pkgdatadir); rm -f mpif77-wrapper-data.txt; $(LN_S) mpifort-wrapper-data.txt mpif77-wrapper-data.txt)
128143
(cd $(DESTDIR)$(pkgdatadir); rm -f mpif90-wrapper-data.txt; $(LN_S) mpifort-wrapper-data.txt mpif90-wrapper-data.txt)
129144
(cd $(DESTDIR)$(pkgconfigdir); rm -f ompi-f77.pc; $(LN_S) ompi-fort.pc ompi-f77.pc)
130145
(cd $(DESTDIR)$(pkgconfigdir); rm -f ompi-f90.pc; $(LN_S) ompi-fort.pc ompi-f90.pc)
146+
endif
131147

132148
uninstall-local-always:
133149
rm -f $(DESTDIR)$(bindir)/mpicc$(EXEEXT) \
@@ -195,6 +211,7 @@ mpicxx.1: $(top_builddir)/opal/tools/wrappers/generic_wrapper.1
195211
sed -e 's/#COMMAND#/mpicxx/g' -e 's/#PROJECT#/Open MPI/g' -e 's/#PROJECT_SHORT#/OMPI/g' -e 's/#LANGUAGE#/C++/g' < $(top_builddir)/opal/tools/wrappers/generic_wrapper.1 > mpicxx.1
196212
endif
197213

214+
if OMPI_HAVE_FORTRAN_COMPILER
198215
mpifort.1: $(top_builddir)/opal/tools/wrappers/generic_wrapper.1
199216
rm -f mpifort.1
200217
sed -e 's/#COMMAND#/mpifort/g' -e 's/#PROJECT#/Open MPI/g' -e 's/#PROJECT_SHORT#/OMPI/g' -e 's/#LANGUAGE#/Fortran/g' < $(top_builddir)/opal/tools/wrappers/generic_wrapper.1 > mpifort.1
@@ -214,3 +231,4 @@ mpif77.1: mpif77.1in
214231
mpif90.1: mpif77.1
215232
@ rm -f mpif90.1
216233
$(OMPI_V_LN_S) $(LN_S) mpif77.1 mpif90.1
234+
endif

0 commit comments

Comments
 (0)