Skip to content

Commit 5d9a3c2

Browse files
committed
README: Provide example of differing linker search paths
I ran into this exact case on MacOS (the C and Fortran compiler have different default linker search paths). Technically, we've always had this problem, but it has just become a bit more likely for real people to run into because we're now preferring the system-installed Libevent. Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
1 parent 6f2a5b9 commit 5d9a3c2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,23 @@ Compiler Notes
230230
example, such configurations may require additional compiler /
231231
linker flags to make Open MPI build properly.
232232

233+
A not-uncommon case for this is when building on MacOS with the
234+
system-default GCC compiler (i.e., /usr/bin/gcc), but a 3rd party
235+
gfortran (e.g., provided by Homebrew, in /usr/local/bin/gfortran).
236+
Since these compilers are provided by different organizations, they
237+
have different default search paths. For example, if Homebrew has
238+
also installed a local copy of Libevent (a 3rd party package that
239+
Open MPI requires), the MacOS-default gcc linker will find it
240+
without any additional command line flags, but the Homebrew-provided
241+
gfortran linker will not. In this case, it may be necessary to
242+
provide the following on the configure command line:
243+
244+
$ ./configure FCFLAGS=-L/usr/local/lib ...
245+
246+
This -L flag will then be passed to the Fortran linker when creating
247+
Open MPI's Fortran libraries, and it will therefore be able to find
248+
the installed Libevent.
249+
233250
- In general, the latest versions of compilers of a given vendor's
234251
series have the least bugs. We have seen cases where Vendor XYZ's
235252
compiler version A.B fails to compile Open MPI, but version A.C

0 commit comments

Comments
 (0)