diff --git a/ompi/mpi/f90/Makefile.am b/ompi/mpi/f90/Makefile.am index 0d09248eea..233ba91f76 100644 --- a/ompi/mpi/f90/Makefile.am +++ b/ompi/mpi/f90/Makefile.am @@ -266,19 +266,14 @@ DISTCLEANFILES = $(nodist_libmpi_f90_a_SOURCES) if OMPI_WANT_F90_BINDINGS install-exec-hook: @ for file in `ls *.mod`; do \ - rm -f $$file $(DESTDIR)$(libdir); \ echo $(INSTALL) $$file $(DESTDIR)$(libdir); \ $(INSTALL) $$file $(DESTDIR)$(libdir); \ - rm -f $(DESTDIR)$(includedir)/$$file ; \ - echo $(LN_S) $(DESTDIR)$(libdir)/$$file $(DESTDIR)$(includedir)/$$file ; \ - $(LN_S) $(DESTDIR)$(libdir)/$$file $(DESTDIR)$(includedir)/$$file ; \ done uninstall-local: @ for file in `ls *.mod`; do \ echo rm -f $(DESTDIR)$(libdir)/$$file; \ rm -f $(DESTDIR)$(libdir)/$$file; \ - rm -f $(DESTDIR)$(includedir)/$$file; \ done else diff --git a/ompi/tools/wrappers/mpif90-wrapper-data.txt.in b/ompi/tools/wrappers/mpif90-wrapper-data.txt.in index 3c0ba0671e..28436a8a7d 100644 --- a/ompi/tools/wrappers/mpif90-wrapper-data.txt.in +++ b/ompi/tools/wrappers/mpif90-wrapper-data.txt.in @@ -5,9 +5,10 @@ language=Fortran 90 compiler_env=FC compiler_flags_env=FCFLAGS compiler=@FC@ +module_option=@OMPI_FC_MODULE_FLAG@ extra_includes= preprocessor_flags= -compiler_flags=@OMPI_WRAPPER_EXTRA_FFLAGS@ +compiler_flags=@OMPI_WRAPPER_EXTRA_FFLAGS@ linker_flags=@OMPI_WRAPPER_EXTRA_LDFLAGS@ libs=-lmpi_f90 -lmpi -lorte -lopal @OMPI_WRAPPER_EXTRA_LIBS@ required_file=@OMPI_WRAPPER_F90_REQUIRED_FILE@ diff --git a/opal/tools/wrappers/opal_wrapper.c b/opal/tools/wrappers/opal_wrapper.c index 0d2d271ef0..d6dfd2c442 100644 --- a/opal/tools/wrappers/opal_wrapper.c +++ b/opal/tools/wrappers/opal_wrapper.c @@ -57,6 +57,7 @@ struct { char *compiler_env; char *compiler_flags_env; char *compiler; + char *module_option; char **preproc_flags; char **comp_flags; char **link_flags; @@ -83,6 +84,8 @@ data_callback(const char *key, const char *value) if (NULL != value) data.project = strdup(value); } else if (0 == strcmp(key, "version")) { if (NULL != value) data.version = strdup(value); + } else if (0 == strcmp(key, "module_option")) { + if (NULL != value) data.module_option = strdup(value); } else if (0 == strcmp(key, "extra_includes")) { /* this is the hard one - need to put it together... */ int i; @@ -142,6 +145,7 @@ data_init(const char *appname) data.version = NULL; data.compiler_env = NULL; data.compiler_flags_env = NULL; + data.module_option = NULL; data.preproc_flags = malloc(sizeof(char*)); data.preproc_flags[0] = NULL; data.comp_flags = malloc(sizeof(char*)); @@ -189,6 +193,7 @@ data_finalize(void) if (NULL != data.version) free(data.version); if (NULL != data.compiler_env) free(data.compiler_env); if (NULL != data.compiler_flags_env) free(data.compiler_flags_env); + if (NULL != data.module_option) free(data.module_option); opal_argv_free(data.preproc_flags); opal_argv_free(data.comp_flags); opal_argv_free(data.link_flags); @@ -482,6 +487,14 @@ main(int argc, char *argv[]) /* compiler flags */ if (flags & COMP_WANT_COMPILE) { opal_argv_insert(&exec_argv, exec_argc, data.comp_flags); + /* Deal with languages like Fortran 90 that have special + places and flags for modules or whatever */ + if (data.module_option != NULL) { + char *line; + asprintf(&line, "%s%s", data.module_option, OPAL_LIBDIR); + opal_argv_append_nosize(&exec_argv, line); + free(line); + } exec_argc = opal_argv_count(exec_argv); }