@@ -13,7 +13,7 @@ dnl All rights reserved.
13
13
dnl Copyright (c) 2007 Los Alamos National Security, LLC. All rights
14
14
dnl reserved.
15
15
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
16
- dnl Copyright (c) 2009-2013 Cisco Systems, Inc. All rights reserved.
16
+ dnl Copyright (c) 2009-2014 Cisco Systems, Inc. All rights reserved.
17
17
dnl $COPYRIGHT $
18
18
dnl
19
19
dnl Additional copyrights may follow
@@ -115,23 +115,26 @@ AC_DEFUN([OMPI_SETUP_FC],[
115
115
[AC_FC_SRCEXT(f)
116
116
AC_FC_SRCEXT(f90)])
117
117
118
- # Per #1982, on OS X, we may need some esoteric linker flags in
119
- # the wrapper compilers. Assume that we need it for both F77 and
120
- # FC flags (note that in an upcoming update where there will only
121
- # be one Fortran compiler, anyway).
118
+ # Per trac #1982, on OS X, we may need some esoteric linker flags
119
+ # in the wrapper compilers. However, per
120
+ # https://github.com/open-mpi/ompi/issues/259, we need to use
121
+ # -Wl,-flat_namespace when *building* the library (and
122
+ # -Wl,-commons,use_dylibs isn't quite sufficient).
122
123
AS_IF([test $ompi_fc_happy -eq 1],
123
124
[AC_MSG_CHECKING([to see if Fortran compilers need additional linker flags])
124
125
case " $host " in
125
126
* apple-darwin* )
126
- # Test whether -Wl,-commons,use_dylibs works; if it
127
- # does, use it.
127
+ # Test whether -Wl,-flat_namespace works; if it does,
128
+ # both use it to build the libraries, and also put it
129
+ # in the wrapper compiler LDFLAGS.
128
130
LDFLAGS_save=$LDFLAGS
129
- LDFLAGS=" $LDFLAGS -Wl,-commons,use_dylibs "
131
+ LDFLAGS=" $LDFLAGS -Wl,-flat_namespace "
130
132
AC_LANG_PUSH([Fortran])
131
133
AC_LINK_IFELSE([AC_LANG_SOURCE([[program test
132
134
integer :: i
133
135
end program]])],
134
- [OMPI_FORTRAN_WRAPPER_FLAGS= " -Wl,-commons,use_dylibs"
136
+ [LDFLAGS_save= $LDFLAGS
137
+ OMPI_FORTRAN_WRAPPER_FLAGS= " -Wl,-flat_namespace"
135
138
OPAL_WRAPPER_FLAGS_ADD([FCFLAGS], [$OMPI_FORTRAN_WRAPPER_FLAGS ])],
136
139
[OMPI_FORTRAN_WRAPPER_FLAGS= none])
137
140
AC_LANG_POP([Fortran])
0 commit comments