Skip to content

Commit

Permalink
Merge pull request #217 from lcw/fixopenmpi
Browse files Browse the repository at this point in the history
Add RTLD_GLOBAL for loading OpenMPI
  • Loading branch information
vchuravy authored Oct 3, 2018
2 parents 400beca + 45f909c commit 35b4ee3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/MPI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ const mpitype_dict_inverse = Dict{Cint, DataType}()
end

function __init__()
@static if Compat.Sys.isunix()
# need to open libmpi with RTLD_GLOBAL flag for Linux, before
# any ccall cannot use RTLD_DEEPBIND; this leads to segfaults
# at least on Ubuntu 15.10
Libdl.dlopen(libmpi, Libdl.RTLD_LAZY | Libdl.RTLD_GLOBAL)
end

# Note: older versions of OpenMPI (e.g. the version on Travis) do not
# define MPI_CHAR and MPI_*INT*_T for Fortran, so we don't use them (yet).
for (T,mpiT) in (Char => MPI_INTEGER4, # => MPI_WCHAR, (note: wchar_t is 16 bits in Windows)
Expand Down

0 comments on commit 35b4ee3

Please sign in to comment.