Skip to content

Commit c632322

Browse files
committed
configury: install Fortran stuff in the subdir DIR specified by the --mpi-fortran-dir=DIR configure option
Refs #2056 Signed-off-by: Gilles Gouaillardet <[email protected]>
1 parent 8d336dd commit c632322

File tree

16 files changed

+60
-12
lines changed

16 files changed

+60
-12
lines changed

config/ompi_configure_options.m4

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,15 @@ AC_ARG_ENABLE(mpi-fortran,
106106
AC_HELP_STRING([--enable-mpi-fortran],
107107
[specify which Fortran MPI bindings to build: yes, none (or no), best-effort, mpifh (build only mpif.h support), usempi (build mpif.h and the mpi module), or usempif08 (or all, build mpifh, the mpi module, and the mpi_f08 module) (default: "yes" if Fortran compiler found)]))
108108

109+
AC_ARG_WITH(mpi-fortran-dir,
110+
AC_HELP_STRING([--with-mpi-fortran-dir=VALUE],
111+
[install Fortran headers, modules and libs in includeVALEUE and libVALUE instead of include and lib]))
112+
113+
AS_IF([test $with_mpi_fortran_dir = yes || test $with_fortran_dir = no],
114+
[OMPI_FORTRAN_DIR=],
115+
[OMPI_FORTRAN_DIR=$with_mpi_fortran_dir])
116+
AC_SUBST([OMPI_FORTRAN_DIR])
117+
109118
# These are the 4 monotonically-rising values indicating levels of
110119
# Fortran bindings support.
111120
OMPI_FORTRAN_NO_BINDINGS=0

config/opal_setup_wrappers.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ AC_DEFUN([OPAL_SETUP_WRAPPER_FINAL],[
432432
AC_MSG_CHECKING([for OMPI FCFLAGS])
433433
OMPI_WRAPPER_EXTRA_FCFLAGS="$wrapper_extra_fcflags $with_wrapper_fcflags"
434434
if test "$OMPI_FC_MODULE_FLAG" != "" ; then
435-
OMPI_WRAPPER_EXTRA_FCFLAGS="$OMPI_WRAPPER_EXTRA_FCFLAGS $OMPI_FC_MODULE_FLAG"'${libdir}'
435+
OMPI_WRAPPER_EXTRA_FCFLAGS="$OMPI_WRAPPER_EXTRA_FCFLAGS $OMPI_FC_MODULE_FLAG"'${libdir}''${opalfortrandir}'
436436
fi
437437
AC_SUBST([OMPI_WRAPPER_EXTRA_FCFLAGS])
438438
AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_FCFLAGS])
@@ -444,7 +444,7 @@ AC_DEFUN([OPAL_SETUP_WRAPPER_FINAL],[
444444

445445
AC_MSG_CHECKING([for OMPI LDFLAGS])
446446
OMPI_WRAPPER_EXTRA_LDFLAGS="$ompi_mca_wrapper_extra_ldflags $wrapper_extra_ldflags $with_wrapper_ldflags"
447-
OMPI_WRAPPER_EXTRA_FC_LDFLAGS=$OMPI_WRAPPER_EXTRA_LDFLAGS
447+
OMPI_WRAPPER_EXTRA_FC_LDFLAGS=-L'${libdir}${opalfortrandir}'" ${OMPI_WRAPPER_EXTRA_LDFLAGS}"
448448
RPATHIFY_LDFLAGS([OMPI_WRAPPER_EXTRA_LDFLAGS])
449449
AC_SUBST([OMPI_WRAPPER_EXTRA_LDFLAGS])
450450
AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_LDFLAGS])

ompi/include/Makefile.am

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# All rights reserved.
1212
# Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved.
1313
# Copyright (c) 2009-2011 Oak Ridge National Labs. All rights reserved.
14-
# Copyright (c) 2014-2015 Research Organization for Information Science
14+
# Copyright (c) 2014-2016 Research Organization for Information Science
1515
# and Technology (RIST). All rights reserved.
1616
# $COPYRIGHT$
1717
#
@@ -26,15 +26,18 @@ include $(top_srcdir)/Makefile.ompi-rules
2626
# not ${includedir}/
2727
headers = ompi_config.h
2828
nodist_headers =
29+
fincludedir = $(includedir)@OMPI_FORTRAN_DIR@
2930

3031
# Install these in $(includedir)
3132
include_HEADERS =
33+
# Install those in $(finclude)
34+
finclude_HEADERS =
3235

3336
# Always install these in $(pkgincludedir)
3437
pkginclude_HEADERS =
3538

3639
if OMPI_BUILD_FORTRAN_MPIFH_BINDINGS
37-
include_HEADERS += \
40+
finclude_HEADERS += \
3841
mpif-constants.h \
3942
mpif-externals.h \
4043
mpif-handles.h \
@@ -50,14 +53,16 @@ endif
5053
nodist_include_HEADERS = \
5154
mpi.h \
5255
mpi-ext.h \
56+
mpi_portable_platform.h
57+
58+
nodist_finclude_HEADERS = \
5359
mpif.h \
5460
mpif-ext.h \
5561
mpif-sizeof.h \
56-
mpif-c-constants-decl.h \
57-
mpi_portable_platform.h
62+
mpif-c-constants-decl.h
5863

5964
if OMPI_BUILD_FORTRAN_MPIFH_BINDINGS
60-
nodist_include_HEADERS += \
65+
nodist_finclude_HEADERS += \
6166
mpif-config.h
6267
endif
6368

ompi/mpi/fortran/mpiext/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
# $HEADER$
1010
#
1111

12+
libdir = @libdir@@OMPI_FORTRAN_DIR@
13+
1214
#
1315
# Only do the stuff in this file if we're going to build one/both of
1416
# the mpi/mpi_f08 ext modules.

ompi/mpi/fortran/mpif-h/Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# Copyright (c) 2011-2013 Universite Bordeaux 1
1515
# Copyright (c) 2013-2014 Los Alamos National Security, LLC. All rights
1616
# reserved.
17-
# Copyright (c) 2015 Research Organization for Information Science
17+
# Copyright (c) 2015-2016 Research Organization for Information Science
1818
# and Technology (RIST). All rights reserved.
1919
# Copyright (c) 2016 IBM Corporation. All rights reserved.
2020
# $COPYRIGHT$
@@ -26,6 +26,8 @@
2626

2727
include $(top_srcdir)/Makefile.ompi-rules
2828

29+
libdir = @libdir@@OMPI_FORTRAN_DIR@
30+
2931
SUBDIRS = profile
3032

3133
AM_CPPFLAGS = -DOMPI_BUILD_MPI_PROFILING=0 -DOMPI_COMPILING_FORTRAN_WRAPPERS=1

ompi/mpi/fortran/use-mpi-f08/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
include $(top_srcdir)/Makefile.ompi-rules
2222

23+
libdir = @libdir@@OMPI_FORTRAN_DIR@
24+
2325
# This Makefile is only relevant if we're building the "use mpi_f08"
2426
# MPI bindings.
2527
if OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS

ompi/mpi/fortran/use-mpi-ignore-tkr/Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- makefile -*-
22
#
33
# Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved.
4-
# Copyright (c) 2015 Research Organization for Information Science
4+
# Copyright (c) 2015-2016 Research Organization for Information Science
55
# and Technology (RIST). All rights reserved.
66
# Copyright (c) 2016 IBM Corporation. All rights reserved.
77
#
@@ -14,6 +14,8 @@
1414

1515
include $(top_srcdir)/Makefile.ompi-rules
1616

17+
libdir = @libdir@@OMPI_FORTRAN_DIR@
18+
1719
# This Makefile is only relevant if we're building the ignore-TKR "use
1820
# mpi" MPI bindings.
1921
if OMPI_BUILD_FORTRAN_USEMPI_IGNORE_TKR_BINDINGS

ompi/mpi/fortran/use-mpi-tkr/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

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

28+
libdir = @libdir@@OMPI_FORTRAN_DIR@
29+
2830
# THIS MAKEFILE IS OLD AND ONLY TO SUPPORT FORTRAN COMPILERS THAT DO
2931
# NOT SUPPORT "IGNORE TKR" FUNCTIONALITY (i.e., gfortran before v4.9).
3032
# All other Fortran compilers support ignore TKR and don't compile

ompi/tools/wrappers/mpifort-wrapper-data.txt.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ project=Open MPI
99
project_short=OMPI
1010
version=@OMPI_VERSION@
1111
language=Fortran
12+
fortrandir=@OMPI_FORTRAN_DIR@
1213
compiler_env=FC
1314
compiler_flags_env=FCFLAGS
1415
compiler=@FC@
@@ -24,5 +25,5 @@ libs_static=@OMPI_FORTRAN_USEMPIF08_LIB@ @OMPI_FORTRAN_USEMPI_LIB@ -l@OMPI_LIBMP
2425
dyn_lib_file=lib@OMPI_LIBMPI_NAME@.@OPAL_DYN_LIB_SUFFIX@
2526
static_lib_file=lib@[email protected]
2627
required_file=@OMPI_WRAPPER_FORTRAN_REQUIRED_FILE@
27-
includedir=${includedir}
28+
includedir=${includedir}${opalfortrandir}
2829
libdir=${libdir}

opal/mca/installdirs/base/installdirs_base_components.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* reserved.
44
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
55
* Copyright (c) 2010 Sandia National Laboratories. All rights reserved.
6-
* Copyright (c) 2015 Research Organization for Information Science
6+
* Copyright (c) 2015-2016 Research Organization for Information Science
77
* and Technology (RIST). All rights reserved.
88
* $COPYRIGHT$
99
*
@@ -81,6 +81,8 @@ opal_installdirs_base_open(mca_base_open_flag_t flags)
8181
opallibdir);
8282
CONDITIONAL_COPY(opal_install_dirs, component->install_dirs_data,
8383
opalincludedir);
84+
CONDITIONAL_COPY(opal_install_dirs, component->install_dirs_data,
85+
opalfortrandir);
8486
}
8587

8688
/* expand out all the fields */

opal/mca/installdirs/base/installdirs_base_expand.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
55
* Copyright (c) 2007 Sun Microsystem, Inc. All rights reserved.
66
* Copyright (c) 2010 Sandia National Laboratories. All rights reserved.
7+
* Copyright (c) 2016 Research Organization for Information Science
8+
* and Technology (RIST). All rights reserved.
79
* $COPYRIGHT$
810
*
911
* Additional copyrights may follow
@@ -144,6 +146,7 @@ opal_install_dirs_expand_internal(const char* input, bool is_setup)
144146
EXPAND_STRING2(opaldatadir, pkgdatadir);
145147
EXPAND_STRING2(opallibdir, pkglibdir);
146148
EXPAND_STRING2(opalincludedir, pkgincludedir);
149+
EXPAND_STRING(opalfortrandir);
147150
} while (changed);
148151
}
149152

opal/mca/installdirs/config/install_dirs.h.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
* All rights reserved.
1212
* Copyright (c) 2007 Los Alamos National Security, LLC.
1313
* All rights reserved.
14+
* Copyright (c) 2016 Research Organization for Information Science
15+
* and Technology (RIST). All rights reserved.
1416
* $COPYRIGHT$
1517
*
1618
* Additional copyrights may follow
@@ -125,4 +127,6 @@
125127
this package. */
126128
#define OPAL_MANDIR "@mandir@"
127129

130+
#define OPAL_FORTRANDIR "@OMPI_FORTRAN_DIR@"
131+
128132
#endif

opal/mca/installdirs/config/opal_installdirs_config.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/*
22
* Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights
33
* reserved.
4+
* Copyright (c) 2016 Research Organization for Information Science
5+
* and Technology (RIST). All rights reserved.
46
* $COPYRIGHT$
57
*
68
* Additional copyrights may follow
@@ -51,6 +53,7 @@ const opal_installdirs_base_component_t mca_installdirs_config_component = {
5153
OPAL_MANDIR,
5254
OPAL_PKGDATADIR,
5355
OPAL_PKGLIBDIR,
54-
OPAL_PKGINCLUDEDIR
56+
OPAL_PKGINCLUDEDIR,
57+
OPAL_FORTRANDIR
5558
}
5659
};

opal/mca/installdirs/env/opal_installdirs_env.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights
33
* reserved.
44
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
5+
* Copyright (c) 2016 Research Organization for Information Science
6+
* and Technology (RIST). All rights reserved.
57
* $COPYRIGHT$
68
*
79
* Additional copyrights may follow
@@ -78,6 +80,7 @@ installdirs_env_open(void)
7880
SET_FIELD(opaldatadir, "OPAL_PKGDATADIR");
7981
SET_FIELD(opallibdir, "OPAL_PKGLIBDIR");
8082
SET_FIELD(opalincludedir, "OPAL_PKGINCLUDEDIR");
83+
SET_FIELD(opalfortrandir, "OPAL_FORTRANDIR");
8184

8285
return OPAL_SUCCESS;
8386
}

opal/mca/installdirs/installdirs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
/*
33
* Copyright (c) 2006-2015 Los Alamos National Security, LLC. All rights
44
* reserved.
5+
* Copyright (c) 2016 Research Organization for Information Science
6+
* and Technology (RIST). All rights reserved.
57
* $COPYRIGHT$
68
*
79
* Additional copyrights may follow
@@ -58,6 +60,7 @@ struct opal_install_dirs_t {
5860
char* opaldatadir;
5961
char* opallibdir;
6062
char* opalincludedir;
63+
char* opalfortrandir;
6164
};
6265
typedef struct opal_install_dirs_t opal_install_dirs_t;
6366

opal/tools/wrappers/opal_wrapper.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,11 @@ data_callback(const char *key, const char *value)
360360
opal_argv_append_nosize(&options_data[parse_options_idx].link_flags, line);
361361
free(line);
362362
}
363+
} else if (0 == strcmp(key, "fortrandir")) {
364+
char *env = getenv("OPAL_FORTRANDIR");
365+
if (NULL == env) {
366+
opal_install_dirs.opalfortrandir = strdup((NULL==value)?"":value);
367+
}
363368
}
364369
}
365370

0 commit comments

Comments
 (0)